<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 30, 2013 at 11:00 AM, Dave Reisner <span dir="ltr"><<a href="mailto:dreisner@archlinux.org" target="_blank">dreisner@archlinux.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Now that die() properly forwards arguments to error(), we can expect<br>
that the first arg is a format string and not the entirety of the<br>
output.<br>
<br>
Signed-off-by: Dave Reisner <<a href="mailto:dreisner@archlinux.org">dreisner@archlinux.org</a>><br>
---<br>
<a href="http://arch-nspawn.in" target="_blank">arch-nspawn.in</a> | 4 ++--<br>
<a href="http://archco.in" target="_blank">archco.in</a> | 2 +-<br>
<a href="http://archrelease.in" target="_blank">archrelease.in</a> | 6 +++---<br>
<a href="http://checkpkg.in" target="_blank">checkpkg.in</a> | 4 ++--<br>
<a href="http://commitpkg.in" target="_blank">commitpkg.in</a> | 10 +++++-----<br>
<a href="http://crossrepomove.in" target="_blank">crossrepomove.in</a> | 2 +-<br>
<a href="http://find-libdeps.in" target="_blank">find-libdeps.in</a> | 2 +-<br>
<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a> | 14 +++++++-------<br>
<a href="http://mkarchroot.in" target="_blank">mkarchroot.in</a> | 4 ++--<br>
9 files changed, 24 insertions(+), 24 deletions(-)<br>
<br>
diff --git a/<a href="http://arch-nspawn.in" target="_blank">arch-nspawn.in</a> b/<a href="http://arch-nspawn.in" target="_blank">arch-nspawn.in</a><br>
index 8ef39ed..f52afe9 100644<br>
--- a/<a href="http://arch-nspawn.in" target="_blank">arch-nspawn.in</a><br>
+++ b/<a href="http://arch-nspawn.in" target="_blank">arch-nspawn.in</a><br>
@@ -88,9 +88,9 @@ umask 0022<br>
<br>
# Sanity check<br>
if [[ ! -f "$working_dir/.arch-chroot" ]]; then<br>
- die "'$working_dir' does not appear to be a Arch chroot."<br>
+ die "'%s' does not appear to be a Arch chroot." "$working_dir"<br>
elif [[ $(cat "$working_dir/.arch-chroot") != $CHROOT_VERSION ]]; then<br>
- die "chroot '$working_dir' is not at version $CHROOT_VERSION. Please rebuild."<br>
+ die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" "$CHROOT_VERSION"<br>
fi<br>
<br>
build_mount_args<br>
diff --git a/<a href="http://archco.in" target="_blank">archco.in</a> b/<a href="http://archco.in" target="_blank">archco.in</a><br>
index 1ee977e..29e4cd6 100644<br>
--- a/<a href="http://archco.in" target="_blank">archco.in</a><br>
+++ b/<a href="http://archco.in" target="_blank">archco.in</a><br>
@@ -15,7 +15,7 @@ case $scriptname in<br>
communityco)<br>
SVNURL="svn+ssh://<a href="http://svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn" target="_blank">svn-community@nymeria.archlinux.org/srv/repos/svn-community/svn</a>";;<br>
*)<br>
- die "Couldn't find svn url for $scriptname"<br>
+ die "Couldn't find svn url for %s" $scriptname"<br>
;;<br>
</blockquote><div><br></div><div>You forgot a quote: $scriptname" -> "$scriptname"</div><div><br></div><div>Eric<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
esac<br>
<br>
diff --git a/<a href="http://archrelease.in" target="_blank">archrelease.in</a> b/<a href="http://archrelease.in" target="_blank">archrelease.in</a><br>
index 2e742c2..6f52dbc 100644<br>
--- a/<a href="http://archrelease.in" target="_blank">archrelease.in</a><br>
+++ b/<a href="http://archrelease.in" target="_blank">archrelease.in</a><br>
@@ -8,8 +8,8 @@ FORCE=<br>
while getopts ':f' flag; do<br>
case $flag in<br>
f) FORCE=1 ;;<br>
- :) die "Option requires an argument -- '$OPTARG'" ;;<br>
- \?) die "Invalid option -- '$OPTARG'" ;;<br>
+ :) die "Option requires an argument -- '%s'" "$OPTARG" ;;<br>
+ \?) die "Invalid option -- '%s'" "$OPTARG" ;;<br>
esac<br>
done<br>
shift $(( OPTIND - 1 ))<br>
@@ -23,7 +23,7 @@ fi<br>
if [[ -z $FORCE ]]; then<br>
for tag in "$@"; do<br>
if ! in_array "$tag" "${_tags[@]}"; then<br>
- die 'archrelease: Invalid tag: "'$tag'" (use -f to force release)'<br>
+ die "archrelease: Invalid tag: '%s' (use -f to force release)" "$tag"<br>
fi<br>
done<br>
fi<br>
diff --git a/<a href="http://checkpkg.in" target="_blank">checkpkg.in</a> b/<a href="http://checkpkg.in" target="_blank">checkpkg.in</a><br>
index 95bf049..8e0f574 100644<br>
--- a/<a href="http://checkpkg.in" target="_blank">checkpkg.in</a><br>
+++ b/<a href="http://checkpkg.in" target="_blank">checkpkg.in</a><br>
@@ -41,13 +41,13 @@ for _pkgname in "${pkgname[@]}"; do<br>
pkgurl=$(pacman -Spdd --print-format '%l' --noconfirm "$_pkgname")<br>
<br>
if [[ $? -ne 0 ]]; then<br>
- die "Couldn't download previous package for $_pkgname."<br>
+ die "Couldn't download previous package for %s." "$_pkgname"<br>
fi<br>
<br>
oldpkg=${pkgurl##*://*/}<br>
<br>
if [[ ${oldpkg##*/} = ${pkgfile##*/} ]]; then<br>
- die "The built package ($_pkgname) is the one in the repo right now!"<br>
+ die "The built package (%s) is the one in the repo right now!" "$_pkgname"<br>
fi<br>
<br>
if [[ ! -f $oldpkg ]]; then<br>
diff --git a/<a href="http://commitpkg.in" target="_blank">commitpkg.in</a> b/<a href="http://commitpkg.in" target="_blank">commitpkg.in</a><br>
index db78517..ad1005b 100644<br>
--- a/<a href="http://commitpkg.in" target="_blank">commitpkg.in</a><br>
+++ b/<a href="http://commitpkg.in" target="_blank">commitpkg.in</a><br>
@@ -58,7 +58,7 @@ esac<br>
# check if all local source files are under version control<br>
for s in "${source[@]}"; do<br>
if [[ $s != *://* ]] && ! svn status -v "$s@" | grep -q '^[ AMRX~]'; then<br>
- die "$s is not under version control"<br>
+ die "%s is not under version control" "$s"<br>
fi<br>
done<br>
<br>
@@ -68,7 +68,7 @@ for i in 'changelog' 'install'; do<br>
# evaluate any bash variables used<br>
eval file=\"$(sed 's/^\(['\''"]\)\(.*\)\1$/\2/' <<< "$file")\"<br>
if ! svn status -v "${file}" | grep -q '^[ AMRX~]'; then<br>
- die "${file} is not under version control"<br>
+ die "%s is not under version control" "$file"<br>
fi<br>
done < <(sed -n "s/^[[:space:]]*$i=//p" PKGBUILD)<br>
done<br>
@@ -81,8 +81,8 @@ while getopts ':l:a:s:f' flag; do<br>
s) server=$OPTARG ;;<br>
l) rsyncopts+=("--bwlimit=$OPTARG") ;;<br>
a) commit_arch=$OPTARG ;;<br>
- :) die "Option requires an argument -- '$OPTARG'" ;;<br>
- \?) die "Invalid option -- '$OPTARG'" ;;<br>
+ :) die "Option requires an argument -- '%s'" "$OPTARG" ;;<br>
+ \?) die "Invalid option -- '%s'" "$OPTARG" ;;<br>
esac<br>
done<br>
shift $(( OPTIND - 1 ))<br>
@@ -164,7 +164,7 @@ for _arch in ${arch[@]}; do<br>
gpg --detach-sign --use-agent ${SIGNWITHKEY} "${pkgfile}" || die<br>
fi<br>
if ! gpg --verify "$sigfile" >/dev/null 2>&1; then<br>
- die "Signature ${pkgfile}.sig is incorrect!"<br>
+ die "Signature %s.sig is incorrect!" "$pkgfile"<br>
fi<br>
uploads+=("$sigfile")<br>
done<br>
diff --git a/<a href="http://crossrepomove.in" target="_blank">crossrepomove.in</a> b/<a href="http://crossrepomove.in" target="_blank">crossrepomove.in</a><br>
index 1d4ae6c..912504f 100644<br>
--- a/<a href="http://crossrepomove.in" target="_blank">crossrepomove.in</a><br>
+++ b/<a href="http://crossrepomove.in" target="_blank">crossrepomove.in</a><br>
@@ -25,7 +25,7 @@ case $scriptname in<br>
target_repo='extra'<br>
;;<br>
*)<br>
- die "Couldn't find configuration for $scriptname"<br>
+ die "Couldn't find configuration for %s" "$scriptname"<br>
;;<br>
esac<br>
<br>
diff --git a/<a href="http://find-libdeps.in" target="_blank">find-libdeps.in</a> b/<a href="http://find-libdeps.in" target="_blank">find-libdeps.in</a><br>
index 36e2c43..c9b451e 100644<br>
--- a/<a href="http://find-libdeps.in" target="_blank">find-libdeps.in</a><br>
+++ b/<a href="http://find-libdeps.in" target="_blank">find-libdeps.in</a><br>
@@ -16,7 +16,7 @@ script_mode=${0##*/find-lib}<br>
<br>
case $script_mode in<br>
deps|provides) true;;<br>
- *) die "Unknown mode $script_mode" ;;<br>
+ *) die "Unknown mode %s" "$script_mode" ;;<br>
esac<br>
<br>
if [[ -z $1 ]]; then<br>
diff --git a/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a> b/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
index d7d3ecf..1cd08fb 100644<br>
--- a/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
+++ b/<a href="http://makechrootpkg.in" target="_blank">makechrootpkg.in</a><br>
@@ -81,8 +81,8 @@ done<br>
<br>
# Canonicalize chrootdir, getting rid of trailing /<br>
chrootdir=$(readlink -e "$passeddir")<br>
-[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '$passeddir'"<br>
-[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot $chrootdir/root base-devel"<br>
+[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"<br>
+[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"<br>
<br>
# Detect chrootdir filesystem type<br>
chroottype=$(stat -f -c %T "$chrootdir")<br>
@@ -136,10 +136,10 @@ create_chroot() {<br>
if [[ "$chroottype" == btrfs ]]; then<br>
if [[ -d $copydir ]]; then<br>
btrfs subvolume delete "$copydir" >/dev/null ||<br>
- die "Unable to delete subvolume $copydir"<br>
+ die "Unable to delete subvolume %s" "$copydir"<br>
fi<br>
btrfs subvolume snapshot "$chrootdir/root" "$copydir" >/dev/null ||<br>
- die "Unable to create subvolume $copydir"<br>
+ die "Unable to create subvolume %s" "$copydir"<br>
else<br>
mkdir -p "$copydir"<br>
rsync -a --delete -q -W -x "$chrootdir/root/" "$copydir"<br>
@@ -155,11 +155,11 @@ clean_temporary() {<br>
stat_busy "Removing temporary copy [$copy]"<br>
if [[ "$chroottype" == btrfs ]]; then<br>
btrfs subvolume delete "$copydir" >/dev/null ||<br>
- die "Unable to delete subvolume $copydir"<br>
+ die "Unable to delete subvolume %s" "$copydir"<br>
else<br>
# avoid change of filesystem in case of an umount failure<br>
rm --recursive --force --one-file-system "$copydir" ||<br>
- die "Unable to delete $copydir"<br>
+ die "Unable to delete %s" "$copydir"<br>
fi<br>
<br>
# remove lock file<br>
@@ -362,7 +362,7 @@ if (( ret != 0 )); then<br>
if $temp_chroot; then<br>
die "Build failed"<br>
else<br>
- die "Build failed, check $copydir/build"<br>
+ die "Build failed, check %s/build" "$copydir"<br>
fi<br>
else<br>
true<br>
diff --git a/<a href="http://mkarchroot.in" target="_blank">mkarchroot.in</a> b/<a href="http://mkarchroot.in" target="_blank">mkarchroot.in</a><br>
index 970bbb9..7cdb274 100644<br>
--- a/<a href="http://mkarchroot.in" target="_blank">mkarchroot.in</a><br>
+++ b/<a href="http://mkarchroot.in" target="_blank">mkarchroot.in</a><br>
@@ -51,7 +51,7 @@ fi<br>
<br>
umask 0022<br>
<br>
-[[ -e $working_dir ]] && die "Working directory '$working_dir' already exists"<br>
+[[ -e $working_dir ]] && die "Working directory '%s' already exists" "$working_dir"<br>
<br>
mkdir -p "$working_dir"<br>
<br>
@@ -60,7 +60,7 @@ lock 9 "${working_dir}.lock" "Locking chroot"<br>
if [[ $(stat -f -c %T "$working_dir") == btrfs ]]; then<br>
rmdir "$working_dir"<br>
if ! btrfs subvolume create "$working_dir"; then<br>
- die "Couldn't create subvolume for '$working_dir'"<br>
+ die "Couldn't create subvolume for '%s'" "$working_dir"<br>
fi<br>
chmod 0755 "$working_dir"<br>
fi<br>
<span class=""><font color="#888888">--<br>
1.8.3.4<br>
<br>
</font></span></blockquote></div><br></div></div>