From 7ff1b945f6c8b2286f04626be39291a7527119f4 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Mon, 30 Jan 2012 11:47:48 +1000 Subject: makepkg: workaround for zipman issues This "fixes" two issues: 1) MAN_DIRS contains a glob by default so should not be quoted. It is not quoted anywhere else so this should not cause breakage... 2) the find statement returns 1 when some of MAN_DIRS are missing. This appears to only be exposed when running makepkg as root (which it appears some wrappers do...). Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 89045ac9..96589dd1 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -999,7 +999,8 @@ tidy_install() { # the '|| true' part keeps the script from bailing on the EOF returned # by read at the end of the find output IFS=$'\n' read -rd '' -a hardlinks < \ - <(find "${MAN_DIRS[@]}" \! -name "$file" -samefile "$manpage" 2>/dev/null) || true + <(find ${MAN_DIRS[@]} \! -name "$file" -samefile "$manpage" \ + 2>/dev/null || true) || true rm -f "${hardlinks[@]}" # compress the original gzip -9 "$manpage" -- cgit v1.2.3-24-g4f1b From 9e9835f4640a45cc758fa64de5923d7f836fe1f4 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 23 Jan 2012 17:14:25 -0500 Subject: scripts: always use printf with embedded gettext This addresses two problems: 1) echo's behavior is inconsistent when dealing with flags, and can potentially be problematic. $ echo -n $ echo -- -n -- -n 2) Always using the end of options markers prevents translated strings from throwing errors, as shown in FS#28069. The remaining "inconsistencies" are because printf is being used in a guaranteed safe manner, e.g. printf '%s\n' "$(gettext "--this can never break")" Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 78 +++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 96589dd1..e51f9ede 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -664,7 +664,7 @@ check_checksums() { echo -n " $file ... " >&2 if ! file="$(get_filepath "$file")"; then - echo "$(gettext "NOT FOUND")" >&2 + printf -- "$(gettext "NOT FOUND")\n" >&2 errors=1 found=0 fi @@ -674,9 +674,9 @@ check_checksums() { local realsum="$(openssl dgst -${integ} "$file")" realsum="${realsum##* }" if [[ $expectedsum = $realsum ]]; then - echo "$(gettext "Passed")" >&2 + printf -- "$(gettext "Passed")\n" >&2 else - echo "$(gettext "FAILED")" >&2 + printf -- "$(gettext "FAILED")\n" >&2 errors=1 fi fi @@ -1827,51 +1827,51 @@ m4_include(library/parse_options.sh) usage() { printf "makepkg (pacman) %s\n" "$myver" echo - printf "$(gettext "Usage: %s [options]")\n" "$0" + printf -- "$(gettext "Usage: %s [options]")\n" "$0" echo - echo "$(gettext "Options:")" - printf "$(gettext " -A, --ignorearch Ignore incomplete %s field in %s")\n" "arch" "$BUILDSCRIPT" - echo "$(gettext " -c, --clean Clean up work files after build")" - echo "$(gettext " -d, --nodeps Skip all dependency checks")" - printf "$(gettext " -e, --noextract Do not extract source files (use existing %s dir)")\n" "src/" - echo "$(gettext " -f, --force Overwrite existing package")" - echo "$(gettext " -g, --geninteg Generate integrity checks for source files")" - echo "$(gettext " -h, --help Show this help message and exit")" - echo "$(gettext " -i, --install Install package after successful build")" - echo "$(gettext " -L, --log Log package build process")" - echo "$(gettext " -m, --nocolor Disable colorized output messages")" - echo "$(gettext " -o, --nobuild Download and extract files only")" - printf "$(gettext " -p Use an alternate build script (instead of '%s')")\n" "$BUILDSCRIPT" - echo "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")" - echo "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")" - printf "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman" - echo "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")" - echo "$(gettext " --allsource Generate a source-only tarball including downloaded sources")" - printf "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg" - printf "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" - printf "$(gettext " --config Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf" - printf "$(gettext " --holdver Prevent automatic version bumping for development %ss")\n" "$BUILDSCRIPT" - printf "$(gettext " --key Specify a key to use for %s signing instead of the default")\n" "gpg" - printf "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" - echo "$(gettext " --nosign Do not create a signature for the package")" - echo "$(gettext " --pkg Only build listed packages from a split package")" - printf "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" - echo "$(gettext " --skipchecksums Do not verify checksums of the source files")" - echo "$(gettext " --skipinteg Do not perform any verification checks on source files")" - echo "$(gettext " --skippgpcheck Do not verify source files with PGP signatures")" + printf -- "$(gettext "Options:")" + printf -- "$(gettext " -A, --ignorearch Ignore incomplete %s field in %s")\n" "arch" "$BUILDSCRIPT" + printf -- "$(gettext " -c, --clean Clean up work files after build")\n" + printf -- "$(gettext " -d, --nodeps Skip all dependency checks")\n" + printf -- "$(gettext " -e, --noextract Do not extract source files (use existing %s dir)")\n" "src/" + printf -- "$(gettext " -f, --force Overwrite existing package")\n" + printf -- "$(gettext " -g, --geninteg Generate integrity checks for source files")\n" + printf -- "$(gettext " -h, --help Show this help message and exit")\n" + printf -- "$(gettext " -i, --install Install package after successful build")\n" + printf -- "$(gettext " -L, --log Log package build process")\n" + printf -- "$(gettext " -m, --nocolor Disable colorized output messages")\n" + printf -- "$(gettext " -o, --nobuild Download and extract files only")\n" + printf -- "$(gettext " -p Use an alternate build script (instead of '%s')")\n" "$BUILDSCRIPT" + printf -- "$(gettext " -r, --rmdeps Remove installed dependencies after a successful build")\n" + printf -- "$(gettext " -R, --repackage Repackage contents of the package without rebuilding")\n" + printf -- "$(gettext " -s, --syncdeps Install missing dependencies with %s")\n" "pacman" + printf -- "$(gettext " -S, --source Generate a source-only tarball without downloaded sources")\n" + printf -- "$(gettext " --allsource Generate a source-only tarball including downloaded sources")\n" + printf -- "$(gettext " --asroot Allow %s to run as root user")\n" "makepkg" + printf -- "$(gettext " --check Run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" + printf -- "$(gettext " --config Use an alternate config file (instead of '%s')")\n" "$confdir/makepkg.conf" + printf -- "$(gettext " --holdver Prevent automatic version bumping for development %ss")\n" "$BUILDSCRIPT" + printf -- "$(gettext " --key Specify a key to use for %s signing instead of the default")\n" "gpg" + printf -- "$(gettext " --nocheck Do not run the %s function in the %s")\n" "check()" "$BUILDSCRIPT" + printf -- "$(gettext " --nosign Do not create a signature for the package")\n" + printf -- "$(gettext " --pkg Only build listed packages from a split package")\n" + printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" + printf -- "$(gettext " --skipchecksums Do not verify checksums of the source files")\n" + printf -- "$(gettext " --skipinteg Do not perform any verification checks on source files")\n" + printf -- "$(gettext " --skippgpcheck Do not verify source files with PGP signatures")\n" echo - printf "$(gettext "These options can be passed to %s:")\n" "pacman" + printf -- "$(gettext "These options can be passed to %s:")\n" "pacman" echo - echo "$(gettext " --noconfirm Do not ask for confirmation when resolving dependencies")" - echo "$(gettext " --noprogressbar Do not show a progress bar when downloading files")" + printf -- "$(gettext " --noconfirm Do not ask for confirmation when resolving dependencies")\n" + printf -- "$(gettext " --noprogressbar Do not show a progress bar when downloading files")\n" echo - printf "$(gettext "If %s is not specified, %s will look for '%s'")\n" "-p" "makepkg" "$BUILDSCRIPT" + printf -- "$(gettext "If %s is not specified, %s will look for '%s'")\n" "-p" "makepkg" "$BUILDSCRIPT" echo } version() { printf "makepkg (pacman) %s\n" "$myver" - printf "$(gettext "\ + printf -- "$(gettext "\ Copyright (c) 2006-2012 Pacman Development Team .\n\ Copyright (C) 2002-2006 Judd Vinet .\n\n\ This is free software; see the source for copying conditions.\n\ -- cgit v1.2.3-24-g4f1b