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

* merged the fixes from apt--progress-reporting

Patches applied:

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-23
   * remvoed a debug string

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-24
   * soname changed, fixed a bug in the parsing code when dpkg send the same state more than once (at the end)

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-25
   * merged with apt@packages.debian.org/apt--main--0, added changelog entry for the 0.6.40.1 upload

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-26
   * fix a bug when out-of-order states are send from dpkg 

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-27
   * changelog update

 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-28
   * a real changelog entry now
Michael Vogt лет назад: 21
Родитель
Сommit
dfa11ecc05
6 измененных файлов с 27 добавлено и 14 удалено
  1. 2 3
      apt-pkg/contrib/configuration.cc
  2. 13 8
      apt-pkg/deb/dpkgpm.cc
  3. 1 1
      apt-pkg/init.h
  4. 1 1
      apt-pkg/makefile
  5. 9 0
      debian/changelog
  6. 1 1
      methods/makefile

+ 2 - 3
apt-pkg/contrib/configuration.cc

@@ -374,10 +374,9 @@ void Configuration::Clear(string Name, string Value)
 void Configuration::Clear(string Name)
 void Configuration::Clear(string Name)
 {
 {
    Item *Top = Lookup(Name.c_str(),false);
    Item *Top = Lookup(Name.c_str(),false);
-   if (Top == 0) {
-      cout << "config item: " << Name << " not found" << endl;
+   if (Top == 0) 
       return;
       return;
-   }
+
    Top->Value = string();
    Top->Value = string();
    Item *Stop = Top;
    Item *Stop = Top;
    Top = Top->Child;
    Top = Top->Child;

+ 13 - 8
apt-pkg/deb/dpkgpm.cc

@@ -357,27 +357,27 @@ bool pkgDPkgPM::Go(int OutStatusFd)
       { 
       { 
 	 {"half-installed", _("Preparing %s")}, 
 	 {"half-installed", _("Preparing %s")}, 
 	 {"unpacked", _("Unpacking %s") }, 
 	 {"unpacked", _("Unpacking %s") }, 
-	 NULL
+	 {NULL, NULL}
       },
       },
       // Configure operation
       // Configure operation
       { 
       { 
 	 {"unpacked",_("Preparing to configure %s") },
 	 {"unpacked",_("Preparing to configure %s") },
 	 {"half-configured", _("Configuring %s") },
 	 {"half-configured", _("Configuring %s") },
 	 { "installed", _("Installed %s")},
 	 { "installed", _("Installed %s")},
-	  NULL
+	 {NULL, NULL}
       },
       },
       // Remove operation
       // Remove operation
       { 
       { 
 	 {"half-configured", _("Preparing for removal of %s")},
 	 {"half-configured", _("Preparing for removal of %s")},
 	 {"half-installed", _("Removing %s")},
 	 {"half-installed", _("Removing %s")},
 	 {"config-files",  _("Removed %s")},
 	 {"config-files",  _("Removed %s")},
-	  NULL
+	 {NULL, NULL}
       },
       },
       // Purge operation
       // Purge operation
       { 
       { 
 	 {"config-files", _("Preparing for remove with config %s")},
 	 {"config-files", _("Preparing for remove with config %s")},
 	 {"not-installed", _("Removed with config %s")},
 	 {"not-installed", _("Removed with config %s")},
-	 NULL 
+	 {NULL, NULL}
       },
       },
    };
    };
 
 
@@ -627,13 +627,18 @@ bool pkgDPkgPM::Go(int OutStatusFd)
 	 char *pkg = list[1];
 	 char *pkg = list[1];
 	 char *action = list[2];
 	 char *action = list[2];
 	 vector<struct DpkgState> &states = PackageOps[pkg];
 	 vector<struct DpkgState> &states = PackageOps[pkg];
-	 const char *next_action = states[PackageOpsDone[pkg]].state;
-	 const char *translation = states[PackageOpsDone[pkg]].str;
-	 char s[200];
-	 snprintf(s, sizeof(s), translation, pkg);
+	 const char *next_action = NULL;
+	 if(PackageOpsDone[pkg] < states.size())
+	    next_action = states[PackageOpsDone[pkg]].state;
 	 // check if the package moved to the next dpkg state
 	 // check if the package moved to the next dpkg state
 	 if(next_action && (strcmp(action, next_action) == 0)) 
 	 if(next_action && (strcmp(action, next_action) == 0)) 
 	 {
 	 {
+	    // only read the translation if there is actually a next
+	    // action
+	    const char *translation = states[PackageOpsDone[pkg]].str;
+	    char s[200];
+	    snprintf(s, sizeof(s), translation, pkg);
+
 	    // we moved from one dpkg state to a new one, report that
 	    // we moved from one dpkg state to a new one, report that
 	    PackageOpsDone[pkg]++;
 	    PackageOpsDone[pkg]++;
 	    Done++;
 	    Done++;

+ 1 - 1
apt-pkg/init.h

@@ -18,7 +18,7 @@
 
 
 // See the makefile
 // See the makefile
 #define APT_PKG_MAJOR 3
 #define APT_PKG_MAJOR 3
-#define APT_PKG_MINOR 5
+#define APT_PKG_MINOR 10
 #define APT_PKG_RELEASE 0
 #define APT_PKG_RELEASE 0
     
     
 extern const char *pkgVersion;
 extern const char *pkgVersion;

+ 1 - 1
apt-pkg/makefile

@@ -13,7 +13,7 @@ include ../buildlib/defaults.mak
 # methods/makefile - FIXME
 # methods/makefile - FIXME
 LIBRARY=apt-pkg
 LIBRARY=apt-pkg
 LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
 LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.9
+MAJOR=3.10
 MINOR=0
 MINOR=0
 SLIBS=$(PTHREADLIB) $(INTLLIBS)
 SLIBS=$(PTHREADLIB) $(INTLLIBS)
 APT_DOMAIN:=libapt-pkg$(MAJOR)
 APT_DOMAIN:=libapt-pkg$(MAJOR)

+ 9 - 0
debian/changelog

@@ -1,3 +1,12 @@
+apt (0.6.40.1) unstable; urgency=low
+
+  * bugfix in the parsing code for the apt<->dpkg communication. apt 
+    crashed when dpkg sends the same state more than once under certain
+    conditions
+  * 0.6.40 breaks the ABI but I accidentally didn't change the soname :/
+
+ --
+
 apt (0.6.40) unstable; urgency=low
 apt (0.6.40) unstable; urgency=low
 
 
   * Patch from Jordi Mallach to mark some additional strings for translation
   * Patch from Jordi Mallach to mark some additional strings for translation

+ 1 - 1
methods/makefile

@@ -7,7 +7,7 @@ include ../buildlib/defaults.mak
 BIN := $(BIN)/methods
 BIN := $(BIN)/methods
 
 
 # FIXME..
 # FIXME..
-LIB_APT_PKG_MAJOR = 3.5
+LIB_APT_PKG_MAJOR = 3.10
 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
 
 
 # The file method
 # The file method