xbps-src: add -u flag, if used with fetch update $checksum in tmpl file.

--HG--
extra : convert_revision : a11fe9147498fb4a60ecb2633493d2d4789c288d
This commit is contained in:
Juan RP
2009-02-09 01:01:14 +01:00
parent 807d8feb14
commit 4a4f70b005
2 changed files with 21 additions and 3 deletions

View File

@@ -42,12 +42,22 @@ verify_sha256_cksum()
msg_normal "SHA256 checksum OK for $file."
}
fetch_update_cksum()
{
local tmpl="$XBPS_TEMPLATESDIR/$pkgname/template"
local upcmd=$(basename $XBPS_SRCDISTDIR/$1)
sed -i -e "s|checksum.*|checksum=$(xbps-digest ${upcmd})|" $tmpl
return $?
}
#
# Downloads the distfiles and verifies checksum for all them.
#
fetch_distfiles()
{
local pkg="$1"
local upcksum="$2"
local dfiles=
local localurl=
local dfcount=0
@@ -106,6 +116,12 @@ fetch_distfiles()
fi
else
unset localurl
if [ -n "$upcksum" ]; then
fetch_update_cksum $f
break
fi
#
# XXX duplicate code.
#