From 497ee72bcdad6d02507340f9de99bc4916a2348f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 11 Mar 2012 16:38:22 +0100 Subject: [PATCH] fix permissions --- misc/tools/zipdiff | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/misc/tools/zipdiff b/misc/tools/zipdiff index d0e5acfb..00af9814 100755 --- a/misc/tools/zipdiff +++ b/misc/tools/zipdiff @@ -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 -- 2.39.2