]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
fix permissions
authorRudolf Polzer <divverent@xonotic.org>
Sun, 11 Mar 2012 15:38:22 +0000 (16:38 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 11 Mar 2012 15:38:22 +0000 (16:38 +0100)
misc/tools/zipdiff

index d0e5acfb11836f545c0d195cc0b0f694df2f12b3..00af981458bc66975e870e8280fba9269d8dbae8 100755 (executable)
@@ -61,6 +61,10 @@ done
 [ -n "$from" ] || usage
 [ -n "$to" ] || usage
 
+case "$output" in '') ;; /*) ;; *) output=`pwd`/$output ;; esac
+case "$from" in /*) ;; *) from=`pwd`/$from ;; esac
+case "$to" in /*) ;; *) to=`pwd`/$to ;; esac
+
 found()
 {
        type=$1
@@ -166,21 +170,13 @@ case "$output" in
        *)
                rm -f "$output"
                if [ -n "$result" ]; then
+                       cd "$tempdir"
                        echo "$result" | while IFS= read -r line; do
                                echo >&2 "extracting $line..."
                                dline=./$line
                                mkdir -p "$tempdir/${dline%/*}"
-                               unzip -p "$to" "$line" > "$tempdir/$line" # this may create an empty file - don't care, DP handles this as deletion
-                               # FIXME permissions
+                               unzip "$to" "$line"
                        done
-                       case "$output" in
-                               /*)
-                                       ;;
-                               *)
-                                       output=`pwd`/$output
-                                       ;;
-                       esac
-                       cd "$tempdir"
                        $ziptool "$output" .
                        cd ..
                fi