From 67d57a4be8f871fd0a3ca002beb1f7721a673d05 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 12 Oct 2020 23:20:29 +0000 Subject: once/update.sh: added /tarballs/archive support, avoid repeated updates. --- once/update.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/once/update.sh b/once/update.sh index d38ba83..748f65b 100755 --- a/once/update.sh +++ b/once/update.sh @@ -11,10 +11,29 @@ else fi for tarball in /updates/*.tar.gz; do + tarball="${tarball##*/}" + echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - echo extracting files from $tarball + echo extracting files from /updates/$tarball + echo .................................................. + tar -xpvf /updates/$tarball -C "$SYSROOT" || exit 2 + + echo archiving old $tarball echo .................................................. - tar -xpvf $tarball -C "$SYSROOT" || exit 2 + + if [ -f /tarballs/$tarball ]; then + pkgsig=$(sha256sum /tarballs/$tarball) + pkgsig=${pkgsig%% *} + pkgdir=/tarballs/archive/${tarball%%.tar.gz}/$pkgsig/ + mkdir -p $pkgdir + mv /tarballs/$tarball $pkgdir + fi + + echo caching the current $tarball + echo .................................................. + mv /updates/$tarball /tarballs/ + mv /updates/$tarball.sha256 /tarballs/ + echo ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ echo done -- cgit v1.2.3