summaryrefslogtreecommitdiffstats
path: root/contrib/pacscripts.in
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2011-12-06 22:29:32 +0100
committerDan McGee <dan@archlinux.org>2011-12-07 16:59:30 +0100
commit1038e669649dae98c1cf9c354e680c62cf25638c (patch)
tree8088a11caace799fdb96040d39fe56abf3e5f55e /contrib/pacscripts.in
parent48188fbeee8bc39977bc2a0200dc5fb538db9ff1 (diff)
downloadpacman-1038e669649dae98c1cf9c354e680c62cf25638c.tar.gz
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/pacscripts.in')
-rwxr-xr-xcontrib/pacscripts.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/pacscripts.in b/contrib/pacscripts.in
index 37d3feae..967f7826 100755
--- a/contrib/pacscripts.in
+++ b/contrib/pacscripts.in
@@ -24,7 +24,7 @@
set -o nounset
set -o errexit
-progname=$(basename $0)
+declare -r myname='pacscripts'
progver="0.4"
conf="@sysconfdir@/pacman.conf"
@@ -47,14 +47,14 @@ error() {
usage() {
echo "This program prints out the {pre,post}_{install,remove,upgrade} scripts"
echo "of a given package."
- echo "Usage: $progname pkgname|pkgfile"
+ echo "Usage: $myname pkgname|pkgfile"
echo
echo " OPTIONS:"
echo " -h, --help Print this help message"
echo " -v, --version Print program name and version"
echo
- echo "Example: $progname gconf-editor"
- echo "Example: $progname gconf-editor-2.24.1-1-x86_64.pkg.tar.gz"
+ echo "Example: $myname gconf-editor"
+ echo "Example: $myname gconf-editor-2.24.1-1-x86_64.pkg.tar.gz"
}
spacman() {
@@ -127,6 +127,6 @@ fi
case "$1" in
--help|-h) usage; exit 0 ;;
- --version|-v) echo "$progname version $progver"; exit 0 ;;
+ --version|-v) echo "$myname version $progver"; exit 0 ;;
*) print_scriptlet $1 ;;
esac