summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-09-28 10:48:45 +0200
committerMichael Schroeder <mls@suse.de>2012-09-28 10:50:27 +0200
commitcb55a96d6c0e7ce6a4a52ee1395d7c1eb08477d6 (patch)
treeaacdaffe1e3d486fd79ec50285c4ce1fd5c9f1b9
parent30e559033f0e5fa96fe65212e5e316aa2283e011 (diff)
downloadbuild-cb55a96d6c0e7ce6a4a52ee1395d7c1eb08477d6.tar.gz
build-cb55a96d6c0e7ce6a4a52ee1395d7c1eb08477d6.tar.bz2
build-cb55a96d6c0e7ce6a4a52ee1395d7c1eb08477d6.zip
- sigh, older repomd.xml files don't have a size element
-rwxr-xr-xcreaterepomddeps7
1 files changed, 4 insertions, 3 deletions
diff --git a/createrepomddeps b/createrepomddeps
index 2acc704..48a6b46 100755
--- a/createrepomddeps
+++ b/createrepomddeps
@@ -446,9 +446,10 @@ for my $url (@ARGV) {
utf8::downgrade($u);
}
my $cached;
- if (exists($f->{'size'}) && -e $u) {
- # should actually check the checksum, it's hopefully already included in the file name
- $cached = 1 if $f->{'size'} == -s _;
+ if (-e $u) {
+ $cached = 1;
+ $cached = 0 if exists($f->{'size'}) && $f->{'size'} != (-s _);
+ $cached = 0 if !exists($f->{'size'}) && $u !~ /[0-9a-f]{32}-primary/;
}
if ($url =~ /^http[s]?:\/\/([^\/]*)\/?/ and !$cached) {
if (system($INC[0].'/download', $dir . "repodata/", $baseurl . "repodata/" . basename($u))) {