From e453cc49a905403a45ac7e17d345444aecdf95eb Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 15 May 1999 16:11:04 +0000 Subject: [PATCH] Updated urar/uzip fs --- vfs/extfs/urar.in | 26 ++++++++++++++++++++++++++ vfs/extfs/uzip.in | 30 +++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/vfs/extfs/urar.in b/vfs/extfs/urar.in index 27bfc6a88..29beebd0a 100644 --- a/vfs/extfs/urar.in +++ b/vfs/extfs/urar.in @@ -63,12 +63,38 @@ mcrarfs_copyout () { $UNRAR p -c- -inul "$1" "$2" > $3 2>/dev/null } + +mcrarfs_mkdir () +{ +# preserve pwd. It is clean, but is it necessary? + pwd=`pwd` +# Create a directory and create in it a tmp directory with the good name + dir=tmpdir.${RANDOM} + mkdir $dir + cd $dir + mkdir -p "$2" +# rar cannot create an empty directory + touch "$2"/.rarfs + $RAR a -r "$1" "$2" &>/dev/null + $RAR d "$1" "$2"/.rarfs &>/dev/null + cd $pwd + rm -rf $dir +} + +mcrarfs_rm () +{ + $RAR d "$1" "$2" &>/dev/null +} + umask 077 # uncomment this line for debugging #echo "`date +%T` ${0##*/} $1 $2 to=$3 tmp=$4" >>/tmp/${0##*/}.log case "$1" in list) mcrarfs_list "$2"; exit 0;; + rm) mcrarfs_rm "$2" "$3" ; exit 0;; + rmdir) mcrarfs_rm "$2" "$3" ; exit 0;; + mkdir) mcrarfs_mkdir "$2" "$3" ; exit 0;; copyin) mcrarfs_copyin "$2" "$3" $4; exit 0;; copyout) mcrarfs_copyout "$2" "$3" $4; exit 0;; esac diff --git a/vfs/extfs/uzip.in b/vfs/extfs/uzip.in index 641145ba8..28eb0c80f 100644 --- a/vfs/extfs/uzip.in +++ b/vfs/extfs/uzip.in @@ -9,6 +9,7 @@ DZIP=/usr/bin XZIP="$DZIP/zip -g" +XDZIP="$DZIP/zip -d" XUNZIP="$DZIP/unzip" XZIPINFO="$DZIP/unzip -Z" # @@ -71,6 +72,20 @@ else fi } +mczipfs_mkdir () +{ +# preserve pwd. It is clean, but is it necessary? + pwd=`pwd` +# Create a directory and create in it a tmp directory with the good name + dir=tmpdir.${RANDOM} + mkdir $dir + cd $dir + mkdir -p "$2" + $XZIP "$1" "$2" &>/dev/null + cd $pwd + rm -rf $dir +} + mczipfs_copyin () { # preserve pwd. It is clean, but is it necessary? @@ -94,12 +109,25 @@ mczipfs_copyout () { $XUNZIP -p "$1" "$2" > $3 2>/dev/null } + +mczipfs_rm () +{ + $XDZIP "$1" "$2" &>/dev/null +} + +mczipfs_rmdir () +{ + $XDZIP "$1" "$2"/ &>/dev/null +} + umask 077 #echo "`date +%T` ${0##*/} $1 $2 to=$3 tmp=$4" >>/tmp/${0##*/}.log case "$1" in list) mczipfs_list "$2"; exit 0;; -# delete) mczipfs_delete "$2" "$3" ; exit 0;; + rm) mczipfs_rm "$2" "$3" ; exit 0;; + rmdir) mczipfs_rmdir "$2" "$3" ; exit 0;; + mkdir) mczipfs_mkdir "$2" "$3" ; exit 0;; copyin) mczipfs_copyin "$2" "$3" $4 ; exit 0;; copyout) mczipfs_copyout "$2" "$3" $4 ; exit 0;; esac