summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-05-07 07:53:48 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-03-27 19:15:48 -0400
commit62df34da1c1fbdb68ed0ea830eb2e2190b28524b (patch)
tree7875d6b869c1d701f97da76f77ca2b1e69ee9481
parent140249432ea86964b5ffe0748efc6cb80ea72ed5 (diff)
bugfix cached packages
-rwxr-xr-xconfigs/profile/build.sh4
-rwxr-xr-xparabolaiso/mkparabolaiso16
2 files changed, 12 insertions, 8 deletions
diff --git a/configs/profile/build.sh b/configs/profile/build.sh
index 6f9f7eb..c26982a 100755
--- a/configs/profile/build.sh
+++ b/configs/profile/build.sh
@@ -136,8 +136,8 @@ make_packages() {
# create live environment local repo or stash package cache
if [[ "$enable_offline_install" == 'true' ]]; then
if [[ -n ${_cache_packages} ]]; then
- # download cache packages
- setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "${_cache_packages}" -O install
+ # download any cache packages and prune obsolete packages
+ cache_only='true' setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "${_cache_packages}" -O install
fi
# create 'isorepo' for offline install
pushd ${work_dir}/${arch}/root-image/isorepo > /dev/null
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso
index a7eb760..f13b0ba 100755
--- a/parabolaiso/mkparabolaiso
+++ b/parabolaiso/mkparabolaiso
@@ -251,7 +251,9 @@ _pacman ()
_msg_info "Packages installed successfully!"
}
-# Cache uninstalled packages in offline /isorepo
+# Cache uninstalled packages in offline /isorepo and prune un-needed packages packages.
+# Optimally, this function should be called only once after all packages are installed
+# and even if there are no 'cache-only' packages.
_pacman_cache ()
{
_msg_info "Caching packages to '${work_dir}/root-image/'..."
@@ -280,10 +282,12 @@ _pacman_cache ()
popd > /dev/null
# download any missing packages
- if [[ "${quiet}" = "y" ]]; then
- pacman -Sw --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm $* &> /dev/null
- else
- pacman -Sw --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm $*
+ if [[ "${_package_files}" ]]; then
+ if [[ "${quiet}" = "y" ]]; then
+ pacman -Sw --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm $* &> /dev/null
+ else
+ pacman -Sw --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm $*
+ fi
fi
_chroot_umount
@@ -569,7 +573,7 @@ command_install () {
if [[ -f "${work_dir}/install.${_pkg_list_hash}" ]]; then
_msg_info "These packages are already installed, skipping."
else
- if [[ "${enable_offline_install}" == 'true' ]]; then
+ if [[ "${cache_only:-}" == 'true' ]]; then
_pacman_cache "${pkg_list}"
else
_pacman "${pkg_list}"