Re: Management of opendocument (openoffice.org) files in git
- From
Peter Krefting <peter@softwolves.pp.se>
- Date
- Sep 23, 2008, 11:08 UTC
- Message-ID
- <Pine.LNX.4.64.0809231202560.28506@ds9.cixit.se>
- In-Reply-To
- <loom.20080915T222909-709@post.gmane.org>
Sergio Callegari:
> To try it, save the following as "rezip" with execution permission:
I had some problems when I tried to implement this a Windows machine, it did not handle paths with spaces in them properly, and "Documents and Settings" does contain spaces.
The following patch fixes that for me: --- rezip | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/rezip b/rezip index 15f83a4..845e875 100755 --- a/rezip +++ b/rezip @@ -66,7 +66,7 @@ done if [ $# = 0 ] ; then tmpcopy=$(mktemp rezip.zip.XXXXXX) - cat > $tmpcopy + cat > "$tmpcopy" filename="$tmpcopy" else tmpcopy="" @@ -76,12 +76,12 @@ fi workdir=$(mktemp -d -t rezip.workdir.XXXXXX) curdir=$(pwd) -cd $workdir +cd "$workdir" unzip $UNZIP_OPTS "$curdir/$filename" zip $ZIP_OPTS "$curdir/$filename" . -cd $curdir -rm -fr $workdir +cd "$curdir" +rm -fr "$workdir" if [ ! -z "$tmpcopy" ] ; then - cat $filename - rm $tmpcopy + cat "$filename" + rm "$tmpcopy" fi
-- \\// Peter - http://www.softwolves.pp.se/