Browse Source

Add ~checkchangelog.sh, to make slackpkg check-updates faster

rocket-config
mid-kid 7 years ago
parent
commit
8c95b6748f
  1. 32
      root/usr/libexec/slackpkg/functions.d/~checkchangelog.sh
  2. 1
      root/usr/libexec/slackpkg/functions.d/~looknew.sh

32
root/usr/libexec/slackpkg/functions.d/~checkchangelog.sh

@ -0,0 +1,32 @@
eval _$(typeset -f checkchangelog)
checkchangelog() {
if ! [ -e ${ROOT}/${WORKDIR}/CHECKSUMS.md5.asc ]; then
touch ${ROOT}/${WORKDIR}/CHECKSUMS.md5.asc
fi
# First we will download CHECKSUMS.md5.asc since it is a very small
# file and if it has not changed, we can know that the ChangeLog
# has not changed either. If it _has_ changed, we'll need to pull
# the ChangeLog to check that as well.
echo -e "\tDownloading..."
getfile ${SOURCE}CHECKSUMS.md5.asc $TMPDIR/CHECKSUMS.md5.asc
if ! grep -q "PGP" $TMPDIR/CHECKSUMS.md5.asc ; then
echo -e "\
\nError downloading from $SOURCE.\n\
Please check your mirror and try again."
cleanup
fi
if diff --brief ${ROOT}/${WORKDIR}/CHECKSUMS.md5.asc $TMPDIR/CHECKSUMS.md5.asc ; then
# Before returning with the result that these signatures (and
# therefore the ChangeLog) are the same, we need to copy the
# ChangeLog into ${TMPDIR} in case the user decides to
# "download all other files":
cp ${ROOT}/${WORKDIR}/ChangeLog.txt $TMPDIR/ChangeLog.txt
return 0
fi
# CHECKSUMS.md5.asc was different, so we'll go on to download and test
# the full ChangeLog.txt.
_checkchangelog "$@"
}

1
root/usr/libexec/slackpkg/functions.d/~looknew.sh

@ -1,5 +1,4 @@
looknew() { looknew() {
# with ONLY_NEW_DOTNEW set, slackpkg will search only for # with ONLY_NEW_DOTNEW set, slackpkg will search only for
# .new files installed in actual slackpkg's execution # .new files installed in actual slackpkg's execution
if [ "$ONLY_NEW_DOTNEW" = "on" ]; then if [ "$ONLY_NEW_DOTNEW" = "on" ]; then

Loading…
Cancel
Save