aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2005-09-06 15:56:38 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2005-09-06 15:56:38 +0000
commite0f1796baf5c0a2cf7758aac26d1abf538557fcf (patch)
tree920a224e79463895be4a4286f169f1282cab91e8
parent8cd4fc646f53866fe70208fe3303fea0ee40379f (diff)
downloadrpmtools-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-xgendistrib25
1 files changed, 22 insertions, 3 deletions
diff --git a/gendistrib b/gendistrib
index 9bb0a71..aba5d40 100755
--- a/gendistrib
+++ b/gendistrib
@@ -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);