summaryrefslogtreecommitdiff
path: root/configs/profile
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2018-05-27 03:22:33 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2018-07-02 10:53:53 -0400
commit302c303bc4b9aa303d7ade7a3874a6504f84abc2 (patch)
treeafacc3b69708a7328bcfc21a1e25c6aa5e9b987b /configs/profile
parent7b86459459373f762ea2ac154f40bddb1ebec004 (diff)
bugfix cache stash
Diffstat (limited to 'configs/profile')
-rwxr-xr-xconfigs/profile/build.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/configs/profile/build.sh b/configs/profile/build.sh
index 326af1e..4752c64 100755
--- a/configs/profile/build.sh
+++ b/configs/profile/build.sh
@@ -78,7 +78,17 @@ run_once() {
# Setup custom pacman.conf to cache packages on the target filesystem.
make_pacman_conf() {
- sed -r "s|^#?\\s*CacheDir.+|CacheDir = ${work_dir}/${arch}/root-image/isorepo/|g" ${releng_dir}/pacman.conf > ${pacman_conf}
+ local stash_dir=${work_dir}/isorepo-${arch}
+ local isorepo_dir=${work_dir}/${arch}/root-image/isorepo/
+
+ # restore package cache from previous build
+ if [[ -d ${stash_dir} ]]; then
+ echo "restoring package cache from ${stash_dir}"
+ mkdir -p ${isorepo_dir}
+ mv ${stash_dir}/* ${isorepo_dir} || true
+ fi
+
+ sed --regexp-extended 's|^#?\s*CacheDir.+|CacheDir = '${isorepo_dir}'|g' ${releng_dir}/pacman.conf > ${pacman_conf}
}
# Base installation, plus needed packages (root-image)
@@ -151,17 +161,23 @@ make_packages() {
# create live environment local repo or stash package cache
if [[ "$enable_offline_install" == 'true' ]]; then
- if [[ -n ${_cache_packages} ]]; then
+ if [[ -n "${_cache_packages}" ]]; then
# download any cache packages and prune obsolete packages
+ echo 'downloading "cach-only" packages'
setarch ${arch} mkparabolaiso ${verbose} -w ${work_dir}/${arch} -C ${pacman_conf} -D ${iso_dirname} -p "${_cache_packages}" ${offline_switch} cache
fi
+
# create 'isorepo' for offline install
+ echo "creating 'isorepo' for offline install"
pushd ${work_dir}/${arch}/root-image/isorepo > /dev/null
setarch ${arch} repo-add --new isorepo.db.tar.gz ./*
- popd > /dev/null
+ popd > /dev/null
else
# stash package cache for next build
- mv ${work_dir}/${arch}/root-image/isorepo ${work_dir}/../isorepo-${arch} || true
+ echo "stashing package cache to ${work_dir}/isorepo-${arch}"
+ mkdir -p ${work_dir}/isorepo-${arch}/
+ mv ${work_dir}/${arch}/root-image/isorepo/* ${work_dir}/isorepo-${arch}/
+ rmdir ${work_dir}/${arch}/root-image/isorepo
fi
}