summaryrefslogtreecommitdiffhomepage
path: root/once
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-10-12 23:20:29 +0000
committermidipix <writeonce@midipix.org>2020-10-12 23:47:28 +0000
commit67d57a4be8f871fd0a3ca002beb1f7721a673d05 (patch)
tree6452fce2ad4031acb8ab55f578a7381bd8badbef /once
parente9df40cb3f0a21d70525d77d65050d99e594ce78 (diff)
downloadmpackage-67d57a4be8f871fd0a3ca002beb1f7721a673d05.tar.bz2
mpackage-67d57a4be8f871fd0a3ca002beb1f7721a673d05.tar.xz
once/update.sh: added /tarballs/archive support, avoid repeated updates.
Diffstat (limited to 'once')
-rwxr-xr-xonce/update.sh23
1 files 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