Skip to content

Commit

Permalink
[backend] drop the inode number from the deltaid hash, it breaks if t…
Browse files Browse the repository at this point in the history
…he tree is copied

The inode is good for internal stuff, but bad for deltas, as deltas
get published and a redone delta is newly signed and thus end up
different than the old delta.
Copy over the old delta if we have one to ease migration.
  • Loading branch information
mlschroe committed Sep 5, 2013
1 parent d851c42 commit 0bdc4e8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/backend/bs_sched
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,19 @@ sub makedeltas {
my $aextrep = $oldbins{$aprp};
my @s = stat("$aextrep/$binarch/$obin");
next unless @s;
my $deltaid = Digest::MD5::md5_hex("$packid/$bin/$aprp/$obin/$s[9]/$s[7]/$s[1]");
# 2013-09-05 mls: dropped $s[1]
my $deltaid = Digest::MD5::md5_hex("$packid/$bin/$aprp/$obin/$s[9]/$s[7]");
if (!$ddir{$deltaid}) {
# see if we know it under the old id
my $olddeltaid = Digest::MD5::md5_hex("$packid/$bin/$aprp/$obin/$s[9]/$s[7]/$s[1]");
if ($ddir{$olddeltaid}) {
# yes, link it over
unlink("$ddir/$deltaid");
unlink("$ddir/$deltaid.dseq");
link("$ddir/$olddeltaid", "$ddir/$deltaid");
link("$ddir/$olddeltaid.dseq", "$ddir/$deltaid.dseq");
}
}
$deltaids{$deltaid} = 1;
if ($ddir{$deltaid}) {
next unless $ddir{"$deltaid.dseq"}; # delta was too big
Expand Down

0 comments on commit 0bdc4e8

Please sign in to comment.