aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-30 12:29:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-30 12:29:52 +0000
commit8c72bca81bb7c74c285d2a99c36f7b33e04e1d24 (patch)
treeb3be37640db199e0bca7d8029400ba01a531ce51
parent1577a283c7a756da24c619c7d2977aa0334255dc (diff)
downloadrpmtools-8c72bca81bb7c74c285d2a99c36f7b33e04e1d24.tar
rpmtools-8c72bca81bb7c74c285d2a99c36f7b33e04e1d24.tar.gz
rpmtools-8c72bca81bb7c74c285d2a99c36f7b33e04e1d24.tar.bz2
rpmtools-8c72bca81bb7c74c285d2a99c36f7b33e04e1d24.tar.xz
rpmtools-8c72bca81bb7c74c285d2a99c36f7b33e04e1d24.zip
Factorize
-rwxr-xr-xgendistrib7
1 files changed, 3 insertions, 4 deletions
diff --git a/gendistrib b/gendistrib
index 9204e29..f113771 100755
--- a/gendistrib
+++ b/gendistrib
@@ -33,6 +33,7 @@ my $headers_dir = $tempdir . "/.build_hdlist";
sub usage () {
pod2usage({ -verbose => 1 });
+ exit 0;
}
my %urpmfiles;
@@ -44,7 +45,7 @@ GetOptions(
'destdir=s' => \my $destdir,
'hdlists=s' => \$urpmfiles{hdlists},
'headersdir=s' => \$headers_dir,
- 'help|h' => sub { usage(); exit 0; },
+ 'help|h' => \&usage,
'mediacfg=s' => \$urpmfiles{mediacfg},
'nobadrpm' => \my $dontdie,
'nochkdep' => \my $nochkdep,
@@ -58,9 +59,7 @@ GetOptions(
'v|version' => sub { warn "$0 version $VERSION\n"; exit 0 },
);
-my @root = grep { $_ } @ARGV;
-
-@root > 0 or do { usage(); exit 1 };
+(my @root = grep { $_ } @ARGV) > 0 or usage();
my $distrib = Distribconf::Build->new($root[0]);