From a5edb94d82bc280027b202b2cbc23f05911f3880 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 25 Oct 2004 04:07:16 +0000 Subject: - add --rpmoption, to provides options when rebuilding - fix some escaping issue - remove old comment --- rpmbuildupdate | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'rpmbuildupdate') 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 : specify SRPMS path, separate folder with a comma\n"; print " --src : build new version from this source RPM\n"; print " --spec : build new version from this spec file\n"; + print " --rpmoption : use this option when rebuilding ( --with , mainly )\n"; print " --release : release version of package (default: 1mdk)\n"; print " --changelog : 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 : specify rpm top dir (default: `rpm --eval %_topdir`)\n"; + print " --top : 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}) -- cgit v1.2.1