aboutsummaryrefslogtreecommitdiffstats
path: root/genhdlist2
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-06-22 06:43:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-06-22 06:43:25 +0000
commitd12b0fe7a0bf20c297f5606ec5d713605dcf7d69 (patch)
treef6bd50442aa79032f4158df13b2380f4cf7e1903 /genhdlist2
parent658b7b13db370b0ffe58a0e15eeb21606c57a3a8 (diff)
downloadrpmtools-d12b0fe7a0bf20c297f5606ec5d713605dcf7d69.tar
rpmtools-d12b0fe7a0bf20c297f5606ec5d713605dcf7d69.tar.gz
rpmtools-d12b0fe7a0bf20c297f5606ec5d713605dcf7d69.tar.bz2
rpmtools-d12b0fe7a0bf20c297f5606ec5d713605dcf7d69.tar.xz
rpmtools-d12b0fe7a0bf20c297f5606ec5d713605dcf7d69.zip
add option --allow-empty-media
Diffstat (limited to 'genhdlist2')
-rw-r--r--genhdlist29
1 files changed, 8 insertions, 1 deletions
diff --git a/genhdlist2 b/genhdlist2
index 10ae6e7..4dedd25 100644
--- a/genhdlist2
+++ b/genhdlist2
@@ -21,6 +21,7 @@ sub main() {
'no-bad-rpm' => \$options{no_bad_rpm},
'no-md5sum' => \$options{no_md5sum},
'nolock' => \$options{nolock},
+ 'allow-empty-media' => \$options{allow_empty_media},
'file-deps=s' => \$options{file_deps},
'h|help' => sub { usage(); exit 0 },
'q|quiet' => sub { $options{verbose} = -1 },
@@ -44,7 +45,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 @rpms = grep { /\.rpm$/ } all($rpms_dir);
+ @rpms || $options{allow_empty_media} 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";
@@ -263,6 +265,11 @@ Don't lock the media (can be useful when locks fail, eg NFS). Since the lock
is used to verify no other genhdlist2 process is running on the same media, it
is a dangerous option.
+=item B<--allow-empty-media>
+
+By default if no *.rpm files are found, F<genhdlist2> will exit on error.
+To allow building empty media, use this option.
+
=item B<-v>
Be verbose. Use one more B<-v> to get even more verbose.