]> git.saurik.com Git - apt.git/commitdiff
Drop the Arch information from the Version structure as we can get
authorDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 7 Feb 2010 11:38:13 +0000 (12:38 +0100)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Sun, 7 Feb 2010 11:38:13 +0000 (12:38 +0100)
the information from the parent package now

apt-pkg/cacheiterators.h
apt-pkg/deb/deblistparser.cc
apt-pkg/deb/deblistparser.h
apt-pkg/pkgcache.cc
apt-pkg/pkgcache.h
apt-pkg/pkgcachegen.h

index 33d2ed6be655f21a4345a6cad340a64398d4a57e..d8e044f88f8938a9192dfcc1628c763f76af9748 100644 (file)
@@ -178,7 +178,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
        // Accessors
        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 {return S->Arch == 0?0:Owner->StrP + S->Arch;};
+       inline const char *Arch() const {return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;};
        inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
 
        inline DescIterator DescriptionList() const;
index f683de423f74417fdd098cce9d2f7295699d7f1c..26841d3d2a0fc45ae37258435042973d2226a5ac 100644 (file)
@@ -83,6 +83,13 @@ string debListParser::Architecture() {
        return Result;
 }
                                                                        /*}}}*/
+// ListParser::ArchitectureAll                                         /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool debListParser::ArchitectureAll() {
+       return Section.FindS("Architecture") == "all";
+}
+                                                                       /*}}}*/
 // ListParser::Version - Return the version string                     /*{{{*/
 // ---------------------------------------------------------------------
 /* This is to return the string describing the version in debian form,
@@ -101,9 +108,6 @@ bool debListParser::NewVersion(pkgCache::VerIterator Ver)
    // Parse the section
    Ver->Section = UniqFindTagWrite("Section");
 
-   // Parse the architecture
-   Ver->Arch = WriteUniqString(Architecture());
-
    // Parse multi-arch
    if (Section.FindS("Architecture") == "all")
       /* Arch all packages can't have a Multi-Arch field,
index cba4f8e5da55cf2d6cc81f9f061a7083ff0da79e..8da051530fd06cf9b60e5a25e318a90ee733c64d 100644 (file)
@@ -47,6 +47,7 @@ class debListParser : public pkgCacheGenerator::ListParser
    // These all operate against the current section
    virtual string Package();
    virtual string Architecture();
+   virtual bool ArchitectureAll();
    virtual string Version();
    virtual bool NewVersion(pkgCache::VerIterator Ver);
    virtual string Description();
index 1e4c7edb3825ac4f2c8c72f63e07e3846eac6b0b..7d98869ea101491ed7ee1a1904b0acbda4bdbb57 100644 (file)
@@ -399,7 +399,7 @@ const char *
 pkgCache::PkgIterator::CandVersion() const 
 {
   //TargetVer is empty, so don't use it.
-  VerIterator version = pkgPolicy::pkgPolicy(Owner).GetCandidateVer(*this);
+  VerIterator version = pkgPolicy(Owner).GetCandidateVer(*this);
   if (version.IsGood())
     return version.VerStr();
   return 0;
@@ -727,7 +727,7 @@ string pkgCache::VerIterator::RelStr()
            Res += File.Site();
       }      
    }
-   if (S->Arch != 0)
+   if (S->ParentPkg != 0)
       Res.append(" [").append(Arch()).append("]");
    return Res;
 }
index 5f50001d0cce1cc6bb9735057a308bd1af90e711..5edeedfd12f57e1802261f3b24682525b4dbeac3 100644 (file)
@@ -276,7 +276,6 @@ struct pkgCache::Version                                            /*{{{*/
 {
    map_ptrloc VerStr;            // Stringtable
    map_ptrloc Section;           // StringTable (StringItem)
-   map_ptrloc Arch;              // StringTable
    enum {None, All, Foreign, Same, Allowed} MultiArch;
 
    // Lists
index 53f09b99123adf76f78e4dbd84ae5c832b7ccd50..ca5d74a9fbada2ec9d33a8014865d217cab5584d 100644 (file)
@@ -112,6 +112,7 @@ class pkgCacheGenerator::ListParser
    // These all operate against the current section
    virtual string Package() = 0;
    virtual string Architecture() = 0;
+   virtual bool ArchitectureAll() = 0;
    virtual string Version() = 0;
    virtual bool NewVersion(pkgCache::VerIterator Ver) = 0;
    virtual string Description() = 0;