diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2005-09-06 15:56:38 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2005-09-06 15:56:38 +0000 |
commit | e0f1796baf5c0a2cf7758aac26d1abf538557fcf (patch) | |
tree | 920a224e79463895be4a4286f169f1282cab91e8 | |
parent | 8cd4fc646f53866fe70208fe3303fea0ee40379f (diff) | |
download | rpmtools-e0f1796baf5c0a2cf7758aac26d1abf538557fcf.tar rpmtools-e0f1796baf5c0a2cf7758aac26d1abf538557fcf.tar.gz rpmtools-e0f1796baf5c0a2cf7758aac26d1abf538557fcf.tar.bz2 rpmtools-e0f1796baf5c0a2cf7758aac26d1abf538557fcf.tar.xz rpmtools-e0f1796baf5c0a2cf7758aac26d1abf538557fcf.zip |
- show all missing directory before dying when --skipmissingdir is not specified
-rwxr-xr-x | gendistrib | 25 |
1 files changed, 22 insertions, 3 deletions
@@ -104,15 +104,22 @@ while (my ($k, $v) = each(%default_urpmfiles)) { $distrib->check(\*STDERR) unless $nooutput; my @hdlists; +my @media_mising_dirs; foreach ($distrib->listmedia) { $distrib->getvalue($_, 'askmedia') || $distrib->getvalue($_, 'suppl') and next; + + if (! -d ($distrib->getfullpath($_, 'path'))) { if ($skipmissingdir) { - printf STDERR "Skipping missing media %s\n", $distrib->getpath($_, 'path') unless $nooutput; - next; + printf(STDERR + "Skipping missing media %s\n", + $distrib->getpath($_, 'path') + ) unless $nooutput; } else { - die sprintf("Missing dir '%s' for media '%s'", $distrib->getpath($_, 'path'), $distrib->getvalue($_, 'name')); + # delaying error report to report all errors, not the only first + push(@media_mising_dirs, $_); } + next; } push @hdlists, { @@ -128,6 +135,18 @@ foreach ($distrib->listmedia) { }; } +# if there is result here, $skipmissingdir is not set and there is errors: +if (@media_mising_dirs) { + foreach my $media (@media_mising_dirs) { + printf(STDERR + "Missing dir '%s' for media '%s'\n", + $distrib->getpath($media, 'path'), + $distrib->getvalue($media, 'name') + ); + } + die "Stopping because dirs are missing, specify --skipmissingdir to ignore\n"; +} + sub clean_cache { unless ($noclean) { system($ENV{LD_LOADER} ? $ENV{LD_LOADER} : @{[]}, "rm", "-rf", $headers_dir); |