From 4564210bb8019c6120c5532ded58dc5f3acb999d Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Sun, 9 Jan 2005 17:54:43 +0000 Subject: cleanup main function and removed useless options --- rpmbuildupdate | 47 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 35 deletions(-) (limited to 'rpmbuildupdate') 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 : parse output of rpmmon from file\n"; 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"; @@ -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; - } + } } } -- cgit v1.2.1