Просмотр исходного кода

Two small bug fixes
Author: jgg
Date: 2001-02-22 06:26:27 GMT
Two small bug fixes

Arch Librarian лет назад: 22
Родитель
Сommit
0f2fa32291
4 измененных файлов с 29 добавлено и 16 удалено
  1. 1 3
      apt-pkg/deb/dpkgpm.cc
  2. 19 11
      cmdline/apt-cache.cc
  3. 8 1
      debian/changelog
  4. 1 1
      doc/apt-cache.8.sgml

+ 1 - 3
apt-pkg/deb/dpkgpm.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: dpkgpm.cc,v 1.18 2001/02/20 07:03:17 jgg Exp $
+// $Id: dpkgpm.cc,v 1.19 2001/02/22 06:26:27 jgg Exp $
 /* ######################################################################
 
    DPKG Package Manager - Provide an interface to dpkg
@@ -250,8 +250,6 @@ bool pkgDPkgPM::RunScriptsWithPkgs(const char *Cnf)
       string::size_type Pos;
       if ((Pos = OptSec.find(' ')) == string::npos || Pos == 0)
 	 Pos = OptSec.length();
-      else
-	 Pos--;
       OptSec = "DPkg::Tools::Options::" + string(Opts->Value.c_str(),Pos);
       
       unsigned int Version = _config->FindI(OptSec+"::Version",1);

+ 19 - 11
cmdline/apt-cache.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: apt-cache.cc,v 1.44 2001/02/20 07:03:17 jgg Exp $
+// $Id: apt-cache.cc,v 1.45 2001/02/22 06:26:27 jgg Exp $
 /* ######################################################################
    
    apt-cache - Manages the cache files
@@ -935,13 +935,13 @@ bool Search(CommandLine &CmdL)
    // Map versions that we want to write out onto the VerList array.
    for (pkgCache::PkgIterator P = Cache.PkgBegin(); P.end() == false; P++)
    {
+      VFList[P->ID].NameMatch = NumPatterns != 0;
       for (unsigned I = 0; I != NumPatterns; I++)
       {
 	 if (regexec(&Patterns[I],P.Name(),0,0,0) == 0)
-	 {
-	    VFList[P->ID].NameMatch = true;
-	    break;
-	 }
+	    VFList[P->ID].NameMatch &= true;
+	 else
+	    VFList[P->ID].NameMatch = false;
       }
       
       // Doing names only, drop any that dont match..
@@ -961,12 +961,20 @@ bool Search(CommandLine &CmdL)
    for (ExVerFile *J = VFList; J->Vf != 0; J++)
    {
       pkgRecords::Parser &P = Recs.Lookup(pkgCache::VerFileIterator(Cache,J->Vf));
-      
-      bool Match = J->NameMatch;
-      string LongDesc = P.LongDesc();
-      for (unsigned I = 0; I != NumPatterns && Match == false; I++)
-	 if (regexec(&Patterns[I],LongDesc.c_str(),0,0,0) == 0)
-	    Match = true;
+
+      bool Match = true;
+      if (J->NameMatch == false)
+      {
+	 string LongDesc = P.LongDesc();
+	 Match = NumPatterns != 0;
+	 for (unsigned I = 0; I != NumPatterns; I++)
+	 {
+	    if (regexec(&Patterns[I],LongDesc.c_str(),0,0,0) == 0)
+	       Match &= true;
+	    else
+	       Match = false;
+	 }
+      }
       
       if (Match == true)
       {

+ 8 - 1
debian/changelog

@@ -1,3 +1,10 @@
+apt (0.5.1) unstable; urgency=low
+
+  * Fixed #82894 again, or should be and.
+  * Process the option string right. Closes: #86921
+  
+ -- Jason Gunthorpe <jgg@debian.org>  Thu, 22 Feb 2001 00:39:15 -0500
+
 apt (0.5.0) unstable; urgency=low
 
   * Fixed an obscure bug with missing final double new lines in 
@@ -98,7 +105,7 @@ apt (0.5.0) unstable; urgency=low
   * Using potato debhelper. Closes: #57977
   * I cannot self-terminate. Closes: #74928
   
- -- Jason Gunthorpe <jgg@debian.org>  Wed, 25 Oct 2000 00:11:06 -0600
+ -- Jason Gunthorpe <jgg@debian.org>  Wed, 21 Feb 2001 00:39:15 -0500
  
 apt (0.3.19) frozen unstable; urgency=low
   

+ 1 - 1
doc/apt-cache.8.sgml

@@ -205,7 +205,7 @@ Reverse Provides:
      searched, only the package name is.
      <para>
      Seperate arguments can be used to specified multiple search patterns that 
-     are or'd together.
+     are and'd together.
      </VarListEntry>
 
      <VarListEntry><Term>depends</Term>