- sigh, older repomd.xml files don't have a size element
authorMichael Schroeder <mls@suse.de>
Fri, 28 Sep 2012 08:48:45 +0000 (10:48 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 28 Sep 2012 08:50:27 +0000 (10:50 +0200)
createrepomddeps

index 2acc704..48a6b46 100755 (executable)
@@ -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))) {