summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.progress-reporting13
-rw-r--r--apt-pkg/contrib/configuration.cc5
-rw-r--r--apt-pkg/deb/dpkgpm.cc81
-rw-r--r--apt-pkg/init.h2
-rw-r--r--apt-pkg/makefile2
-rw-r--r--configure.in2
-rw-r--r--debian/apt-doc.docs1
-rw-r--r--debian/changelog20
-rw-r--r--methods/makefile2
9 files changed, 95 insertions, 33 deletions
diff --git a/README.progress-reporting b/README.progress-reporting
index 7ae514929..73fbd8c08 100644
--- a/README.progress-reporting
+++ b/README.progress-reporting
@@ -34,6 +34,19 @@ pmstatus:3dchess:60:Preparing to configure 3dchess
pmstatus:3dchess:80:Configuring 3dchess
pmstatus:3dchess:100:Installed 3dchess
+pmerror
+-------
+pmerror:deb:TotalPercentage:error string
+
+Example:
+pmerror: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : 75% : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data
+
+
+pmconffile
+----------
+pmconffile:conffile:percent:'current-conffile' 'new-conffile' useredited distedited
+
+
dlstatus
--------
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 4b2c0fbb5..09e454be9 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -374,10 +374,9 @@ void Configuration::Clear(string Name, string Value)
void Configuration::Clear(string Name)
{
Item *Top = Lookup(Name.c_str(),false);
- if (Top == 0) {
- cout << "config item: " << Name << " not found" << endl;
+ if (Top == 0)
return;
- }
+
Top->Value = string();
Item *Stop = Top;
Top = Top->Child;
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 2e85fc14e..fe8fbca74 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -357,27 +357,27 @@ bool pkgDPkgPM::Go(int OutStatusFd)
{
{"half-installed", _("Preparing %s")},
{"unpacked", _("Unpacking %s") },
- NULL
+ {NULL, NULL}
},
// Configure operation
{
{"unpacked",_("Preparing to configure %s") },
{"half-configured", _("Configuring %s") },
{ "installed", _("Installed %s")},
- NULL
+ {NULL, NULL}
},
// Remove operation
{
{"half-configured", _("Preparing for removal of %s")},
{"half-installed", _("Removing %s")},
{"config-files", _("Removed %s")},
- NULL
+ {NULL, NULL}
},
// Purge operation
{
{"config-files", _("Preparing for remove with config %s")},
{"not-installed", _("Removed with config %s")},
- NULL
+ {NULL, NULL}
},
};
@@ -612,32 +612,65 @@ bool pkgDPkgPM::Go(int OutStatusFd)
if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
std::clog << "got from dpkg '" << line << "'" << std::endl;
- // pass "error" and "conffile-prompt" messages from dpkg verbatim
- if((strncmp(line,"error",strlen("error")) == 0) ||
- (strncmp(line,"conffile-prompt",strlen("conffile-prompt")) == 0))
- {
- write(OutStatusFd, line, strlen(line));
- line[0]=0;
- continue;
- }
- // line contains the dpkg status info now. it has the form:
- // 'status: <pkg>: <pkg qstate>' (see dpkg(1) for details)
- char* list[5];
+ // the status we output
+ ostringstream status;
+
+ /* dpkg sends strings like this:
+ 'status: <pkg>: <pkg qstate>'
+ errors look like this:
+ 'status: /var/cache/apt/archives/krecipes_0.8.1-0ubuntu1_i386.deb : error : trying to overwrite `/usr/share/doc/kde/HTML/en/krecipes/krectip.png', which is also in package krecipes-data
+ and conffile-prompt like this
+ 'status: conffile-prompt: conffile : 'current-conffile' 'new-conffile' useredited distedited
+
+ */
+ char* list[4];
TokSplitString(':', line, list, 5);
char *pkg = list[1];
- char *action = list[2];
+ char *action = _strstrip(list[2]);
+
+ if(strncmp(action,"error",strlen("error")) == 0)
+ {
+ status << "pmerror:" << list[1]
+ << ":" << (Done/float(Total)*100.0)
+ << ":" << list[3]
+ << endl;
+ if(OutStatusFd > 0)
+ write(OutStatusFd, status.str().c_str(), status.str().size());
+ line[0]=0;
+ if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+ std::clog << "send: '" << status.str() << "'" << endl;
+ continue;
+ }
+ if(strncmp(action,"conffile",strlen("conffile")) == 0)
+ {
+ status << "pmconffile:" << list[1]
+ << ":" << (Done/float(Total)*100.0)
+ << ":" << list[3]
+ << endl;
+ if(OutStatusFd > 0)
+ write(OutStatusFd, status.str().c_str(), status.str().size());
+ line[0]=0;
+ if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
+ std::clog << "send: '" << status.str() << "'" << endl;
+ continue;
+ }
+
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
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
PackageOpsDone[pkg]++;
Done++;
- ostringstream status;
// build the status str
status << "pmstatus:" << pkg
<< ":" << (Done/float(Total)*100.0)
@@ -646,11 +679,7 @@ bool pkgDPkgPM::Go(int OutStatusFd)
if(OutStatusFd > 0)
write(OutStatusFd, status.str().c_str(), status.str().size());
if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
- {
- std::clog << "send to fd: '" << status.str()
- << "'" << std::endl;
-
- }
+ std::clog << "send: '" << status.str() << "'" << endl;
}
if (_config->FindB("Debug::pkgDPkgProgressReporting",false) == true)
diff --git a/apt-pkg/init.h b/apt-pkg/init.h
index 74ac3a7ca..e21351797 100644
--- a/apt-pkg/init.h
+++ b/apt-pkg/init.h
@@ -18,7 +18,7 @@
// See the makefile
#define APT_PKG_MAJOR 3
-#define APT_PKG_MINOR 5
+#define APT_PKG_MINOR 10
#define APT_PKG_RELEASE 0
extern const char *pkgVersion;
diff --git a/apt-pkg/makefile b/apt-pkg/makefile
index 5f48f0f52..8de7d945e 100644
--- a/apt-pkg/makefile
+++ b/apt-pkg/makefile
@@ -13,7 +13,7 @@ include ../buildlib/defaults.mak
# methods/makefile - FIXME
LIBRARY=apt-pkg
LIBEXT=$(GLIBC_VER)$(LIBSTDCPP_VER)
-MAJOR=3.9
+MAJOR=3.10
MINOR=0
SLIBS=$(PTHREADLIB) $(INTLLIBS)
APT_DOMAIN:=libapt-pkg$(MAJOR)
diff --git a/configure.in b/configure.in
index 7e3aba331..1ee7e168b 100644
--- a/configure.in
+++ b/configure.in
@@ -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.40")
+AC_DEFINE_UNQUOTED(VERSION,"0.6.40.2")
PACKAGE="apt"
AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
AC_SUBST(PACKAGE)
diff --git a/debian/apt-doc.docs b/debian/apt-doc.docs
new file mode 100644
index 000000000..a7507f4e7
--- /dev/null
+++ b/debian/apt-doc.docs
@@ -0,0 +1 @@
+README.progress-reporting \ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index a01e1491b..2b4e81595 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,23 @@
+apt (0.6.40.2) unstable; urgency=low
+
+ * improved the support for "error" and "conffile" reporting from
+ dpkg, added the format to README.progress-reporting
+ * added README.progress-reporting to the apt-doc package
+ * improved the network timeout handling, if a index file from a
+ sources.list times out, don't try to get the other files from
+ that entry
+
+ --
+
+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 :/
+
+ -- Michael Vogt <mvo@debian.org> Fri, 5 Aug 2005 13:24:58 +0200
+
apt (0.6.40) unstable; urgency=low
* Patch from Jordi Mallach to mark some additional strings for translation
diff --git a/methods/makefile b/methods/makefile
index 089300570..06fd2a6fc 100644
--- a/methods/makefile
+++ b/methods/makefile
@@ -7,7 +7,7 @@ include ../buildlib/defaults.mak
BIN := $(BIN)/methods
# FIXME..
-LIB_APT_PKG_MAJOR = 3.5
+LIB_APT_PKG_MAJOR = 3.10
APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR)
# The file method