lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 5a787a9 04/10: Merge centos package caches


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5a787a9 04/10: Merge centos package caches
Date: Fri, 26 Jun 2020 08:05:19 -0400 (EDT)

branch: master
commit 5a787a937467223befb3bd8e25af16f92d3ae91c
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Merge centos package caches
    
    By default, 'rinse' caches packages in an undocumented /var/cache/rinse
    directory, which can be overridden with '--cache-dir'.
---
 lmi_setup_00c.sh | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lmi_setup_00c.sh b/lmi_setup_00c.sh
index 80a0c8b..3f8abe4 100755
--- a/lmi_setup_00c.sh
+++ b/lmi_setup_00c.sh
@@ -45,14 +45,27 @@ EOF
 
 ./lmi_setup_10c.sh
 
+# Use the same cache directory for all chroot package downloads.
+#
+# Packages ('.deb' as well as '.rpm') are uniquely named, so no
+# collision can occur.
+#
+# Actually, 'rinse' creates a subdirectory like 'centos-7.amd64/', and
+# updating the centos chroot using 'yum' creates subdirectories like
+# 'x86_64/7/...', so the files remain segregated. Some duplication of
+# '.rpm' files may occur, but that's harmless.
+
+CACHEDIR=/var/cache/centos_lmi
+mkdir -p "${CACHEDIR}"
+
 rinse --arch amd64 --distribution centos-7 \
+  --cache-dir "${CACHEDIR}" \
   --directory /srv/chroot/centos7lmi \
 
-mkdir -p /var/cache/centos_lmi
 # There are probably a few directories here, with no regular files.
 du   -sb /srv/chroot/centos7lmi/var/cache/yum || echo "Oops: rinse didn't 
create cache"
 mkdir -p /srv/chroot/centos7lmi/var/cache/yum
-mount --bind /var/cache/centos_lmi /srv/chroot/centos7lmi/var/cache/yum
+mount --bind "${CACHEDIR}" /srv/chroot/centos7lmi/var/cache/yum
 
 echo Installed centos chroot.
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]