]> git.saurik.com Git - apt.git/commitdiff
* merged apt--tasks, this brings in the latest changes from apt--mvo as well
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 19 Sep 2006 14:05:44 +0000 (16:05 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 19 Sep 2006 14:05:44 +0000 (16:05 +0200)
apt-pkg/tagfile.cc
apt-pkg/tagfile.h
cmdline/apt-get.cc
configure.in
debian/changelog
methods/gzip.cc
po/ChangeLog
po/LINGUAS

index 14682956654273124b333b9d9fea203c8324dc57..72cd08596089c30eb453a43fd891a80ea8802827 100644 (file)
@@ -33,33 +33,22 @@ using std::string;
 /* */
 pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) :
      Fd(*pFd),
-     Size(Size),
-     Map(NULL),
-     Buffer(0)
+     Size(Size)
 {
    if (Fd.IsOpen() == false)
    {
+      Buffer = 0;
       Start = End = Buffer = 0;
       Done = true;
       iOffset = 0;
-      Map = NULL;
       return;
    }
    
-   // check if we can MMap it
-   if(Fd.Size() == 0)
-   {
-      Buffer = new char[Size];
-      Start = End = Buffer;
-      Done = false;
-      Fill();
-   } else {
-      Map = new MMap (Fd, MMap::Public | MMap::ReadOnly);
-      Buffer = (char *) Map->Data ();
-      Start = Buffer;
-      End = Buffer + Map->Size ();
-   }
+   Buffer = new char[Size];
+   Start = End = Buffer;
+   Done = false;
    iOffset = 0;
+   Fill();
 }
                                                                        /*}}}*/
 // TagFile::~pkgTagFile - Destructor                                   /*{{{*/
@@ -67,8 +56,7 @@ pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) :
 /* */
 pkgTagFile::~pkgTagFile()
 {
-   if(!Map) delete [] Buffer;
-   delete Map;
+   delete [] Buffer;
 }
                                                                        /*}}}*/
 // TagFile::Step - Advance to the next section                         /*{{{*/
@@ -76,15 +64,8 @@ pkgTagFile::~pkgTagFile()
 /* If the Section Scanner fails we refill the buffer and try again. */
 bool pkgTagFile::Step(pkgTagSection &Tag)
 {
-   if ((Map != NULL) && (Start == End))
-      return false;
-
    if (Tag.Scan(Start,End - Start) == false)
    {
-      if (Map != NULL)
-        return _error->Error(_("Unable to parse package file %s (1)"),
-                             Fd.Name().c_str());
-
       if (Fill() == false)
         return false;
       
@@ -158,30 +139,23 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset)
       return Step(Tag);
    }
 
+   // Reposition and reload..
    iOffset = Offset;
-   if (Map != NULL)
-   {
-      Start = Buffer + iOffset;
-   } 
-   else 
-   {
-      // Reposition and reload..
-      Done = false;
-      if (Fd.Seek(Offset) == false)
-        return false;
-      End = Start = Buffer;
+   Done = false;
+   if (Fd.Seek(Offset) == false)
+      return false;
+   End = Start = Buffer;
    
-      if (Fill() == false)
-        return false;
+   if (Fill() == false)
+      return false;
 
-      if (Tag.Scan(Start,End - Start) == true)
-        return true;
+   if (Tag.Scan(Start,End - Start) == true)
+      return true;
+   
+   // This appends a double new line (for the real eof handling)
+   if (Fill() == false)
+      return false;
    
-      // This appends a double new line (for the real eof handling)
-      if (Fill() == false)
-        return false;
-   }
-
    if (Tag.Scan(Start,End - Start) == false)
       return _error->Error(_("Unable to parse package file %s (2)"),Fd.Name().c_str());
    
@@ -192,12 +166,12 @@ bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset)
 // ---------------------------------------------------------------------
 /* This looks for the first double new line in the data stream. It also
    indexes the tags in the section. This very simple hash function for the
-   first 3 letters gives very good performance on the debian package files */
+   last 8 letters gives very good performance on the debian package files */
 inline static unsigned long AlphaHash(const char *Text, const char *End = 0)
 {
    unsigned long Res = 0;
    for (; Text != End && *Text != ':' && *Text != 0; Text++)
-      Res = (unsigned long)(*Text) ^ (Res << 2);
+      Res = ((unsigned long)(*Text) & 0xDF) ^ (Res << 1);
    return Res & 0xFF;
 }
 
