From dd8e77e7cc05c490d28b471b7e30e63a4f9690b9 Mon Sep 17 00:00:00 2001 From: bill-auger Date: Wed, 18 Apr 2018 03:05:08 -0400 Subject: squashme - updated package list --- parabolaiso/mkparabolaiso | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'parabolaiso') diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index f13b0ba..14ba4bb 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -192,7 +192,7 @@ _usage () } # Shows configuration according to command mode. -# $1: init | install | run | prepare | checksum | iso +# $1: init | install | cache | run | prepare | checksum | iso _show_config () { local _mode="$1" echo @@ -211,6 +211,10 @@ _show_config () { _msg_info " Offline install: ${enable_offline_install}" _msg_info " Packages: ${pkg_list}" ;; + cache) + _msg_info " Pacman config file: ${pacman_conf}" + _msg_info " Packages: ${pkg_list}" + ;; run) _msg_info " Run command: ${run_cmd}" _msg_info " Offline install: ${enable_offline_install}" @@ -251,9 +255,7 @@ _pacman () _msg_info "Packages installed successfully!" } -# 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. +# Cache uninstalled packages in offline /isorepo and prune obsolete packages. _pacman_cache () { _msg_info "Caching packages to '${work_dir}/root-image/'..." @@ -573,15 +575,30 @@ command_install () { if [[ -f "${work_dir}/install.${_pkg_list_hash}" ]]; then _msg_info "These packages are already installed, skipping." else - if [[ "${cache_only:-}" == 'true' ]]; then - _pacman_cache "${pkg_list}" - else - _pacman "${pkg_list}" - fi + _pacman "${pkg_list}" : > "${work_dir}/install.${_pkg_list_hash}" fi } +# Cache uninstalled packages in offline /isorepo and prune obsolete packages. +# Optimally, this function should be called only once after all packages are installed +command_cache () { + if [[ ! -f "${pacman_conf}" ]]; then + _msg_error "Pacman config file '${pacman_conf}' does not exist" 1 + fi + + #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}" +} + command_init() { _show_config init _chroot_init -- cgit v1.2.2