diff options
| author | Mhd Sulhan <ms@kilabit.info> | 2016-01-29 19:14:03 +0700 |
|---|---|---|
| committer | Mhd Sulhan <ms@kilabit.info> | 2016-01-29 19:14:03 +0700 |
| commit | bdad0b6e1698b8062f5422f0a855b46605747546 (patch) | |
| tree | 1716a2b51b72e49a12d03ec7068e1e6a13dd7e6b /scripts | |
| parent | 12b169b4bde8259ac9cf87bbc3be6e8e409e88ef (diff) | |
| download | arch-docker-bdad0b6e1698b8062f5422f0a855b46605747546.tar.xz | |
scripts: split variable for normal and forced removed packages.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/_bootstrap_script.sh | 6 | ||||
| -rwxr-xr-x | scripts/rootfs.sh | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/scripts/_bootstrap_script.sh b/scripts/_bootstrap_script.sh index 341ab52..3ca684e 100755 --- a/scripts/_bootstrap_script.sh +++ b/scripts/_bootstrap_script.sh @@ -76,6 +76,12 @@ bootstrap_remove_packages() { echo "==> remove unneeded packages ..." for pkg in ${PKGS_REMOVED[@]}; do echo " removing $pkg" + pacman -Rs --noconfirm $pkg + done + + echo ">>> force remove packages ..." + for pkg in ${PKGS_REMOVED_FORCE[@]}; do + echo " force removing $pkg" pacman -Rdd --noconfirm $pkg done } diff --git a/scripts/rootfs.sh b/scripts/rootfs.sh index 955aef9..ae0fa95 100755 --- a/scripts/rootfs.sh +++ b/scripts/rootfs.sh @@ -122,7 +122,12 @@ rootfs_uninstall() { echo "" echo "==> uninstalling packages ..." if [[ ${#PKGS_REMOVED} > 0 ]]; then - pacman -r "$ROOTFS" -Rdd --noconfirm ${PKGS_REMOVED} + pacman -r "$ROOTFS" -Rs --noconfirm ${PKGS_REMOVED} + fi + + echo ">>> force removing packages ..." + if [[ ${#PKGS_REMOVED_FORCE} > 0 ]]; then + pacman -r "$ROOTFS" -Rs --noconfirm ${PKGS_REMOVED_FORCE} fi } @@ -192,9 +197,11 @@ rootfs_to_docker() { ## rootfs_clean() { echo "" - echo "==> unmounting and cleaning previous rootfs ..." + echo "==> unmounting and cleaning previous rootfs '$ROOTFS'" - sudo umount -R $ROOTFS - rm -f ${ROOTFS}/* - rmdir ${ROOTFS} + if [ -d ${ROOTFS} ]; then + sudo umount -R $ROOTFS &>/dev/null + rm -f ${ROOTFS}/* &>/dev/null + rmdir ${ROOTFS} &>/dev/null + fi } |
