aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrpmbuildupdate18
1 files changed, 12 insertions, 6 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate
index b81bc81..ca92155 100755
--- a/rpmbuildupdate
+++ b/rpmbuildupdate
@@ -131,7 +131,7 @@ sub fill_global_variable {
sub build_from_spec {
my ($spec_path, $newversion) = @_;
- my $rpm_tag = (split(/\n/,`rpm -q --queryformat '%{NAME} %{VERSION} %{RELEASE}\n' --specfile $spec_path`))[0];
+ my $rpm_tag = (split(/\n/,`rpm -q $config{rpmoption} --queryformat '%{NAME} %{VERSION} %{RELEASE}\n' --specfile $spec_path`))[0];
my ($pkg, $version, $release) = split(/ /, $rpm_tag);
fill_global_variable($pkg);
chdir("$top/SOURCES") or die "Unable to chdir to $top/SOURCES";
@@ -152,7 +152,6 @@ sub build_from_repository {
{
if (m|^($pkge)-([^-]+)-([^-]+)\.[^\.]+\.rpm|)
{ $config{src} = $pkgrpm = "$srpm_dir/$_"; $found = 1; last }
- #{ $config{src} = $pkgrpm = "$srpm_dir/$_"; $version = $2; $release = $3; $found = 1; last }
}
closedir(MP);
last if $found;
@@ -381,10 +380,10 @@ sub build {
return;
}
- if (system("$rpm -ba $spec_path $log"))
+ if (system("$rpm -ba $config{rpmoption} $spec_path $log"))
{
print "Binary build fails: building source only\n";
- system("$rpm -bs --nodeps $spec_path $log");
+ system("$rpm -bs $config{rpmoption} --nodeps $spec_path $log");
}
}
@@ -424,6 +423,12 @@ sub parse_argv {
{ ARGS => "=s",
ARGCOUNT => AppConfig::ARGCOUNT_ONE }
);
+
+ $conf->define("rpmoption",
+ { ARGS => "=s",
+ DEFAULT => "",
+ ARGCOUNT => AppConfig::ARGCOUNT_ONE }
+ );
$conf->define("fedora",
{ ARGS => "=s",
@@ -492,6 +497,7 @@ sub parse_argv {
$config{top} = $conf->get("top");
$config{nobuild} = $conf->get("nobuild");
$config{message} = $conf->get("changelog");
+ $config{rpmoption} = $conf->get("rpmoption");
$config{log} = $conf->get("log");
}
@@ -507,13 +513,14 @@ sub usage {
print " --srpms <path_to_srpms>: specify SRPMS path, separate folder with a comma\n";
print " --src <src.rpm file> <new version>: build new version from this source RPM\n";
print " --spec <spec file> <new version>: build new version from this spec file\n";
+ print " --rpmoption <rpm option>: use this option when rebuilding ( --with , mainly )\n";
print " --release <mdk_release>: release version of package (default: 1mdk)\n";
print " --changelog <changelog message>: use a alternate message. \%\%VERSION is replace by version\n";
print " --deps: install builds dependencies\n";
print " --log: log builds\n";
print " --nosource: do not install source from (urpmi x.src.rpm)\n";
print " --noupdate: do not touch to the spec file\n";
- print " --top <dir>: specify rpm top dir (default: `rpm --eval %_topdir`)\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";
exit 0;
}
@@ -543,7 +550,6 @@ sub check_dir {
sub main {
parse_argv;
wget_check;
- # FIXME clean this
if ($config{rpmmon}) {
print($config{srpms});
parse_rpmmon($config{rpmmon})