aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Scherer <misc@mandriva.com>2004-10-25 04:07:16 +0000
committerMichael Scherer <misc@mandriva.com>2004-10-25 04:07:16 +0000
commita5edb94d82bc280027b202b2cbc23f05911f3880 (patch)
tree0d44a16503c0a9519b24816c0c7e4b8e63f2ad9d
parentc9b960ea2db17725b8f9ac0270cee2dedf67aec1 (diff)
downloadbootsplash-a5edb94d82bc280027b202b2cbc23f05911f3880.tar
bootsplash-a5edb94d82bc280027b202b2cbc23f05911f3880.tar.gz
bootsplash-a5edb94d82bc280027b202b2cbc23f05911f3880.tar.bz2
bootsplash-a5edb94d82bc280027b202b2cbc23f05911f3880.tar.xz
bootsplash-a5edb94d82bc280027b202b2cbc23f05911f3880.zip
- add --rpmoption, to provides options when rebuilding
- fix some escaping issue - remove old comment
-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})