aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-15 20:50:03 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-15 20:50:03 +0000
commit793988e186f85b0378efb5db6686315ee5cde1a6 (patch)
tree73c192a58afc28ae6a2ca76159f6039d5d7d86a9
parent841ce48b6d37918ceeac85ba41f8248e833baa56 (diff)
downloadrpmtools-793988e186f85b0378efb5db6686315ee5cde1a6.tar
rpmtools-793988e186f85b0378efb5db6686315ee5cde1a6.tar.gz
rpmtools-793988e186f85b0378efb5db6686315ee5cde1a6.tar.bz2
rpmtools-793988e186f85b0378efb5db6686315ee5cde1a6.tar.xz
rpmtools-793988e186f85b0378efb5db6686315ee5cde1a6.zip
- fail before generating any file when no *.rpm are found
- do not default to directory ".", the directory is now mandatory
-rw-r--r--genhdlist29
1 files changed, 5 insertions, 4 deletions
diff --git a/genhdlist2 b/genhdlist2
index 0d727ef..11648c3 100644
--- a/genhdlist2
+++ b/genhdlist2
@@ -28,8 +28,8 @@ sub main() {
'version' => sub { warn "$0 version $VERSION\n"; exit 0 },
);
- @ARGV <= 1 or usage();
- my $rpms_dir = $ARGV[0] || '.';
+ @ARGV == 1 or usage();
+ my $rpms_dir = $ARGV[0];
do_it($rpms_dir, %options);
}
@@ -44,6 +44,8 @@ sub do_it {
$verbose = $options{verbose};
$no_bad_rpm = $options{no_bad_rpm};
+ my @rpms = grep { /\.rpm$/ } all($rpms_dir) or die "no *.rpm found in $rpms_dir\n";
+
my $media_info_dir = "$rpms_dir/media_info";
-e $media_info_dir || mkdir $media_info_dir or die "Can't mkdir $media_info_dir: $!n";
-d $media_info_dir && -w _ && -x _ or die "$media_info_dir isn't a writable directory, bailing out\n";
@@ -62,7 +64,6 @@ sub do_it {
};
END { unlink $lock_file if $lock }
- my @rpms = grep { /\.rpm$/ } all($rpms_dir);
my %rpms_todo = map { /(.*)\.rpm/ => 1 } @rpms;
my $urpm = new URPM;
@@ -222,7 +223,7 @@ genhdlist2 - generates an hdlist and a synthesis file
=head1 SYNOPSIS
- genhdlist2 [options] [dir]
+ genhdlist2 [options] dir
=head1 OPTIONS