diff --git a/scripts/eupd b/scripts/eupd index b793b9a..14ea9ef 100755 --- a/scripts/eupd +++ b/scripts/eupd @@ -8,8 +8,14 @@ AUTO_SUDO=0 -COMMON_EMERGE_FLAGS=("--update" "--newuse" "--deep" "--with-bdeps=y" "--keep-going=y" "--autounmask" "--autounmask-write") -DEFAULT_EMERGE_FLAGS=("--ask" "--verbose" "--quiet") +COMMON_UPDATE_FLAGS=("--update" "--newuse" "--deep" "--with-bdeps=y" "--keep-going=y" "--autounmask" "--autounmask-write") +DEFAULT_UPDATE_FLAGS=("--ask" "--verbose" "--quiet") + +COMMON_SYNC_FLAGS=("--sync") +DEFAULT_SYNC_FLAGS=("--quiet") + +COMMON_DEPCLEAN_FLAGS=("--depclean") +DEFAULT_DEPCLEAN_FLAGS=("--ask" "--quiet") if [[ "$EUID" -ne 0 ]]; then if [[ "$AUTO_SUDO" -eq 1 ]]; then @@ -22,16 +28,6 @@ if [[ "$EUID" -ne 0 ]]; then fi fi -esync() { - if command -v layman &>/dev/null; then - echo "Syncing layman overlays..." - layman -S -q - fi - - echo "Syncing repositories..." - emerge --sync -q -} - show_help() { cat </dev/null; then + echo "Syncing layman overlays..." + layman -S -q + fi + + echo "Syncing repositories..." + emerge "${sync_flags[@]}" "${COMMON_SYNC_FLAGS[@]}" fi echo "Running emerge..." -emerge "${emerge_flags[@]}" "${COMMON_EMERGE_FLAGS[@]}" "$@" "@world" +emerge "${update_flags[@]}" "${COMMON_UPDATE_FLAGS[@]}" "$@" "@world" if [[ "$depclean" -eq 1 ]]; then echo "Running depclean..." - emerge --ask --quiet --depclean + emerge "${depclean_flags[@]}" "${COMMON_DEPCLEAN_FLAGS[@]}" fi if [[ "$portpeek" -eq 1 ]]; then