aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'builders/milou/server-v3-23/run-update')
-rwxr-xr-xbuilders/milou/server-v3-23/run-update39
1 files changed, 36 insertions, 3 deletions
diff --git a/builders/milou/server-v3-23/run-update b/builders/milou/server-v3-23/run-update
index 417f835..ea34914 100755
--- a/builders/milou/server-v3-23/run-update
+++ b/builders/milou/server-v3-23/run-update
@@ -3,8 +3,41 @@
# if one thing fails, abort entirely
set -e
-emerge -uDNkq --changed-deps --backtrack=100 --keep-going world
+to_install=(world)
-emerge --depclean --quiet-unmerge-warn
+if [[ $1 = lucky ]]; then
+ eix-update
+ eix --stable --only-names | grep -E -v '^(acct|virtual|sec)-' | sort -u > /tmp/stable
+ eix --installed --only-names | sort -u > /tmp/installed
+ comm -23 /tmp/stable /tmp/installed > /tmp/uninstalled-stable
+ sed -i 's/--binpkg-respect-use//' /etc/portage/make.conf
-eclean-pkg
+ to_install=(--autounmask-write --autounmask-continue $(shuf -n3 /tmp/uninstalled-stable))
+elif [[ $1 ]]; then
+ pushd /etc/portage/variants/$1
+ while read -r -d '' line; do
+ dest=../../${line%.footer}
+ if [[ ${line} = world* ]]; then
+ dest=/var/lib/portage/world
+ fi
+
+ if [[ ${line} = world.remove ]]; then
+ emerge -C $(<"${line}")
+ elif [[ ${line} = *.footer ]]; then
+ cat "${line}" >> "${dest}"
+ else
+ mkdir -p "${dest%/*}"
+ cp "${line}" "${dest}"
+ fi
+ done < <(find . -type f -printf '%P\0')
+ if [[ -f buildpkgonly ]]; then
+ ./buildpkgonly
+ fi
+ popd
+fi
+
+emerge -uDNkq --changed-deps --backtrack=100 --keep-going "${to_install[@]}"
+
+if [[ ! $1 ]]; then
+ emerge --depclean --quiet-unmerge-warn
+fi