@@ -207,7 +181,7 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
    Stop = Section = Start;
    memset(AlphaIndexes,0,sizeof(AlphaIndexes));
 
-   if (Stop == 0 || MaxLength == 0)
+   if (Stop == 0)
       return false;
    
    TagCount = 0;
@@ -238,12 +212,6 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength)
       Stop++;
    }
 
-   if ((Stop+1 >= End) && (End[-1] == '\n' || End[-1] == '\r'))
-   {
-      Indexes[TagCount] = (End - 1) - Section;
-      return true;
-   }
-
    return false;
 }
                                                                        /*}}}*/
index dd481ba510ea9fe1838ffe278ac1cc962493f293..f7f8155a527ee8762db6f9cbcd5babbb89970bed 100644 (file)
@@ -25,7 +25,6 @@
 #endif 
 
 #include <apt-pkg/fileutl.h>
-#include <apt-pkg/mmap.h>
 #include <stdio.h>
     
 class pkgTagSection
@@ -70,7 +69,6 @@ class pkgTagSection
 class pkgTagFile
 {
    FileFd &Fd;
-   MMap *Map;
    char *Buffer;
    char *Start;
    char *End;
index 089b6470133618d517c1186d29f55077bf57843f..cd43e17c7f118574335de37aff18fce85989afc4 100644 (file)
@@ -1496,6 +1496,61 @@ bool DoUpgrade(CommandLine &CmdL)
    return InstallPackages(Cache,true);
 }
                                                                        /*}}}*/
+// DoInstallTask - Install task from the command line                  /*{{{*/
+// ---------------------------------------------------------------------
+/* Install named task */
+bool DoInstallTask(CommandLine &CmdL)
+{
+   const char *start, *end;
+   pkgCache::PkgIterator Pkg;
+
+   CacheFile Cache;
+   if (Cache.OpenForInstall() == false || 
+       Cache.CheckDeps(CmdL.FileSize() != 1) == false)
+      return false;
+
+   // create the records parser
+   pkgRecords Recs(Cache);
+   
+   unsigned int ExpectedInst = 0;
+   unsigned int Packages = 0;
+   pkgProblemResolver Fix(Cache);
+   char buf[64*1024];
+
+   for (const char **I = CmdL.FileList + 1; *I != 0; I++)
+   {
+      regex_t Pattern;
+      int Res;
+
+      // build regexp for the task
+      char S[300];
+      snprintf(S, sizeof(S), "^Task:.*%s.*\n", *I);
+      regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE);
+
+      for (Pkg = Cache->PkgBegin(); Pkg.end() == false; Pkg++)
+      {
+        pkgCache::VerIterator ver = (*Cache)[Pkg].CandidateVerIter(*Cache);
+        if(ver.end())
+           continue;
+        pkgRecords::Parser &parser = Recs.Lookup(ver.FileList());
+        parser.GetRec(start,end);
+        strncpy(buf, start, end-start);
+        buf[end-start] = 0x0;
+        if (regexec(&Pattern,buf,0,0,0) != 0)
+           continue;
+        TryToInstall(Pkg,Cache,Fix,false,false,ExpectedInst);
+      }
+   }
+
+   // Call the scored problem resolver
+   Fix.InstallProtect();
+   if (Fix.Resolve(true) == false)
+      _error->Discard();
+   
+   // prompt for install
+   return InstallPackages(Cache,false,true);
+}
+
 // DoInstall - Install packages from the command line                  /*{{{*/
 // ---------------------------------------------------------------------
 /* Install named packages */
