1 #tar xz targzs to destination
5 #check if files exist on destination except symlinks to directories
6 tar tzf
"$targz_file" |
grep -v "/$" | \
8 [ -e "$DIR_DST"/"$line" ] && echo "$line"
9 done |
grep -vFx "$(cat "$DIR_DST"/var/lib/instpkg/local/*/dirlinks 2> /dev/null)"
14 while read targz_file
; do
16 if [ $chk_dirlinks ]; then
18 [ ! -z "$LS_EXIST" ] && echo "$LS_EXIST" |
sed "s%.*%$targz_file : '&' exists on destination path%" && exit 1
20 tar xzf
"$targz_file" -C "$DIR_DST" 2> /dev
/null
22 #2 return code (value) (error) eg.: overwriting an existing directory with symbolic link
23 if [ "$retval" = 2 ]; then
24 tar tzf
"$targz_file" |
grep -v "/$" | \
26 #[ -d "$DIR_DST"/"$file" -a ! -L "$DIR_DST"/"$file" ] && echo "$file"
27 [ -d "$DIR_DST"/"$file" -a ! -L "$DIR_DST"/"$file" ] && rm -rf "$DIR_DST"/"$file"
29 tar xzf
"$targz_file" -C "$DIR_DST" 2> /dev
/null
34 [ "$1" = "-c" ] && chk_dirlinks
=1 && shift
44 [ ! -d "$DIR_SRC" ] && echo "No such source directory" && exit 1
45 [ ! -d "$DIR_DST" ] && echo "No such destination directory" && exit 1
47 DIR_DST
=`cd "$DIR_DST" && pwd -P`
48 [ "$?" != 0 ] && echo "Cannot change to destination directory" && exit 1
51 [ "$?" != 0 ] && echo "Cannot change to source directory" && exit 1
53 if [ -n "$TGZ" ]; then
56 ls *.
tar.gz
2> /dev
/null | untargz