diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-06-15 20:50:03 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-06-15 20:50:03 +0000 |
commit | 793988e186f85b0378efb5db6686315ee5cde1a6 (patch) | |
tree | 73c192a58afc28ae6a2ca76159f6039d5d7d86a9 | |
parent | 841ce48b6d37918ceeac85ba41f8248e833baa56 (diff) | |
download | rpmtools-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-- | genhdlist2 | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |