[pacman-dev] [PATCH v4 4/8] bacman: rewrite usage page and version information

Gordian Edenhofer gordian.edenhofer at gmail.com
Thu Sep 1 13:43:19 UTC 2016


Signed-off-by: Gordian Edenhofer <gordian.edenhofer at gmail.com>
---
Move the '-o' occurrance in the usage page to its corresponding commit.
Use the old descrption instead of the new one. (Fixes typo)
Thanks again Allan!

 contrib/bacman.sh.in | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/contrib/bacman.sh.in b/contrib/bacman.sh.in
index 51283f3..20f5939 100644
--- a/contrib/bacman.sh.in
+++ b/contrib/bacman.sh.in
@@ -41,25 +41,32 @@ clean_up() {
 	echo
 	exit
 }
-
 # Trap termination signals
 trap clean_up SIGHUP SIGINT SIGTERM
 
 # Print usage information
 usage() {
-	echo "${myname} (pacman) v${myver}"
-	echo
-	echo "Recreate a package using pacman's database and system files"
-	echo
-	echo "Usage: ${myname} [--nocolor] [--pacnew] <installed package name>"
-	echo
-	echo "Example: ${myname} linux-headers"
+	cat <<-EOF
+	$myname (pacman) v$myver
+	Recreate packages using pacman's database and system files
+
+	Usage: $myname [options] <package(s)>
+
+	    -h, --help              display this help message and exit
+	    --nocolor               turn off color in output
+	    --pacnew                package .pacnew files
+
+	Examples:   # $myname linux-headers
+	            # $myname --nocolor --pacnew gzip munge binutils
+	            # $myname \$(pacman -Qsq)
+	EOF
 }
 
 # Print version information
 version() {
 	printf "%s %s\n" "$myname" "$myver"
 	echo 'Copyright (C) 2008 locci <carlocci_at_gmail_dot_com>'
+	echo 'Copyright (C) 2016 Gordian Edenhofer <gordian.edenhofer at gmail.com>'
 	echo 'Copyright (C) 2008-2016 Pacman Development Team <pacman-dev at archlinux.org>'
 }
 
@@ -123,7 +130,7 @@ if (( EUID )); then
 	fi
 fi
 
-# Source environmental variables and specify fallbacks
+# Read in environmental variables
 if [[ ! -r @sysconfdir@/pacman.conf ]]; then
 	error "unable to read @sysconfdir@/pacman.conf"
 	exit 1
@@ -139,7 +146,7 @@ if [[ -r ~/.makepkg.conf ]]; then
 	source ~/.makepkg.conf
 fi
 pkg_dest="${PKGDEST:-$PWD}"
-pkg_pkger=${PACKAGER:-'Unknown Packager'}
+pkg_pkger="${PACKAGER:-'Unknown Packager'}"
 
 # Check for an existing database
 if [[ ! -d $pac_db ]]; then
@@ -339,6 +346,7 @@ fakebuild() {
 	pkg_file="$pkg_dest/$pkg_namver-$pkg_arch${PKGEXT}"
 	ret=0
 
+	# Move compressed package to destination
 	# TODO: Maybe this can be set globally for robustness
 	shopt -s -o pipefail
 	bsdtar -cf - $comp_files * |
@@ -352,7 +360,7 @@ fakebuild() {
 		"$PKGEXT"; cat ;;
 	esac > "${pkg_file}"; ret=$?
 
-	# Move compressed package to destination
+	# Evaluate return code
 	if (( ret )); then
 		error "Unable to write package to $pkg_dest"
 		plain "       Maybe the disk is full or you do not have write access"
-- 
2.9.3


More information about the pacman-dev mailing list