diff options
Diffstat (limited to 'rpmbuildupdate')
-rwxr-xr-x | rpmbuildupdate | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate index 3eeee86..e0af0fe 100755 --- a/rpmbuildupdate +++ b/rpmbuildupdate @@ -235,6 +235,8 @@ sub build { s/Version:\s+$version/Version: $newversion/g; s/Release\s*:\s*$release/Release: $newrelease/; s/\%define(\s+)release(\s+)(.*)/\%define release $newrelease/; + + eval $config{execute} if $config{execute}; $spec .= $_; push(@url, $2) if /(Source[0-9]*)\s*:\s+((?:ftp|svns?|https?):\S+)/i; @@ -259,6 +261,7 @@ sub build { $spec .= "* " . `LC_TIME=C date '+%a %b %d %Y'|tr -d '\n'` . " $email $newversion-$newrelease\n"; $spec .= "$message\n\n"; } + } close($SPECFILE); @@ -505,6 +508,12 @@ sub parse_argv { DEFAULT => "", ARGCOUNT => AppConfig::ARGCOUNT_ONE } ); + + $conf->define("execute", + { ARGS => "=s", + DEFAULT => "", + ARGCOUNT => AppConfig::ARGCOUNT_ONE } + ); foreach my $f ('/etc/rpmbuildupdate.conf', "$ENV{HOME}/.rpmbuildupdaterc") { @@ -525,6 +534,7 @@ sub parse_argv { $config{message} = $conf->get("changelog"); $config{rpmoption} = $conf->get("rpmoption"); $config{log} = $conf->get("log"); + $config{execute} = $conf->get("execute"); } @@ -548,6 +558,7 @@ sub usage { print " --noupdate: do not touch to the spec file\n"; print " --top <dir>: specify rpm top dir (default: `rpm --eval \%_topdir`)\n"; print " --nobuild|-c: do not build the package. Only download files.\n"; + print " --execute <command>: execute an arbitrary perl command for each line of the spec file\n"; exit 0; } |