diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2018-04-18 03:05:08 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2019-05-07 08:41:45 -0400 |
commit | dd8e77e7cc05c490d28b471b7e30e63a4f9690b9 (patch) | |
tree | df1eef6288e1cadaccd2b19d22e79a71e8a008d5 /parabolaiso | |
parent | 685e743833787fd248441eb06990ef4d1809fb9a (diff) |
squashme - updated package list
Diffstat (limited to 'parabolaiso')
-rwxr-xr-x | parabolaiso/mkparabolaiso | 35 |
1 files changed, 26 insertions, 9 deletions
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 |