From d12b0fe7a0bf20c297f5606ec5d713605dcf7d69 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 22 Jun 2007 06:43:25 +0000 Subject: add option --allow-empty-media --- genhdlist2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'genhdlist2') 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 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. -- cgit v1.2.1