Re: Buggy cvs-wrap
Re: Buggy cvs-wrap
- Subject: Re: Buggy cvs-wrap
- From: "Sven A. Schmidt" <email@hidden>
- Date: Wed, 29 Jan 2003 14:04:02 +0100
I've tracked some of my recent problems with nib and rtfd wrapping down
to
whitespace in file names as well. It seems that when cvs calls cvs-wrap
and -unwrap it doesn't properly escape whitespace or quote the filename.
I've modified cvs-wrap to also accept an additional argument and then
check if the file "$1 $2" exists. It's a bit of a workaround, but at
least
one can have "Release Notes.rtfd" again.
I've included my version of cvs-wrap below. cvs-unwrap need to be
modified similarly.
(I'm crossposting this to projectbuiled-users, since I sort of follow
up on a previous message of mine that I posted there just last week.)
#!/bin/sh
#
# cvs-wrap - Combine a directory into a single tar package.
#
#ident $Id
program="`basename $0`"
usage="Usage: $program directory output-tarfile
Wraps a directory into a gzipped tar file.
"
expr=/bin/expr
gzip=gzip
tar=tar
for option
do
case "$option" in
-h | --help)
echo "$usage"
exit 1
;;
-*)
echo "$program: Unknown option: $option"
echo "$usage"
exit 1
;;
*)
;;
esac
done
if [[ $# -lt 2 || $# -gt 3 ]]; then
echo "$program: Invalid parameters."
echo "$usage"
exit 1
fi
# The cwd should be set to "`dirname $1`" by cvs when this script is
called.
directory="`basename $1`"
if [[ $# -eq 3 && -e "${1##*/} $2" ]]; then
directory="${1##*/} $2"
shift
else
echo "$program: Invalid parameters."
echo "$usage"
exit 1
fi
#if [ ! -d "$directory" ]; then
# echo "$program: \`$directory' is not a directory."
# echo "$usage"
# exit 1
#fi
if $expr "$2" : "^/" > /dev/null ; then
output_file="$2"
else
output_file="`pwd`/$2"
fi
gnutar --preserve --sparse -cf - "$directory" |
gzip --no-name --best -c > "$output_file"
exit 0
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.