diff options
author | Julian Andres Klode <jak@debian.org> | 2020-02-18 12:38:46 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2020-02-18 12:38:46 +0000 |
commit | 62683ed6459e874119f3346d8be66b85e8a90533 (patch) | |
tree | 438581b4c0d1ee233244d7a20636eba96950adfc /apt-pkg/deb/deblistparser.cc | |
parent | 9a0a2daa268bd718a4b7fd9617b46ed74c76e94a (diff) | |
parent | 450af26202424bef33e0c58f3f99dfd0c21e7297 (diff) |
Merge branch 'pu/source-version' into 'master'
ABI BREAK: Implement pinning by source package
See merge request apt-team/apt!96
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 21d1736e4..7614423df 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -166,8 +166,12 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) } // Parse the source package name pkgCache::GrpIterator G = Ver.ParentPkg().Group(); + + // Setup the defaults Ver->SourcePkgName = G->Name; Ver->SourceVerStr = Ver->VerStr; + + // Parse the name and version str if (Section.Find(pkgTagSection::Key::Source,Start,Stop) == true) { const char * const Space = static_cast<const char *>(memchr(Start, ' ', Stop - Start)); @@ -194,33 +198,19 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) } APT::StringView const pkgname(Start, Stop - Start); + // Oh, our group is the wrong one for the source package. Make a new one. if (pkgname != G.Name()) { - for (pkgCache::PkgIterator P = G.PackageList(); P.end() == false; P = G.NextPkg(P)) - { - for (V = P.VersionList(); V.end() == false; ++V) - { - if (pkgname == V.SourcePkgName()) - { - Ver->SourcePkgName = V->SourcePkgName; - break; - } - } - if (V.end() == false) - break; - } - if (V.end() == true) - { - pkgCache::GrpIterator SG; - if (not NewGroup(SG, pkgname)) - return false; - - G = Ver.ParentPkg().Group(); - Ver->SourcePkgName = SG->Name; - } + if (not NewGroup(G, pkgname)) + return false; } } + // Link into by source package group. + Ver->SourcePkgName = G->Name; + Ver->NextInSource = G->VersionsInSource; + G->VersionsInSource = Ver.Index(); + Ver->MultiArch = ParseMultiArch(true); // Archive Size Ver->Size = Section.FindULL(pkgTagSection::Key::Size); |