Opened 21 years ago

Closed 21 years ago

Last modified 8 years ago

#725 closed defect (fixed)

UPDATE apache-ant-1.5.3-1

Reported by: pguyot (Paul Guyot) Owned by: sean@…
Priority: Normal Milestone:
Component: ports Version: 1.0
Keywords: Cc: fkr@…
Port: apache-ant

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Apparently a bug made its way in latest attachment here:

#357

-       system "ln -fs ${path}${name}/bin/ant ${destroot}${prefix}/bin/ant"
+    system "cd ${destroot} &&
+        ln -fs ${prefix}/java/${name}/bin/ant ${prefix}/bin/ant"

${prefix} is /opt/local/ (well, usually), so this will end up making a link in /opt/local/bin/ in spite of the cd ${destroot}. So the symlink won't be registered as part of the port and won't be included in a package.

Instead, I suggest doing the following:

--- Portfile.old        Wed Jul 23 07:03:36 2003
+++ Portfile    Wed Jul 23 07:38:51 2003
@@ -35,8 +35,7 @@
        system "cd ${worksrcpath}; cp -R ${name} ${path}"
        system "rm ${path}${name}/bin/*.bat"
     system "chmod -R ugo+r ${path}${name}" 
-       system "cd ${destroot} &&
-       ln -fs ${prefix}/java/${name}/bin/ant ${prefix}/bin/ant"
+       system "ln -fs {prefix}/java/${name}/bin/ant ${destroot}${prefix}/bin/ant"
 }
 
 variant darwin {

but maybe the original line is more coherent with the usual policy regarding symlinks, i.e. to make them relative and not absolute.

Change History (6)

comment:1 Changed 21 years ago by fkr@…

I believe, your suggestion will break package creation, since it creates a symlink outside the destroot.

-fkr

comment:2 Changed 21 years ago by pguyot (Paul Guyot)

Er. I don't think so. The current portfile creates a symlink outside the destroot.

My suggestion breaks because I forgot a $ in front of {prefix}, but it does create the symlink into ${destroot}${prefix}/bin/ant to ${prefix}/java/${name}/bin/ant

So when ${destroot}${prefix}/java/${name}/bin/ant is moved to ${prefix}/java/${name}/bin/ant, the link works.

After an uninstall, fix in the Portfile, clean and install, I have:

[1:11]/<9+>local/bin(13)> ls -l ant
lrwxr-xr-x  1 root  admin  34 Jul 30 01:09 ant -> /opt/local/java/apache-ant/bin/ant
[1:12]/<9+>local/bin(14)> pwd
/Volumes/Screwy/src/opendarwin/darwinports/dports/devel/apache-ant/work/destroot/opt/local/bin
[1:12]/<9+>local/bin(15)> cd /opt/local/bin/
[1:12]/<1>local/bin(16)> ls -l ant
lrwxrwxr-x  1 root  admin  34 Jul 30 01:09 ant -> /opt/local/java/apache-ant/bin/ant

My only question is whether the policy is to have a relative symlink or not. If it's not, I think my diff (with the missing $) is a good fix for that bug.

Last edited 8 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 21 years ago by fkr@…

I believe, a releative symlink is just fine. What does the maintainer say about this? -fkr

comment:4 Changed 21 years ago by fkr@…

Cc: fkr@… added

comment:5 Changed 21 years ago by fkr@…

Resolution: fixed
Status: newclosed

thanks, this has just been fixed. -fkr

comment:6 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Port: apache-ant added
Note: See TracTickets for help on using tickets.