Bug#497205: apt: APT pkgcache knows about the package Source
Package: apt
Version: 0.7.14.1
Severity: wishlist
Tags: patch
This patch makes the Source package name for a given binary package
available to user of libapt-pkg. This is required for a patch I am
submitting to aptitude.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.27-rc1-00001-gf053e9a (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages apt depends on:
ii debian-archive-keyring 2008.04.16+nmu1 GnuPG archive keys of the Debian a
ii libc6 2.7-13 GNU C Library: Shared libraries
ii libgcc1 1:4.3.1-9 GCC support library
ii libstdc++6 4.3.1-9 The GNU Standard C++ Library v3
apt recommends no packages.
-- no debconf information
--- apt-0.7.14/apt-pkg/cacheiterators.h 2008-05-28 10:22:13.000000000 -0300
+++ apt-0.7.14.1/apt-pkg/cacheiterators.h 2008-08-30 12:24:44.000000000 -0300
@@ -72,6 +72,7 @@
inline const char *Name() const {return Pkg->Name == 0?0:Owner->StrP + Pkg->Name;};
inline const char *Section() const {return Pkg->Section == 0?0:Owner->StrP + Pkg->Section;};
+ inline const char *Source() const {return Pkg->Source == 0?0:Owner->StrP + Pkg->Source;};
inline bool Purge() const {return Pkg->CurrentState == pkgCache::State::Purge ||
(Pkg->CurrentVer == 0 && Pkg->CurrentState == pkgCache::State::NotInstalled);};
inline VerIterator VersionList() const;
--- apt-0.7.14/apt-pkg/deb/deblistparser.cc 2008-05-28 10:22:14.000000000 -0300
+++ apt-0.7.14.1/apt-pkg/deb/deblistparser.cc 2008-08-30 11:35:10.000000000 -0300
@@ -171,6 +171,8 @@
{
if (Pkg->Section == 0)
Pkg->Section = UniqFindTagWrite("Section");
+ if (Pkg->Source == 0)
+ Pkg->Source = UniqFindTagWrite ("Source");
if (Section.FindFlag("Essential",Pkg->Flags,pkgCache::Flag::Essential) == false)
return false;
if (Section.FindFlag("Important",Pkg->Flags,pkgCache::Flag::Important) == false)
--- apt-0.7.14/apt-pkg/pkgcache.h 2008-05-28 10:22:14.000000000 -0300
+++ apt-0.7.14.1/apt-pkg/pkgcache.h 2008-08-30 11:30:42.000000000 -0300
@@ -203,6 +203,7 @@
map_ptrloc VersionList; // Version
map_ptrloc CurrentVer; // Version
map_ptrloc Section; // StringTable (StringItem)
+ map_ptrloc Source; // Stringtable
// Linked list
map_ptrloc NextPackage; // Package
Reply to: