about summary refs log tree commit diff
path: root/xgensum
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-06-16 13:07:15 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-06-16 13:07:15 +0200
commit713f20c3f530c5daf9d930285fffee990ac868db (patch)
tree35d9e811806f0ec1891a169cc625a0e4d19648e3 /xgensum
parent92015e44b50c5827ceff4f6fe31700390fbb48cd (diff)
downloadxtools-713f20c3f530c5daf9d930285fffee990ac868db.tar.gz
xtools-713f20c3f530c5daf9d930285fffee990ac868db.tar.xz
xtools-713f20c3f530c5daf9d930285fffee990ac868db.zip
xgensum: -f to force redownload of distfiles.
Diffstat (limited to 'xgensum')
-rwxr-xr-xxgensum21
1 files changed, 17 insertions, 4 deletions
diff --git a/xgensum b/xgensum
index c22a43b..38b1136 100755
--- a/xgensum
+++ b/xgensum
@@ -1,5 +1,9 @@
 #!/bin/bash
-# xgensum [-i] TEMPLATE - update SHA256 sums in templates
+# xgensum [-f] [-i] TEMPLATE - update SHA256 sums in templates
+
+case "$1" in
+	-f) f=$1; shift
+esac
 
 case "$1" in
 	-i*) i=$1; shift
@@ -8,17 +12,26 @@ esac
 if [ -f $1 ]; then
 	. "$1"
 elif [ -f $1/template ]; then
-	exec "$0" $i "$1/template"
+	exec "$0" $f $i "$1/template"
 elif [ -f template ]; then
-	exec "$0" $i template
+	exec "$0" $f $i template
 else
-	echo Usage: gensum TEMPLATE
+	echo 'Usage: xgensum [-f] [-i] TEMPLATE'
 fi
 
 XBPS_DISTDIR=$(xdistdir)
 XBPS_SRCDISTDIR=$($XBPS_DISTDIR/xbps-src show-var XBPS_SRCDISTDIR | tail -1)
 srcdir="$XBPS_SRCDISTDIR/$pkgname-$version"
 
+if [ "$f" = -f ]; then
+	for f in $distfiles; do
+		curfile=$(basename "${f#*>}")
+		distfile="$srcdir/$curfile"
+		rm -vf "$distfile"
+	done
+	$XBPS_DISTDIR/xbps-src -I clean $pkgname
+fi
+
 $XBPS_DISTDIR/xbps-src -I fetch $pkgname
 
 sums=""