aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2005-01-09 17:54:43 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2005-01-09 17:54:43 +0000
commit4564210bb8019c6120c5532ded58dc5f3acb999d (patch)
tree1462b5324c0808c111bed4f8ba22633fed05fc3c
parentf257e59755825644f44ef7b8d8dda07c64878ddd (diff)
downloadbootsplash-4564210bb8019c6120c5532ded58dc5f3acb999d.tar
bootsplash-4564210bb8019c6120c5532ded58dc5f3acb999d.tar.gz
bootsplash-4564210bb8019c6120c5532ded58dc5f3acb999d.tar.bz2
bootsplash-4564210bb8019c6120c5532ded58dc5f3acb999d.tar.xz
bootsplash-4564210bb8019c6120c5532ded58dc5f3acb999d.zip
cleanup main function and removed useless options
-rwxr-xr-xrpmbuildupdate47
1 files changed, 12 insertions, 35 deletions
diff --git a/rpmbuildupdate b/rpmbuildupdate
index cbd2f14..12fd95b 100755
--- a/rpmbuildupdate
+++ b/rpmbuildupdate
@@ -149,7 +149,7 @@ sub build_from_repository {
my @rpms = readdir(MP);
foreach (@rpms) {
if (m|^($pkge)-([^-]+)-([^-]+)\.[^\.]+\.rpm|) {
- $config{src} = $pkgrpm = "$srpm_dir/$_";
+ $pkgrpm = "$srpm_dir/$_";
$found = 1;
last;
}
@@ -430,17 +430,6 @@ sub parse_argv {
ARGCOUNT => AppConfig::ARGCOUNT_ONE
});
- $conf->define("src", {
- ARGS => "=s",
- ALIAS => "s",
- ARGCOUNT => AppConfig::ARGCOUNT_ONE
- });
-
- $conf->define("spec", {
- ARGS => "=s",
- ARGCOUNT => AppConfig::ARGCOUNT_ONE
- });
-
$conf->define("rpmoption", {
ARGS => "=s",
DEFAULT => "",
@@ -511,8 +500,6 @@ sub parse_argv {
$config{rpmmon} = $conf->get("rpmmon");
$config{deps} = $conf->get("deps");
$config{srpms} = $conf->get("srpms");
- $config{spec} = $conf->get("spec");
- $config{src} = $conf->get("src");
$config{release} = $conf->get("release");
$config{noupdate} = $conf->get("noupdate");
$config{nosource} = $conf->get("nosource");
@@ -535,8 +522,6 @@ sub usage {
print " --rpmmon <file>: parse output of rpmmon from file\n";
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";
@@ -569,7 +554,6 @@ sub check_dir {
}
}
-
sub main {
parse_argv;
wget_check;
@@ -577,27 +561,20 @@ sub main {
print($config{srpms});
parse_rpmmon($config{rpmmon})
} else {
- my ($new_version,$name);
- if ($config{src} or $config{spec}) {
- $new_version = $ARGV[0] || undef;
- } elsif ($ARGV[0]) {
- $name= $ARGV[0]; $new_version = $ARGV[1];
+ my ($name, $version);
+ if ($ARGV[0]) {
+ $name = $ARGV[0];
+ $version = $ARGV[1];
if (-f $name) {
- $name =~ /.spec$/ and $config{spec} = $name;
- # FIXME better auto detection with nosrc.rpm ?
- $name =~ /.src.rpm$/ and $config{src} = $name;
- }
- }
- if ($config{src}) {
- build_from_src($config{src}, $new_version)
- } elsif ($config{spec}) {
- build_from_spec($config{spec},$new_version)
- } elsif ($name) {
- check_dir($config{srpms});
- build_from_repository($name,$new_version)
+ build_from_spec($name, $version) if $name =~ /.spec$/;
+ build_from_src($name, $version) if $name =~ /.(?:no)?src.rpm$/;
+ } else {
+ check_dir($config{srpms});
+ build_from_repository($name, $version)
+ }
} else {
usage;
- }
+ }
}
}