aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrpmbuildupdate19
1 files changed, 17 insertions, 2 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate
index cbbf95d..5b4c7c9 100755
--- a/rpmbuildupdate
+++ b/rpmbuildupdate
@@ -217,7 +217,13 @@ sub build {
} else {
print "===> Rebuilding $pkg\n";
}
-
+
+ if ( $config{installbuildrequires} ) {
+ my @requires = split(/\s+/, $hdlist_spec->srcheader->queryformat("[%{requires} ]"));
+ print "===> Installing BuildRequires : @requires\n";
+
+ system("$config{installbuildrequires} @requires");
+ };
if (! defined($newversion)) {
$newversion = $version;
@@ -547,12 +553,20 @@ sub parse_argv {
DEFAULT => "",
ARGCOUNT => AppConfig::ARGCOUNT_ONE
});
+
+ $conf->define("installbuildrequires", {
+ ARGS => "=s",
+ DEFAULT => "",
+ ARGCOUNT => AppConfig::ARGCOUNT_ONE
+ });
+
foreach my $f ('/etc/rpmbuildupdate.conf', "$ENV{HOME}/.rpmbuildupdaterc") {
-f $f && $conf->file($f);
}
$conf->args;
+ # TODO remove this useless piece of code and use directly $conf->get
$config{rpmmon} = $conf->get("rpmmon");
$config{deps} = $conf->get("deps");
$config{srpms} = $conf->get("srpms");
@@ -567,7 +581,7 @@ sub parse_argv {
$config{log} = $conf->get("log");
$config{execute} = $conf->get("execute");
$config{execafterbuild} = $conf->get("execafterbuild");
-
+ $config{installbuildrequires} = $conf->get("installbuildrequires");
}
sub usage {
@@ -595,6 +609,7 @@ Usage: rpmbuildupdate [options] [pkg] [newversion]
--nobuild|-c: do not build the package. Only download files.
--execute <command>: execute an arbitrary perl command for each line of the spec file
--execafterbuild <command>: execute a shell command after the build, with the source and binary rpm as argument
+ --installbuildrequires <command>: command executed with the list of BuildRequires to install
EOF
exit 255;
}