From 5ee3dc56831a49d42fff364b52f6cd6defae7d25 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Thu, 10 Nov 2005 10:57:43 +0000 Subject: - add installbuildrequires option, that will run a command that install buildrequires before updating the rpm --- rpmbuildupdate | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'rpmbuildupdate') 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 : execute an arbitrary perl command for each line of the spec file --execafterbuild : execute a shell command after the build, with the source and binary rpm as argument + --installbuildrequires : command executed with the list of BuildRequires to install EOF exit 255; } -- cgit v1.2.1