summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEttore Di Giacinto <mudler@gentoo.org>2016-10-28 13:49:51 +0200
committerEttore Di Giacinto <mudler@gentoo.org>2016-10-28 13:50:58 +0200
commit6340de326a0373d71f3763e6c9ad15bdb83373d4 (patch)
treed192bed3a1ecf41244fd22077ef712718a4ce99a /scripts
parentmate-extra/mate-power-manager: sync revnum with ::gentoo (diff)
downloadgentoo-mate-6340de326a0373d71f3763e6c9ad15bdb83373d4.tar.gz
gentoo-mate-6340de326a0373d71f3763e6c9ad15bdb83373d4.tar.bz2
gentoo-mate-6340de326a0373d71f3763e6c9ad15bdb83373d4.zip
scripts: adding support for mass version remove in keyword-helper
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bin/keyword-helper18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/bin/keyword-helper b/scripts/bin/keyword-helper
index d5768a1..5042739 100755
--- a/scripts/bin/keyword-helper
+++ b/scripts/bin/keyword-helper
@@ -11,9 +11,11 @@ my $TARGET_KEYWORD = $ENV{TARGET_KEYWORD} // "amd64 x86"
my $BUGZ =
$ENV{BUGZ}; # Bug reference. Mandatory if no COMMIT_MSG is specified
my $COMMIT_MSG = $ENV{COMMIT_MSG}; # Git commit message
+my $REMOVE = $ENV{REMOVE} // 0; # Remove ebuilds if 1
my @KEYWORD_PACKAGES = @ARGV; # Packages that we want to manipulate
my $CWD = getcwd;
+my @FAILED;
sub strip_pvr { s/-[0-9]{1,}.*$//; }
@@ -39,7 +41,8 @@ if ( !@ARGV or $ARGV[0] eq "-h" or $ARGV[0] eq "--help" ) {
"ENV variables options:", "",
" COMMIT_MSG \t\t default commit message",
" BUGZ \t\t Gentoo Bugzilla id, e.g. 596998",
- " TARGET_KEYWORD \t the keyword(s) to set separated by a space. e.g. TARGET_KEYWORD='amd64 x86'";
+ " TARGET_KEYWORD \t the keyword(s) to set separated by a space. e.g. TARGET_KEYWORD='amd64 x86'",
+ " REMOVE \t remove ebuilds instead of keywording if setted to 1";
exit 1;
}
@@ -100,13 +103,17 @@ for (@KEYWORD_PACKAGES) {
}
$LOCAL_COMMIT_MSG = $prefix_msg . "wrt \#${BUGZ}";
}
-
- system("ekeyword $arch $local_package");
+ if ($REMOVE == 1) {
+ system("rm -rfv $local_package");
+ } else {
+ system("ekeyword $arch $local_package");
+ }
system("git add $local_package");
system("repoman commit -m '$_: $LOCAL_COMMIT_MSG'");
if ( $? >> 8 != 0 ) {
fatal
"Meh. we got errors. before going on, i want you to fix those by hand.";
+ push(@FAILED,$local_package);
}
else {
ok "Done for $_ [$local_package]";
@@ -120,3 +127,8 @@ for (@KEYWORD_PACKAGES) {
}
chdir($CWD);
}
+
+if(@FAILED > 0){
+ fatal "Operation failed for the following ebuilds:";
+ fatal "** ".$_ for @FAILED;
+}