[57564] contrib/select/select.sh

raimue at macports.org raimue at macports.org
Sun Sep 13 03:07:36 PDT 2009


Revision: 57564
          http://trac.macports.org/changeset/57564
Author:   raimue at macports.org
Date:     2009-09-13 03:07:32 -0700 (Sun, 13 Sep 2009)
Log Message:
-----------
Accept absolute paths in the base file.
Patch from jmr, #21320

Modified Paths:
--------------
    contrib/select/select.sh

Modified: contrib/select/select.sh
===================================================================
--- contrib/select/select.sh	2009-09-13 08:20:24 UTC (rev 57563)
+++ contrib/select/select.sh	2009-09-13 10:07:32 UTC (rev 57564)
@@ -133,17 +133,21 @@
         else
             src=$(head -n ${i} ${CONFPATH}/${1} | tail -n 1)
         fi
+        
+        if [ "/" != $(echo ${target} | colrm 2) ]; then
+            target="${PREFIX}/${target}"
+        fi
 
         # test if line starts with '-' -> dont link, just rm original
         if [ "-" == $(echo ${src} | colrm 2) ]; then
             # source is unavailable for this file
-            action "rm" "${PREFIX}/${target}"
+            action "rm" "${target}"
         elif [ "/" == $(echo ${src} | colrm 2) ]; then
             # source has an absolute path
-            action "ln" "${src}" "${PREFIX}/${target}"
+            action "ln" "${src}" "${target}"
         else
             # source has relative path
-            action "ln" "${PREFIX}/${src}" "${PREFIX}/${target}"
+            action "ln" "${PREFIX}/${src}" "${target}"
         fi
         let "error = error + ${?}"
         let "i = i + 1"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090913/9bd41427/attachment.html>


More information about the macports-changes mailing list