Compare commits

..

5 Commits

Author SHA1 Message Date
Ben Roberts 9446715e1a Attempt to only add/remove enman repos that need action
Since enman was changed to provide exit status 1 [1] if the requested
operation failed, builder attempting to re-add an already existing repo
caused the entire build to fail. Rather than run the command and hope
for the best, this commit changes builder to obtain a list of already
installed repositories, and only add/remove the requested repos that
aren't already in the correct state.

[1] Sabayon/enman@7f3a6c88
2016-10-24 09:16:35 +01:00
Ettore Di Giacinto 890206ba80 sabayondevkit-functions.sh: add -u as default emerge option to build_category_installed and build_obsolete 2016-10-11 14:48:01 +02:00
mudler 79567a647b sabayon-maint-helper: acquire lock before execution 2016-10-10 16:44:47 +02:00
Ettore Di Giacinto 0769169cc6 sabayondevkit-functions.sh: fix typo 2016-10-10 14:14:07 +02:00
mudler 03b7b4fd18 sabayon-maint-helper: fixes 2016-10-10 12:06:56 +02:00
3 changed files with 24 additions and 9 deletions
+12 -2
View File
@@ -412,14 +412,24 @@ if ($use_equo) {
say "Devkit version:";
system("equo s -vq app-misc/sabayon-devkit");
my @installed_enman_repos = split(/\n/, chomp(system("enman list --installed -q")));
if ( $enman_repositories and $enman_repositories ne "" ) {
my @enman_toadd = split( / /, $enman_repositories );
safe_call("enman add $_") for @enman_toadd;
for my $enman_add (@enman_toadd) {
if ! grep ($enman_add, @installed_enman_repos) {
safe_call("enman add $_");
}
}
}
if ( $remove_enman_repositories and $remove_enman_repositories ne "" ) {
my @enman_toremove = split( / /, $remove_enman_repositories );
system("enman remove $_") for @enman_toremove;
for my $enman_remove (@enman_toremove) {
if grep ($enman_remove, @installed_enman_repos) {
safe_call("enman remove $_");
}
}
}
system("enman add $repository_name")
+9 -4
View File
@@ -14,7 +14,7 @@ Script for builder boxes maintenance.
--obsolete Upgrades ONLY the packages that are listed obsolete in eix-test-obsolete.
--all Tries to upgrade all package without any euristics
--category Tries to upgrade/install all the packages in the specified category
e.g. sabayon-maint-helper "app-office"
e.g. sabayon-maint-helper 'app-office'
Some options could be set also as environment variables:
EMERGE_DEFAULT_ARGS Default emerge options
@@ -41,12 +41,10 @@ parse_args() {
--installed)
echo "Trying to upgrade all the installed packages"
rebuild_all
shift
;;
--obsolete)
echo "Upgrading the packages that are marked as obsolete"
build_obsolete
shift
;;
--all)
echo "Upgrading/Installing everything available to install"
@@ -55,6 +53,7 @@ parse_args() {
--category)
echo "Upgrading/Installing everything inside the '$2' category"
build_category_installed "$2"
shift
;;
--)
help_msg
@@ -82,7 +81,13 @@ main() {
[ -z "$@" ] && help_msg && exit 1
parse_args "$@"
(
echo "Acquiring lock"
flock -x -w 10 200 || ( echo "Failed acquiring lock in 10 seconds" && exit 1 )
parse_args "$@"
) 200>/var/lock/.repomaint
}
+3 -3
View File
@@ -17,7 +17,7 @@ build_sync() {
git stash
git fetch --all
git checkout master
git reset --heard origin/master
git reset --hard origin/master
popd
}
@@ -36,7 +36,7 @@ build_obsolete() {
for i in $(EIX_LIMIT=0 eix-test-obsolete | grep '\[U\]' | awk '{ print $2 }' | xargs echo | uniq);
do
echo "Build $i"
emerge ${EMERGE_DEFAULT_ARGS:---accept-properties=-interactive --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg --noreplace} $i
emerge ${EMERGE_DEFAULT_ARGS:---accept-properties=-interactive -u --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg --noreplace} $i
done
}
@@ -46,7 +46,7 @@ build_category_installed() {
for i in $(EIX_LIMIT=0 eix -I --only-names --pure-packages "$SEARCH/" | xargs echo | uniq);
do
echo "Building $i"
emerge ${EMERGE_DEFAULT_ARGS:---accept-properties=-interactive --newuse --noreplace --changed-use --update --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg} $i
emerge ${EMERGE_DEFAULT_ARGS:---accept-properties=-interactive -u --newuse --noreplace --changed-use --update --verbose --oneshot --nospinner --quiet-build=y --quiet-fail --fail-clean=y --complete-graph --buildpkg} $i
done
}