[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Source field in binary Packages list



On Sun, Aug 31, 2008 at 02:20:27PM -0700, Daniel Burrows wrote:
>   Why do you need #497205?  Is it too slow to just use SourcePkg() in
> the package records object?
> 
>   Daniel

Sorry! I was lazy/stupid/whatever enough to not read more about apt and
learn how to do it without adding a field to the cache. So, I am
attaching the patch to the patch for aptitude, which does not need this
other patch to APT. I will close the apt bug after that.

I still like the patch to be reviewed, if you can, please.

Thanks,
Thadeu Cascardo.
diff -u aptitude-0.4.11.8/src/pkg_grouppolicy.cc aptitude-0.4.11.8/src/pkg_grouppolicy.cc
--- aptitude-0.4.11.8/src/pkg_grouppolicy.cc
+++ aptitude-0.4.11.8/src/pkg_grouppolicy.cc
@@ -1676,11 +1676,11 @@
 
   void add_package(const pkgCache::PkgIterator &pkg, pkg_subtree *root)
   {
-    string source;
-    if (!pkg.Source())
+    if (pkg.VersionList().end() || pkg.VersionList().FileList().end())
+      return;
+    string source=apt_package_records->Lookup(pkg.VersionList().FileList()).SourcePkg();
+    if (source.length()==0)
       source=pkg.Name();
-    else
-      source=pkg.Source();
 
     childmap::iterator found=children.find(source);
 

Attachment: signature.asc
Description: Digital signature


Reply to: