aboutsummaryrefslogtreecommitdiffstats
path: root/rpmbuildupdate
diff options
context:
space:
mode:
authorMichael Scherer <misc@mandriva.com>2005-11-10 10:57:43 +0000
committerMichael Scherer <misc@mandriva.com>2005-11-10 10:57:43 +0000
commit5ee3dc56831a49d42fff364b52f6cd6defae7d25 (patch)
tree5cbcc32acb2bd8ad5f1eeb4593a447e929f26c8d /rpmbuildupdate
parentcd2d1f2926d03cebacb4341ce73643c3126aaf3d (diff)
downloadbootsplash-5ee3dc56831a49d42fff364b52f6cd6defae7d25.tar
bootsplash-5ee3dc56831a49d42fff364b52f6cd6defae7d25.tar.gz
bootsplash-5ee3dc56831a49d42fff364b52f6cd6defae7d25.tar.bz2
bootsplash-5ee3dc56831a49d42fff364b52f6cd6defae7d25.tar.xz
bootsplash-5ee3dc56831a49d42fff364b52f6cd6defae7d25.zip
- add installbuildrequires option, that will run a command that install buildrequires before updating the rpm
Diffstat (limited to 'rpmbuildupdate')
-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;
}