about summary refs log tree commit diff
path: root/xgensum
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-05-22 17:05:54 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-05-22 17:05:54 +0200
commit6805688253707669e8e71ae02c1d4e4b56c22122 (patch)
treee21f2539f246277086e23dc5de99254f16e4e8f2 /xgensum
parent0ff39b70f5d64b6f9cacf5768a4a841de01bed1f (diff)
downloadxtools-6805688253707669e8e71ae02c1d4e4b56c22122.tar.gz
xtools-6805688253707669e8e71ae02c1d4e4b56c22122.tar.xz
xtools-6805688253707669e8e71ae02c1d4e4b56c22122.zip
xgensum: more robust variable names
Diffstat (limited to 'xgensum')
-rwxr-xr-xxgensum10
1 files changed, 5 insertions, 5 deletions
diff --git a/xgensum b/xgensum
index 503df85..1546405 100755
--- a/xgensum
+++ b/xgensum
@@ -2,17 +2,17 @@
 # xgensum [-f] [-i] TEMPLATE - update SHA256 sums in templates
 
 case "$1" in
-	-f) f=$1; shift
+	-f) FLAG_f=$1; shift
 esac
 
 case "$1" in
-	-i*) i=$1; shift
+	-i*) FLAG_i=$1; shift
 esac
 
 if [ -f "$1" ]; then
 	. "$1"
 elif [ -f "$1/template" ]; then
-	exec "$0" $f $i "$1/template"
+	. "$1/template"
 else
 	echo 'Usage: xgensum [-f] [-i] TEMPLATE' 1>&2
 	exit 1
@@ -22,7 +22,7 @@ XBPS_DISTDIR=$(xdistdir)
 XBPS_SRCDISTDIR=$($XBPS_DISTDIR/xbps-src show-var XBPS_SRCDISTDIR | tail -1)
 srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
 
-if [ "$f" = -f ]; then
+if [ "$FLAG_f" = -f ]; then
 	for f in $distfiles; do
 		curfile=$(basename "${f#*>}")
 		distfile="$srcdir/$curfile"
@@ -41,7 +41,7 @@ for f in $distfiles; do
 	sums+="${sum%  *}\n "
 done
 
-sed $i -e "/^checksum=/,/^[^ \t]/{
+sed $FLAG_i -e "/^checksum=/,/^[^ \t]/{
 		/^[ \t]/d
 		s/^checksum=.*/checksum=\"${sums%\n }\"/
 		/^checksum=\"[^ ]*\"/s/\"//g