]> pd.if.org Git - zpackage/blobdiff - zpm-preserve
added verbose option to zpm-preserve
[zpackage] / zpm-preserve
index 45617c71a971e9cd1898486c107c87a45a2cd721..3b79306b1bf72a8b7bcb3b943ed7960f3566e09c 100755 (executable)
@@ -2,6 +2,12 @@
 
 # preserve a packages libraries
 
+verbose=0
+
+if [ "$1" eq '-v' ]; then
+       verbose=1
+fi
+
 pkgname=$1
 
 pacman -Qlq "$1" | while read file; do
@@ -11,6 +17,9 @@ pacman -Qlq "$1" | while read file; do
        if [ $? -eq 0 ] && [ -n "$soname" ]; then
                dir=$(dirname "$file")
                mkdir -p $dir/preserve
-               ln $file "$dir/preserve/"
+               if [ "$verbose" -gt 0 ]; then
+                       printf 'preserving %s\n' $file
+               fi
+               ln -f $file "$dir/preserve/"
        fi
 done