From 713f20c3f530c5daf9d930285fffee990ac868db Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 16 Jun 2015 13:07:15 +0200 Subject: xgensum: -f to force redownload of distfiles. --- xgensum | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'xgensum') 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="" -- cgit 1.4.1