Bladeren bron

regex for package names executed on Grp- not PkgIterator

David Kalnischkies 16 jaren geleden
bovenliggende
commit
3d5a34b22a
3 gewijzigde bestanden met toevoegingen van 8 en 3 verwijderingen
  1. 1 0
      apt-pkg/depcache.h
  2. 6 3
      cmdline/apt-get.cc
  3. 1 0
      debian/changelog

+ 1 - 0
apt-pkg/depcache.h

@@ -331,6 +331,7 @@ class pkgDepCache : protected pkgCache::Namespace
    // Legacy.. We look like a pkgCache
    inline operator pkgCache &() {return *Cache;};
    inline Header &Head() {return *Cache->HeaderP;};
+   inline GrpIterator GrpBegin() {return Cache->GrpBegin();};
    inline PkgIterator PkgBegin() {return Cache->PkgBegin();};
    inline GrpIterator FindGrp(string const &Name) {return Cache->FindGrp(Name);};
    inline PkgIterator FindPkg(string const &Name) {return Cache->FindPkg(Name);};

+ 6 - 3
cmdline/apt-get.cc

@@ -1772,11 +1772,14 @@ bool DoInstall(CommandLine &CmdL)
 	 
 	    // Run over the matches
 	    bool Hit = false;
-	    for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+	    for (pkgCache::GrpIterator Grp = Cache->GrpBegin(); Grp.end() == false; ++Grp)
 	    {
-	       if (regexec(&Pattern,Pkg.Name(),0,0,0) != 0)
+	       if (regexec(&Pattern,Grp.Name(),0,0,0) != 0)
 		  continue;
-	    
+	       Pkg = Grp.FindPkg("native");
+	       if (unlikely(Pkg.end() == true))
+		  continue;
+
 	       ioprintf(c1out,_("Note, selecting %s for regex '%s'\n"),
 			Pkg.Name(),S);
 	    

+ 1 - 0
debian/changelog

@@ -17,6 +17,7 @@ apt (0.7.26~exp4) experimental; urgency=low
     - remove the lock file handling and let Acquire take care of it instead
     - display MD5Sum in --print-uris if not forced to use another method
       instead of displaying the strongest available (Closes: #576420)
+    - regex for package names executed on Grp- not PkgIterator
 
  -- David Kalnischkies <kalnischkies@gmail.com>  Sat, 03 Apr 2010 14:58:39 +0200