From 6fb97e253bbb3c3e7b8bce085b33fe952a74462a Mon Sep 17 00:00:00 2001 From: mid-kid Date: Mon, 10 Apr 2017 00:09:04 +0200 Subject: [PATCH] Update package if checksum changed --- update-repo.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/update-repo.sh b/update-repo.sh index a4d0ff8..73c3e81 100755 --- a/update-repo.sh +++ b/update-repo.sh @@ -46,12 +46,24 @@ find . -regex '.*\.t[bglx]z$' | while read -r package; do pkgsize="$cachedir/$pkgdir/$pkgbase.size" pkgusize="$cachedir/$pkgdir/$pkgbase.usize" - [ -f "$pkgtxt" -a \ - -f "$pkgmeta" -a \ - -f "$pkgmanifest" -a \ - -f "$pkgsize" -a \ - -f "$pkgusize" ] && continue - [ "$gpgkey" -a -f "$package.asc" ] && continue + pkgsum="$cachedir/$pkgdir/$pkgbase.checksum" + + skip=false + + if [ -f "$pkgtxt" -a \ + -f "$pkgmeta" -a \ + -f "$pkgmanifest" -a \ + -f "$pkgsize" -a \ + -f "$pkgusize" -a \ + -f "$pkgsum" ]; then + if [ "$gpgkey" ]; then + if [ -f "$package.asc" ]; then + md5sum --status -c "$pkgsum" && continue + fi + else + md5sum --status -c "$pkgsum" && continue + fi + fi echo "Adding $package..." mkdir -p "$cachedir/$pkgdir" @@ -97,6 +109,9 @@ EOF # Remove decompressed package rm -f "$tmppkg" + + # Save checksum + md5sum "$package" > "$pkgsum" done # Generate shitty ChangeLog.txt