Skip to content

Commit

Permalink
Merge pull request #1 from DakEnviy/feature/default-getbinpkg
Browse files Browse the repository at this point in the history
feat: add getbinpkg support
  • Loading branch information
DakEnviy authored Mar 9, 2024
2 parents aa6204c + 0426089 commit 0d3e5e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 8 additions & 1 deletion scripts/enewyear
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# See LICENSE for copyright information

AUTO_SUDO=0
DEFAULT_GETBINPKG=0

if [[ "$EUID" -ne 0 ]]; then
if [[ "$AUTO_SUDO" -eq 1 ]]; then
Expand All @@ -19,4 +20,10 @@ if [[ "$EUID" -ne 0 ]]; then
fi
fi

emerge --ask --verbose --quiet --emptytree --with-bdeps=y --keep-going=y --backtrack=30 @world
flags=("--ask" "--verbose" "--quiet" "--emptytree" "--with-bdeps=y" "--keep-going=y" "--backtrack=30")

if [[ "$DEFAULT_GETBINPKG" -eq 1 ]]; then
flags+=("--getbinpkg")
fi

emerge "${flags[@]}" @world
11 changes: 10 additions & 1 deletion scripts/eupd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# See LICENSE for copyright information

AUTO_SUDO=0
DEFAULT_GETBINPKG=0

COMMON_UPDATE_FLAGS=("--update" "--newuse" "--deep" "--with-bdeps=y" "--keep-going=y" "--autounmask" "--autounmask-write")
DEFAULT_UPDATE_FLAGS=("--ask" "--verbose" "--quiet")
Expand All @@ -17,6 +18,10 @@ DEFAULT_SYNC_FLAGS=("--quiet")
COMMON_DEPCLEAN_FLAGS=("--depclean")
DEFAULT_DEPCLEAN_FLAGS=("--ask" "--quiet")

if [[ "$DEFAULT_GETBINPKG" -eq 1 ]]; then
DEFAULT_UPDATE_FLAGS+=("--getbinpkg")
fi

if [[ "$EUID" -ne 0 ]]; then
if [[ "$AUTO_SUDO" -eq 1 ]]; then
sudo "$0" "$@"
Expand Down Expand Up @@ -44,6 +49,7 @@ OPTIONS:
-v Runs emerge with --verbose flag (see man 1 emerge)
-q Runs emerge with --quiet flag (see man 1 emerge)
-p Runs emerge with --pretend flag (see man 1 emerge)
-g Runs emerge with --getbinpkg flag (see man 1 emerge)
-w Runs emerge without default flags
-d Runs 'emerge --ask --quiet --depclean' after updating (see man 1 emerge)
-c Runs 'portpeek --all --fix-confirm' after updating to clean obsolete entries in /etc/portage/package.* (see man 1 portpeek)
Expand Down Expand Up @@ -82,6 +88,9 @@ process_option() {
p)
update_flags+=("--pretend")
;;
g)
update_flags+=("--getbinpkg")
;;
w)
without_default_flags=1
;;
Expand All @@ -95,7 +104,7 @@ process_option() {
}

OPTIND=1
while getopts "hsavqpwdc" opt; do
while getopts "hsavqpgwdc" opt; do
process_option "$opt"
done
shift "$((OPTIND-1))"
Expand Down

0 comments on commit 0d3e5e1

Please sign in to comment.