This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFT/RFA] bashjar patch
- From: Andreas Schwab <schwab at suse dot de>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Tom Tromey <tromey at redhat dot com>
- Date: Tue, 23 May 2006 10:59:37 +0200
- Subject: Re: [RFT/RFA] bashjar patch
- References: <e2u1im$niv$1@sea.gmane.org> <20060502192044.GD1691@iam.uni-bonn.de> <4471E06C.6010300@lu.unisi.ch>
Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:
> +# Usage: copy SRC DEST
> +# Copy file SRC to directory DEST, which is the staging area of the jar file.
> +# Fail if it is already present or if it is not a regular file.
> +copy () {
> + if test -f "$1"; then
> + # A simple optimization. Optimistically assuming that ln will work
> + # cuts 60% of the run-time!
> + if ln "$1" "$2"/"$1" > /dev/null 2>&1; then
> + return 0
> + fi
> +
> + if test -e "$2"/"$1"; then
> + error "$1": Duplicate entry.
> + fi
> + $mkdir_p "$2"/`dirname "$1"`
This lacks a pair of quotes around `dirname "$1"`. Note that "`dirname
"$1"`" is not portable, but you can work around that by assigning the
output to a variable (which does not do word splitting) and using that
instead.
> +# Usage: make_manifest destfile kind [source-manifest]
> +# Create a manifest file and store it in destfile. KIND can be "default",
> +# or "user", in which case SOURCE-MANIFEST must be specified as well.
> +make_manifest () {
> + $mkdir_p `dirname "$1"`
Likewise.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."