]> git.saurik.com Git - apt.git/commitdiff
* cmdline/apt-key:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 6 Oct 2011 14:13:26 +0000 (16:13 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 6 Oct 2011 14:13:26 +0000 (16:13 +0200)
  - fix apt-key net-update, thanks to Marc Deslauriers and
    Adam Conrad for the code review (LP: #857472)

apt-pkg/deb/deblistparser.cc
debian/apt.cron.daily
debian/changelog

index 952433428ef5c0ce0d83785e5edf949ec21767e6..08c24204b75c42331d943ce0b3fd61c78df3e62c 100644 (file)
@@ -816,16 +816,16 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
       ++lineEnd;
 
       // which datastorage need to be updated
-      map_ptrloc* writeTo = NULL;
+      enum { Suite, Component, Version, Origin, Codename, Label, None } writeTo = None;
       if (buffer[0] == ' ')
         ;
-      #define APT_PARSER_WRITETO(X, Y) else if (strncmp(Y, buffer, len) == 0) writeTo = &X;
-      APT_PARSER_WRITETO(FileI->Archive, "Suite")
-      APT_PARSER_WRITETO(FileI->Component, "Component")
-      APT_PARSER_WRITETO(FileI->Version, "Version")
-      APT_PARSER_WRITETO(FileI->Origin, "Origin")
-      APT_PARSER_WRITETO(FileI->Codename, "Codename")
-      APT_PARSER_WRITETO(FileI->Label, "Label")
+      #define APT_PARSER_WRITETO(X) else if (strncmp(#X, buffer, len) == 0) writeTo = X;
+      APT_PARSER_WRITETO(Suite)
+      APT_PARSER_WRITETO(Component)
+      APT_PARSER_WRITETO(Version)
+      APT_PARSER_WRITETO(Origin)
+      APT_PARSER_WRITETO(Codename)
+      APT_PARSER_WRITETO(Label)
       #undef APT_PARSER_WRITETO
       #define APT_PARSER_FLAGIT(X) else if (strncmp(#X, buffer, len) == 0) \
         pkgTagSection::FindFlag(FileI->Flags, pkgCache::Flag:: X, dataStart, lineEnd);
@@ -835,19 +835,19 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
 
       // load all data from the line and save it
       string data;
-      if (writeTo != NULL)
+      if (writeTo != None)
         data.append(dataStart, dataEnd);
       if (sizeof(buffer) - 1 == (dataEnd - buffer))
       {
         while (fgets(buffer, sizeof(buffer), release) != NULL)
         {
-           if (writeTo != NULL)
+           if (writeTo != None)
               data.append(buffer);
            if (strlen(buffer) != sizeof(buffer) - 1)
               break;
         }
       }
-      if (writeTo != NULL)
+      if (writeTo != None)
       {
         // remove spaces and stuff from the end of the data line
         for (std::string::reverse_iterator s = data.rbegin();
@@ -857,7 +857,15 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
               break;
            *s = '\0';
         }
-        *writeTo = WriteUniqString(data);
+        switch (writeTo) {
+        case Suite: FileI->Archive = WriteUniqString(data); break;
+        case Component: FileI->Component = WriteUniqString(data); break;
+        case Version: FileI->Version = WriteUniqString(data); break;
+        case Origin: FileI->Origin = WriteUniqString(data); break;
+        case Codename: FileI->Codename = WriteUniqString(data); break;
+        case Label: FileI->Label = WriteUniqString(data); break;
+        case None: break;
+        }
       }
    }
    fclose(release);
index 1dfaa04a3fd135dfe809dd93d29af7914b486d7d..efc61362cf3a2745dad275424b6792d175562745 100644 (file)
@@ -457,7 +457,10 @@ if check_stamp $UPDATE_STAMP $UpdateInterval; then
         # now run apt-xapian-index if it is installed to ensure the index
         # is up-to-date
         if [ -x /usr/sbin/update-apt-xapian-index ]; then
-            nice ionice -c3 update-apt-xapian-index -q
+            if [ "$(dpkg --print-architecture)" = "armel" ]; then
+                xapian_extra_args='-u'
+            fi
+            nice ionice -c3 update-apt-xapian-index -q $xapian_extra_args
         fi
     else
        debug_echo "download updated metadata (error)"
index 88b614ca141f3a7b794c0764917e4e67fd48bcbd..a0f59e019b7d065160183a574b212bc756098326 100644 (file)
@@ -1,3 +1,26 @@
+apt (0.8.16~exp5ubuntu13) UNRELEASEDoneiric; urgency=low
+
+  [ Adam Conrad ]
+  * On armel, call update-apt-xapian-index with '-u' to keep the CPU
+    and I/O usage low.  We would do this on all arches, but there's a
+    regression risk here, but that's better than killing slow systems.
+  
+  [ Michael Vogt ]
+  * cmdline/apt-key:
+    - fix apt-key net-update, thanks to Marc Deslauriers and 
+      Adam Conrad for the code review (LP: #857472)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 06 Oct 2011 16:13:00 +0200
+
+apt (0.8.16~exp5ubuntu12) oneiric; urgency=low
+
+  [ David Kalnischkies ]  
+  * apt-pkg/deb/deblistparser.cc:
+    - fix crash when the dynamic mmap needs to be remapped during
+      LoadReleaseInfo (LP: #854090)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 26 Sep 2011 13:31:11 +0200
+
 apt (0.8.16~exp5ubuntu11) oneiric; urgency=low
 
   [ Colin Watson ]