print "repo: '$self->{'alias'}' cached\n";
return 1;
}
- return $self->load_if_changed();
-}
-
-sub load_if_changed {
return 0;
}
return 1;
}
-sub load_if_changed {
- my ($self) = @_;
+sub load {
+ my ($self, $pool) = @_;
+ return 1 if $self->Repo::generic::load($pool);
print "rpmmd repo '$self->{'alias'}': ";
STDOUT->flush();
my $f = $self->download("repodata/repomd.xml");
return 1;
}
-sub load_if_changed {
- my ($self) = @_;
+sub load {
+ my ($self, $pool) = @_;
+ return 1 if $self->Repo::generic::load($pool);
print "susetags repo '$self->{'alias'}': ";
STDOUT->flush();
my $f = $self->download("content");
if not dorefresh and self.usecachedrepo(None):
print "repo: '%s': cached" % self.name
return True
- return self.load_if_changed()
-
- def load_if_changed(self):
return False
def load_ext(self, repodata):
return solv.xfopen_fd(None, os.dup(f.fileno()))
def usecachedrepo(self, ext, mark=False):
- if not ext:
- cookie = self['cookie']
- else:
- cookie = self['extcookie']
try:
repopath = self.cachepath(ext)
f = open(repopath, 'r')
fcookie = f.read(32)
if len(fcookie) != 32:
return False
+ if not ext:
+ cookie = self['cookie']
+ else:
+ cookie = self['extcookie']
if cookie and fcookie != cookie:
return False
if self.type != 'system' and not ext:
def writecachedrepo(self, ext, info=None):
if not ext and 'incomplete' in self:
- return
+ return
try:
if not os.path.isdir("/var/cache/solv"):
os.mkdir("/var/cache/solv", 0755)
return ''
class repo_repomd(repo_generic):
- def load_if_changed(self):
+ def load(self, pool):
+ if super(repo_repomd, self).load(pool):
+ return True
print "rpmmd repo '%s':" % self.name,
sys.stdout.flush()
f = self.download("repodata/repomd.xml", False, None, None)
self.handle.add_updateinfoxml(f, 0)
solv.xfclose(f)
self.add_exts()
- self.writecachedrepo(None)
+ self.writecachedrepo(None)
# must be called after writing the repo
self.handle.create_stubs()
return True
return True
class repo_susetags(repo_generic):
- def load_if_changed(self):
+ def load(self, pool):
+ if super(repo_susetags, self).load(pool):
+ return True
print "susetags repo '%s':" % self.name,
sys.stdout.flush()
f = self.download("content", False, None, None)
solv.xfclose(f)
self.handle.internalize()
self.add_exts()
- self.writecachedrepo(None)
+ self.writecachedrepo(None)
# must be called after writing the repo
self.handle.create_stubs()
return True
puts "repo: '#{@name}' cached"
return true
end
- return load_if_changed()
- end
-
- def load_ext(repodata)
return false
end
- def load_if_changed
+ def load_ext(repodata)
return false
end
return nil, nil
end
- def load_if_changed
+ def load(pool)
+ return true if super(pool)
print "rpmmd repo '#{@name}: "
f = download("repodata/repomd.xml", false, nil, nil)
if !f
return nil, nil
end
- def load_if_changed
+ def load(pool)
+ return true if super(pool)
print "susetags repo '#{@name}: "
f = download("content", false, nil, nil)
if !f