summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-11-11 18:33:28 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-11-11 18:33:28 +0000
commit574b9985018f6a165fe80c9c5f82f7534260384e (patch)
treed9df8960ddcae32df03c7e159fad7e4a526f20a1
parent20ee54a418e756f87937983d8f19a3d7125f1c1c (diff)
downloadperl-MDV-Distribconf-574b9985018f6a165fe80c9c5f82f7534260384e.tar
perl-MDV-Distribconf-574b9985018f6a165fe80c9c5f82f7534260384e.tar.gz
perl-MDV-Distribconf-574b9985018f6a165fe80c9c5f82f7534260384e.tar.bz2
perl-MDV-Distribconf-574b9985018f6a165fe80c9c5f82f7534260384e.tar.xz
perl-MDV-Distribconf-574b9985018f6a165fe80c9c5f82f7534260384e.zip
- fix bad hdlist format detection when comparing index to media content
-rw-r--r--lib/MDV/Distribconf/Checks.pm6
-rw-r--r--lib/MDV/Distribconf/Utils.pm2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/MDV/Distribconf/Checks.pm b/lib/MDV/Distribconf/Checks.pm
index 86d0a17..cfeea65 100644
--- a/lib/MDV/Distribconf/Checks.pm
+++ b/lib/MDV/Distribconf/Checks.pm
@@ -258,8 +258,8 @@ sub get_index_sync_offset {
-f $hdlist && -f $synthesis or return 0; # avoid warnings
my ($inp, $ind) = MDV::Distribconf::Utils::hdlist_vs_dir($hdlist, $rpmspath);
- if (@{$inp || []} + @{$ind || []}) {
- return (0, scalar(@{$inp || []}), scalar(@{$ind || []}));
+ if (!defined($inp) || (@{$inp || []} + @{$ind || []})) {
+ return (0, (defined($inp) ? scalar(@{$inp || []}) : undef), scalar(@{$ind || []}));
}
return (1, 0, 0);
}
@@ -328,7 +328,7 @@ sub checkdistrib {
$fhout,
'UNSYNC_HDLIST',
"hdlist for media `%s' is not sync with its rpms" .
- (defined($inhd) ? " (+%d -%d rpms)" : ' (no hdlist)'),
+ (defined($inhd) ? " (+%d -%d rpms)" : ' (missing or unreadable hdlist: +%d rpms)'),
$media, $indir, $inhd
);
}
diff --git a/lib/MDV/Distribconf/Utils.pm b/lib/MDV/Distribconf/Utils.pm
index 818eb77..ea0bbb5 100644
--- a/lib/MDV/Distribconf/Utils.pm
+++ b/lib/MDV/Distribconf/Utils.pm
@@ -54,7 +54,7 @@ sub hdlist_vs_dir {
}
} while (scalar(@rpms) || scalar(@hdrs));
} else {
- return;
+ return(undef, [ map { m:.*/+(.*):; $1 } @rpms ]);
}
return (\@only_pack, \@only_dir);
}