summaryrefslogtreecommitdiff
path: root/contrib/pacscripts.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pacscripts.in')
-rwxr-xr-xcontrib/pacscripts.in18
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/pacscripts.in b/contrib/pacscripts.in
index 37d3feae..84687145 100755
--- a/contrib/pacscripts.in
+++ b/contrib/pacscripts.in
@@ -24,8 +24,8 @@
set -o nounset
set -o errexit
-progname=$(basename $0)
-progver="0.4"
+declare -r myname='pacscripts'
+declare -r myver='@PACKAGE_VERSION@'
conf="@sysconfdir@/pacman.conf"
@@ -47,14 +47,20 @@ 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"
+}
+
+version() {
+ printf "%s %s\n" "$myname" "$myver"
+ echo 'Copyright (c) 2009 Giulio "giulivo" Fidente <giulivo.navigante@gmail.com>'
+ echo 'Copyright (c) 2009 Xavier Chantry <shiningxc@gmail.com>'
}
spacman() {
@@ -127,6 +133,6 @@ fi
case "$1" in
--help|-h) usage; exit 0 ;;
- --version|-v) echo "$progname version $progver"; exit 0 ;;
+ --version|-V) version; exit 0 ;;
*) print_scriptlet $1 ;;
esac