[pacman-dev] [PATCH] links problem in bacman

Carlo Bersani carlocci at gmail.com
Mon Jun 16 12:05:07 EDT 2008


I just discovered test -e tries to resolve the link before testing, so if the 
link is copied before the actual file, the script exits.
Here's the simple fix to this bug:


--- bacman	2008-06-16 17:42:45.000000000 +0200
+++ bacman.new	2008-06-16 17:52:17.000000000 +0200
@@ -136,7 +136,7 @@
                 bsdtar -cnf - "/$i" 2> /dev/null | bsdtar -xpf -
 
                 # Workaround to bsdtar not reporting a missing file as an 
error
-                if [ ! -e "$work_dir"/"$i" ]; then
+                if [ ! -e "$work_dir"/"$i" ] && [ ! -L "$work_dir"/"$i" ]; 
then
                     echo ""
                     echo "ERROR: unable to add /$i to the package"
                     echo "       If your user does not have permssion to read 
this file then"




More information about the pacman-dev mailing list