diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2011-12-06 22:29:32 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-12-07 09:59:30 -0600 |
commit | 1038e669649dae98c1cf9c354e680c62cf25638c (patch) | |
tree | 8088a11caace799fdb96040d39fe56abf3e5f55e /contrib/bacman.in | |
parent | 48188fbeee8bc39977bc2a0200dc5fb538db9ff1 (diff) | |
download | pacman-1038e669649dae98c1cf9c354e680c62cf25638c.tar.xz |
contrib/*: Hardcode program names
Add a read-only variable "$myname" to every contrib script and hardcode
program names instead of relying on "$0". The variable name "$myname"
was chosen because it is already used in pacman and because we use
"$myver" to specify the program version in the official scripts.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'contrib/bacman.in')
-rwxr-xr-x | contrib/bacman.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/bacman.in b/contrib/bacman.in index c55d7161..00d0691b 100755 --- a/contrib/bacman.in +++ b/contrib/bacman.in @@ -23,7 +23,7 @@ shopt -s extglob shopt -s nullglob -readonly progname="bacman" +declare -r myname='bacman' readonly progver="0.2.1" # @@ -31,8 +31,8 @@ readonly progver="0.2.1" # usage() { echo "This program recreates a package using pacman's db and system files" - echo "Usage: $progname <installed package name>" - echo "Example: $progname kernel26" + echo "Usage: $myname <installed package name>" + echo "Example: $myname kernel26" } if (( $# != 1 )); then @@ -46,7 +46,7 @@ if [[ $1 == "--help" || $1 == "-h" ]]; then fi if [[ $1 == "--version" || $1 == "-v" ]]; then - echo "$progname version $progver" + echo "$myname version $progver" echo "Copyright (C) 2008 locci" exit 0 fi @@ -61,7 +61,7 @@ if (( EUID )); then /usr/bin/fakeroot -u -- "$0" "$@" exit $? else - echo "WARNING: installing fakeroot or running ${progname} as root is required to" + echo "WARNING: installing fakeroot or running $myname as root is required to" echo " preserve the ownership permissions of files in some packages" echo "" fi @@ -151,7 +151,7 @@ while read i; do echo "" echo "ERROR: unable to add /$i to the package" echo " If your user does not have permssion to read this file then" - echo " you will need to run $progname as root" + echo " you will need to run $myname as root" rm -rf "$work_dir" exit 1 fi @@ -177,7 +177,7 @@ pkg_size=$(du -sk | awk '{print $1 * 1024}') # TODO adopt makepkg's write_pkginfo() into this or scripts/library # echo Generating .PKGINFO metadata... -echo "# Generated by $progname $progver" > .PKGINFO +echo "# Generated by $myname $progver" > .PKGINFO if [[ $INFAKEROOT == "1" ]]; then echo "# Using $(fakeroot -v)" >> .PKGINFO fi |