Browse Source

* apt-pkg/pkgcache.h:

- clean up mess with the "all" handling in MultiArch to
    fix LP: #733741 cleanly for everyone now
debian/1.8.y
David Kalnischkies 12 years ago
parent
commit
894d672e9b
  1. 4
      apt-pkg/cacheiterators.h
  2. 11
      apt-pkg/deb/deblistparser.cc
  3. 6
      apt-pkg/edsp.cc
  4. 4
      apt-pkg/packagemanager.cc
  5. 17
      apt-pkg/pkgcache.h
  6. 6
      debian/changelog

4
apt-pkg/cacheiterators.h

@ -206,9 +206,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
inline const char *Arch() const {
if (S->MultiArch == pkgCache::Version::All ||
S->MultiArch == pkgCache::Version::AllForeign ||
S->MultiArch == pkgCache::Version::AllAllowed)
if (S->MultiArch == pkgCache::Version::All)
return "all";
return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
};

11
apt-pkg/deb/deblistparser.cc

@ -128,12 +128,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
}
if (ArchitectureAll() == true)
switch (Ver->MultiArch)
{
case pkgCache::Version::Foreign: Ver->MultiArch = pkgCache::Version::AllForeign; break;
case pkgCache::Version::Allowed: Ver->MultiArch = pkgCache::Version::AllAllowed; break;
default: Ver->MultiArch = pkgCache::Version::All;
}
Ver->MultiArch |= pkgCache::Version::All;
// Archive Size
Ver->Size = Section.FindULL("Size");
@ -687,12 +682,12 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver)
if (MultiArchEnabled == false)
return true;
else if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed)
else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
{
string const Package = string(Ver.ParentPkg().Name()).append(":").append("any");
return NewProvidesAllArch(Ver, Package, Ver.VerStr());
}
else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign)
else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
return NewProvidesAllArch(Ver, Ver.ParentPkg().Name(), Ver.VerStr());
return true;

6
apt-pkg/edsp.cc

@ -82,11 +82,11 @@ void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgI
if ((Pkg->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
fprintf(output, "Essential: yes\n");
fprintf(output, "Section: %s\n", Ver.Section());
if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed)
if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed)
fprintf(output, "Multi-Arch: allowed\n");
else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign)
else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign)
fprintf(output, "Multi-Arch: foreign\n");
else if (Ver->MultiArch == pkgCache::Version::Same)
else if ((Ver->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
fprintf(output, "Multi-Arch: same\n");
signed short Pin = std::numeric_limits<signed short>::min();
for (pkgCache::VerFileIterator File = Ver.FileList(); File.end() == false; ++File) {

4
apt-pkg/packagemanager.cc

@ -319,7 +319,7 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
}
if (Cache[Pkg].InstVerIter(Cache)->MultiArch == pkgCache::Version::Same)
if ((Cache[Pkg].InstVerIter(Cache)->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
for (PkgIterator P = Pkg.Group().PackageList();
P.end() == false; P = Pkg.Group().NextPkg(P))
{
@ -602,7 +602,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
if (instVer->MultiArch == pkgCache::Version::Same)
if ((instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
for (PkgIterator P = Pkg.Group().PackageList();
P.end() == false; P = Pkg.Group().NextPkg(P))
{

17
apt-pkg/pkgcache.h

@ -500,15 +500,18 @@ struct pkgCache::Version
map_ptrloc VerStr; // StringItem
/** \brief section this version is filled in */
map_ptrloc Section; // StringItem
/** \brief Multi-Arch capabilities of a package version */
enum VerMultiArch { None = 0, /*!< is the default and doesn't trigger special behaviour */
All = (1<<0), /*!< will cause that Ver.Arch() will report "all" */
Foreign = (1<<1), /*!< can satisfy dependencies in another architecture */
Same = (1<<2), /*!< can be co-installed with itself from other architectures */
Allowed = (1<<3) /*!< other packages are allowed to depend on thispkg:any */ };
/** \brief stores the MultiArch capabilities of this version
None is the default and doesn't trigger special behaviour,
Foreign means that this version can fulfill dependencies even
if it is built for another architecture as the requester.
Same indicates that builds for different architectures can
be co-installed on the system */
/* FIXME: A bitflag would be better with the next abibreak… */
enum {None, All, Foreign, Same, Allowed, AllForeign, AllAllowed} MultiArch;
Flags used are defined in pkgCache::Version::VerMultiArch
*/
unsigned char MultiArch;
/** \brief references all the PackageFile's that this version came from

6
debian/changelog

@ -7,13 +7,15 @@ apt (0.8.15) UNRELEASED; urgency=low
* provide two edsp solvers in apt-utils:
- 'dump' to quickly output a complete scenario and
- 'apt' to use the internal as an external resolver
* apt-pkg/pkgcache.h:
- clean up mess with the "all" handling in MultiArch to
fix LP: #733741 cleanly for everyone now
[ Stefano Zacchiroli ]
* doc/external-dependency-solver-protocol.txt:
- describe EDSP and the configuration interface around it
-- David Kalnischkies <kalnischkies@gmail.com> Tue, 17 May 2011 17:34:56 +0200
-- David Kalnischkies <kalnischkies@gmail.com> Tue, 17 May 2011 17:44:16 +0200
apt (0.8.14.2) UNRELEASED; urgency=low

Loading…
Cancel
Save