summaryrefslogtreecommitdiff
path: root/parabolaiso/mkparabolaiso
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>2020-03-27 19:32:36 -0400
commitc3a55684115322f4f99359c3dcf8c79ba2ee872a (patch)
treea1ca73617403193372c18f9e1dd6809fa498ba65 /parabolaiso/mkparabolaiso
parenta4fdb8c719043c282138e5f3d05207e62433d826 (diff)
bugfix cache stash
Diffstat (limited to 'parabolaiso/mkparabolaiso')
-rwxr-xr-xparabolaiso/mkparabolaiso43
1 files changed, 19 insertions, 24 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso
index 1843594..deec844 100755
--- a/parabolaiso/mkparabolaiso
+++ b/parabolaiso/mkparabolaiso
@@ -255,7 +255,7 @@ _pacman ()
_msg_info "Packages installed successfully!"
}
-# Cache uninstalled packages in offline /isorepo and prune obsolete packages.
+# Cache uninstalled packages in offline /isorepo and prune unused packages.
_pacman_cache ()
{
_msg_info "Caching packages to '${work_dir}/root-image/'..."
@@ -264,27 +264,27 @@ _pacman_cache ()
local _package_files=$(pacman -S --root "${work_dir}/root-image" --config "${pacman_conf}" --print $* | sed "s|.*\/\(.*\)|\1|")
- # stash any existing interesting uninstalled packages
- pushd "${work_dir}/root-image/isorepo/" > /dev/null
- mkdir -p ../isorepo-uninstalled &> /dev/null
- mv ${_package_files} ../isorepo-uninstalled/ &> /dev/null || true
- popd > /dev/null
+ if [[ "${_package_files}" ]]; then
+ # stash any existing interesting uninstalled packages
+ pushd "${work_dir}/root-image/isorepo/" > /dev/null
+ mkdir -p ../isorepo-uninstalled &> /dev/null
+ mv ${_package_files} ../isorepo-uninstalled/ &> /dev/null || true
+ popd > /dev/null
- # remove any remaining obsolete packages
- if [[ "${quiet}" = "y" ]]; then
- pacman -Sc --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm &> /dev/null
- else
- pacman -Sc --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm
- fi
+ # remove any remaining obsolete or rogue packages
+ if [[ "${quiet}" = "y" ]]; then
+ pacman -Sc --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm &> /dev/null
+ else
+ pacman -Sc --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm
+ fi
- # restore interesting uninstalled packages
- pushd "${work_dir}/root-image/isorepo/" > /dev/null
- mv ../isorepo-uninstalled/* . &> /dev/null || true
- rmdir ../isorepo-uninstalled &> /dev/null
- popd > /dev/null
+ # restore interesting uninstalled packages
+ pushd "${work_dir}/root-image/isorepo/" > /dev/null
+ mv ../isorepo-uninstalled/* . &> /dev/null || true
+ rmdir ../isorepo-uninstalled &> /dev/null
+ popd > /dev/null
- # download any missing packages
- if [[ "${_package_files}" ]]; then
+ # download any missing packages
if [[ "${quiet}" = "y" ]]; then
pacman -Sw --root "${work_dir}/root-image" --config "${pacman_conf}" --noconfirm $* &> /dev/null
else
@@ -596,11 +596,6 @@ command_cache () {
#trim spaces
pkg_list="$(echo ${pkg_list})"
- if [[ -z ${pkg_list} ]]; then
- _msg_error "Packages must be specified" 0
- _usage 1
- fi
-
_show_config cache
_pacman_cache "${pkg_list}"
}