@@ -2653,6 +2708,7 @@ int main(int argc,const char *argv[])
    CommandLine::Dispatch Cmds[] = {{"update",&DoUpdate},
                                    {"upgrade",&DoUpgrade},
                                    {"install",&DoInstall},
+                                   {"installtask",&DoInstallTask},
                                    {"remove",&DoInstall},
                                   {"autoremove",&DoInstall},
                                    {"dist-upgrade",&DoDistUpgrade},
index 6ca79fe859cfc06af5ed3309e719918444600780..4647f4ffb0ad51614ee1f5fcad3ccdd02841769e 100644 (file)
@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu9")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.45ubuntu10")
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
index 5ec586f8588402f6711a78ce5678b29a12d9952a..4aba0caf9a4be9c0b890123138d8b35c65e0d7a7 100644 (file)
@@ -1,3 +1,29 @@
+apt (0.6.45ubuntu10) edgy; urgency=low
+
+  * methods/http.cc:
+    - check more careful for incorrect proxy settings (closes: #378868)
+  * methods/gzip.cc:
+    - don't hang when /var is full (closes: #341537), thanks to
+      Luis Rodrigo Gallardo Cruz for the patch
+  * doc/examples/sources.list:
+    - removed non-us.debian.org from the example (closes: #380030,#316196)
+  * Merged from Christian Perrier bzr branch:
+    * sk.po: Updated to 514t. Closes: #386851
+    * ja.po: Updated to 514t. Closes: #386537
+    * gl.po: Updated to 514t. Closes: #386397
+    * fr.po: Updated to 516t.
+    * fi.po: Updated to 512t. Closes: #382702
+  * share/archive-archive.gpg:
+    - removed the outdated amd64 and debian-2004 keys
+  * apt-pkg/tagfile.cc:
+    - applied patch from Jeroen van Wolffelaar to make the tags
+      caseinsensitive (closes: #384182)
+    - reverted MMap use in the tagfile because it does not work 
+      across pipes (closes: #383487) 
+  * added "installtask" command
+  
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 19 Sep 2006 15:07:51 +0200
+
 apt (0.6.45ubuntu9) edgy; urgency=low
 
   * cmdline/apt-get.cc:
index 809afc0fc0564bfcc76866e214e493fabf31757d..55ff332701b94105de7cc6207b4a4d59e3db7bd2 100644 (file)
@@ -111,6 +111,7 @@ bool GzipMethod::Fetch(FetchItem *Itm)
       if (To.Write(Buffer,Count) == false)
       {
         Failed = true;
+        FromGz.Close();
         break;
       }      
    }
index 545fe3e756c57b46f0fea3fd3891ef9ebfeb703a..63a87e6891f03ca5f5dcc9149ef4bcc9c547f1ad 100644 (file)
@@ -1,3 +1,36 @@
+2006-09-10  Peter Mann  <Peter.Mann@tuke.sk>
+
+       * sk.po: Updated to 514t. Closes: #386851
+
+2006-09-08   Christian Perrier  <bubulle@debian.org>
+
+       * LINGUAS: re-enabled Hebrew translation on translator's request.
+
+2006-09-08  Kenshi Muto  <kmuto@debian.org>
+
+       * ja.po: Updated to 514t. Closes: #386537
+
+2006-09-06  Jacobo Tarrio  <jtarrio@debian.org>
+
+       * gl.po: Updated to 514t. Closes: #386397
+
+2006-09-02  Christian Perrier  <bubulle@debian.org>
+
+       * fr.po: Updated to 516t.
+
+2006-09-02  Christian Perrier  <bubulle@debian.org>
+
+       * fr.po: Updated to 516t.
+
+2006-08-20  Christian Perrier  <bubulle@debian.org>
+
+       * Update all PO and the POT. Gives 512t3f1uf for formerly
+         complete translations
+
+2006-08-13  Tapio Lehtonen  <tale@debian.org>
+
+       * fi.po: Updated to 512t. Closes: #382702
+
 2006-07-19  Sunjae Park  <darehanl@gmail.com>
 
        * ko.po: Updated to 512t. Closes: #378901
index aec84e943945e11eb0dee442f401df6e8ff6c515..eaf179bd768964106c6f05e743ad70d4c14d0894 100644 (file)
@@ -1 +1 @@
-bg bs ca cs cy da de el en_GB es eu fi fr gl hu it ja ko nb nl nn pl pt pt_BR ro ru sk sl sv tl vi zh_CN zh_TW
+bg bs ca cs cy da de el en_GB es eu fi fr gl he hu it ja ko nb nl nn pl pt pt_BR ro ru sk sl sv tl vi zh_CN zh_TW