diff options
-rwxr-xr-x | examples/p5solv | 12 | ||||
-rwxr-xr-x | examples/pysolv | 13 | ||||
-rwxr-xr-x | examples/rbsolv | 10 | ||||
-rw-r--r-- | examples/solv.c | 14 |
4 files changed, 34 insertions, 15 deletions
diff --git a/examples/p5solv b/examples/p5solv index cd24602..ce32f1c 100755 --- a/examples/p5solv +++ b/examples/p5solv @@ -178,7 +178,9 @@ sub writecachedrepo { die("internal error, cannot reload solv file\n") unless $self->{'handle'}->add_solv($f, $solv::Repo::SOLV_ADD_NO_STUBS); } else { $info->extend_to_repo(); - $info->add_solv($f, $solv::Repo::REPO_EXTEND_SOLVABLES); + my $flags = $solv::Repo::REPO_EXTEND_SOLVABLES; + $flags |= $solv::Repo::REPO_LOCALPOOL if $ext ne 'DL'; + $info->add_solv($f, $flags); } } } @@ -262,8 +264,8 @@ sub load_ext { my $f = $self->download($filename, 1, $filechksum); return 0 unless $f; if ($ext eq 'FL') { - $self->{'handle'}->add_rpmmd($f, 'FL', $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES); - } elsif ($ext eq 'FL') { + $self->{'handle'}->add_rpmmd($f, 'FL', $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES|$solv::Repo::REPO_LOCALPOOL); + } elsif ($ext eq 'DL') { $self->{'handle'}->add_deltainfoxml($f, $solv::Repo::REPO_USE_LOADING); } $self->writecachedrepo($ext, $repodata); @@ -390,7 +392,9 @@ sub load_ext { my $filechksum = $repodata->lookup_checksum($solv::SOLVID_META, $solv::SUSETAGS_FILE_CHECKSUM); my $f = $self->download("$descrdir/$filename", 1, $filechksum); return 0 unless $f; - $self->{'handle'}->add_susetags($f, $defvendorid, $ext, $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES); + my $flags = $solv::Repo::REPO_USE_LOADING|$solv::Repo::REPO_EXTEND_SOLVABLES; + $flags |= $solv::Repo::REPO_LOCALPOOL if $ext ne 'DL'; + $self->{'handle'}->add_susetags($f, $defvendorid, $ext, $flags); $self->writecachedrepo($ext, $repodata); return 1; } diff --git a/examples/pysolv b/examples/pysolv index bcc8bec..bfb020e 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -269,8 +269,10 @@ class repo_generic(dict): # need to extend to repo boundaries, as this is how # info.write() has written the data info.extend_to_repo() - # LOCALPOOL does not help as pool already contains all ids - info.add_solv(nf, Repo.REPO_EXTEND_SOLVABLES) + flags = Repo.REPO_EXTEND_SOLVABLES + if ext != 'DL': + flags |= Repo.REPO_LOCALPOOL + info.add_solv(nf, flags) os.rename(tmpname, self.cachepath(ext)) except IOError, e: if tmpname: @@ -393,7 +395,7 @@ class repo_repomd(repo_generic): if not f: return False if ext == 'FL': - self.handle.add_rpmmd(f, 'FL', Repo.REPO_USE_LOADING|Repo.REPO_EXTEND_SOLVABLES) + self.handle.add_rpmmd(f, 'FL', Repo.REPO_USE_LOADING|Repo.REPO_EXTEND_SOLVABLES|Repo.REPO_LOCALPOOL) elif ext == 'DL': self.handle.add_deltainfoxml(f, Repo.REPO_USE_LOADING) self.writecachedrepo(ext, repodata) @@ -517,7 +519,10 @@ class repo_susetags(repo_generic): f = self.download(descrdir + '/' + filename, True, filechksum) if not f: return False - self.handle.add_susetags(f, defvendorid, ext, Repo.REPO_USE_LOADING|Repo.REPO_EXTEND_SOLVABLES) + flags = Repo.REPO_USE_LOADING|Repo.REPO_EXTEND_SOLVABLES + if ext != 'DL': + flags |= Repo.REPO_LOCALPOOL + self.handle.add_susetags(f, defvendorid, ext, flags) self.writecachedrepo(ext, repodata) return True diff --git a/examples/rbsolv b/examples/rbsolv index 92edf8d..8470a8c 100755 --- a/examples/rbsolv +++ b/examples/rbsolv @@ -182,7 +182,9 @@ class Repo_generic abort("internal error, cannot reload solv file") unless @handle.add_solv(sf, Solv::Repo::SOLV_ADD_NO_STUBS) else info.extend_to_repo() - info.add_solv(sf, Solv::Repo::REPO_EXTEND_SOLVABLES) + flags = Solv::Repo::REPO_EXTEND_SOLVABLES + flags |= Solv::Repo::REPO_LOCALPOOL if ext != 'DL' + info.add_solv(sf, flags) end sf.close end @@ -321,7 +323,7 @@ class Repo_rpmmd < Repo_generic f = download(filename, true, filechksum) return false unless f if ext == 'FL' - @handle.add_rpmmd(f, 'FL', Solv::Repo::REPO_USE_LOADING|Solv::Repo::REPO_EXTEND_SOLVABLES) + @handle.add_rpmmd(f, 'FL', Solv::Repo::REPO_USE_LOADING|Solv::Repo::REPO_EXTEND_SOLVABLES|Solv::Repo::REPO_LOCALPOOL) elsif ext == 'DL' @handle.add_deltainfoxml(f, Solv::Repo::REPO_USE_LOADING) end @@ -453,7 +455,9 @@ class Repo_susetags < Repo_generic filechksum = repodata.lookup_checksum(Solv::SOLVID_META, Solv::SUSETAGS_FILE_CHECKSUM) f = download("#{descrdir}/#{filename}", true, filechksum) return false unless f - @handle.add_susetags(f, defvendorid, ext, Solv::Repo::REPO_USE_LOADING|Solv::Repo::REPO_EXTEND_SOLVABLES) + flags = Solv::Repo::REPO_USE_LOADING|Solv::Repo::REPO_EXTEND_SOLVABLES + flags |= Solv::Repo::REPO_LOCALPOOL if ext != 'DL' + @handle.add_susetags(f, defvendorid, ext, flags) f.close writecachedrepo(ext, repodata) return true diff --git a/examples/solv.c b/examples/solv.c index e489872..7ca9729 100644 --- a/examples/solv.c +++ b/examples/solv.c @@ -1253,12 +1253,14 @@ writecachedrepo(Repo *repo, Repodata *info, const char *repoext, unsigned char * } else { + int flags = REPO_USE_LOADING|REPO_EXTEND_SOLVABLES; /* make sure repodata contains complete repo */ /* (this is how repodata_write saves it) */ repodata_extend_block(info, repo->start, repo->end - repo->start); info->state = REPODATA_LOADING; - /* no need for LOCALPOOL as pool already contains ids */ - repo_add_solv(repo, fp, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES); + if (strcmp(repoext, "DL") != 0) + flags |= REPO_LOCALPOOL; + repo_add_solv(repo, fp, flags); info->state = REPODATA_AVAILABLE; /* in case the load failed */ } fclose(fp); @@ -1366,7 +1368,7 @@ repomd_load_ext(Repo *repo, Repodata *data) if ((fp = curlfopen(cinfo, filename, iscompressed(filename), filechksum, filechksumtype, 0)) == 0) return 0; if (!strcmp(ext, "FL")) - r = repo_add_rpmmd(repo, fp, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES); + r = repo_add_rpmmd(repo, fp, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES|REPO_LOCALPOOL); else if (!strcmp(ext, "DL")) r = repo_add_deltainfoxml(repo, fp, REPO_USE_LOADING); fclose(fp); @@ -1486,6 +1488,7 @@ susetags_load_ext(Repo *repo, Repodata *data) struct repoinfo *cinfo; const unsigned char *filechksum; Id filechksumtype; + int flags; cinfo = repo->appdata; filename = repodata_lookup_str(data, SOLVID_META, SUSETAGS_FILE_NAME); @@ -1514,7 +1517,10 @@ susetags_load_ext(Repo *repo, Repodata *data) filechksum = repodata_lookup_bin_checksum(data, SOLVID_META, SUSETAGS_FILE_CHECKSUM, &filechksumtype); if ((fp = curlfopen(cinfo, pool_tmpjoin(repo->pool, descrdir, "/", filename), iscompressed(filename), filechksum, filechksumtype, 0)) == 0) return 0; - if (repo_add_susetags(repo, fp, defvendor, ext, REPO_USE_LOADING|REPO_EXTEND_SOLVABLES)) + flags = REPO_USE_LOADING|REPO_EXTEND_SOLVABLES; + if (strcmp(ext, "DL") != 0) + flags |= REPO_LOCALPOOL; + if (repo_add_susetags(repo, fp, defvendor, ext, flags)) { fclose(fp); printf("%s\n", pool_errstr(repo->pool)); |