$dorefresh = 0 if @s && ($self->{metadata_expire} == -1 || time() - $s[9] < $self->{metadata_expire});
}
$self->{cookie} = '';
+ $self->{extcookie} = '';
if (!$dorefresh && $self->usecachedrepo()) {
print "repo: '$self->{alias}' cached\n";
return 1;
except OSError:
pass
self['cookie'] = ''
+ self['extcookie'] = ''
if not dorefresh and self.usecachedrepo(None):
print("repo: '%s': cached" % self.name)
return True
self.handle.write_first_repodata(f)
f.flush()
if self.type != 'system' and not ext:
- if 'extcookie' not in self:
+ if not self['extcookie']:
self['extcookie'] = self.calc_cookie_ext(f, self['cookie'])
f.write(self['extcookie'])
if not ext:
end
end
@cookie = nil
+ @extcookie = nil
if !dorefresh && usecachedrepo(nil)
puts "repo: '#{@name}' cached"
return true
$chksum add "1.1"
$chksum add $cookie
$chksum add_fstat [$f fileno]
- set extcookie [$chksum raw]
- if {[string index $extcookie 0] eq "\000"} {
- set extcookie [string replace $extcookie 0 0 "\001"]
- }
- return $extcookie
+ return [$chksum raw]
}
proc repo_cachepath {selfName {ext "-"}} {
}
}
set self(cookie) {}
+ set self(extcookie) {}
if { !$dorefresh && [repo_usecachedrepo self] } {
puts "repo $self(name): cached"
return 1
}
$f flush
if {$self(type) ne "system" && $ext eq "-"} {
- if {![info exists self(extcookie)]} {
+ if {$self(extcookie) eq {}} {
set self(extcookie) [repo_calc_cookie_ext self $f $self(cookie)]
}
$f write $self(extcookie)