[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#728572: python-apt: string to float conversion exception



Maybe these patches will help fixing the issue. At least to me it looks like the cause of the problem.
From 03482179d0a91cf3f23fa777874a5e45344a4486 Mon Sep 17 00:00:00 2001
From: Pauli Nieminen <suokkos@gmail.com>
Date: Fri, 8 Nov 2013 08:11:26 +0200
Subject: [PATCH] Avoid sending package name with arch to status FD

Sending arch with package name to status fd makes other side parse the
string incorrectly because expectation is to do simple string split with
colon. But of course there would be an extra colon in the string.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
---
 apt-pkg/deb/dpkgpm.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index fe38bf6..f2dc296 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -583,7 +583,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(int OutStatusFd, char *line)
    if(strncmp(list[0].c_str(), "processing", strlen("processing")) == 0)
    {
       char s[200];
-      const char* const pkg_or_trigger = list[2].c_str();
+      const char* const pkg_or_trigger = StringSplit(list[2], ":")[0].c_str();
       action =  list[1].c_str();
       const std::pair<const char *, const char *> * const iter =
 	std::find_if(PackageProcessingOpsBegin,
-- 
1.8.4.2

From b1b7ece6ca12c1eea14e9a6dc69ec138f6298c9e Mon Sep 17 00:00:00 2001
From: Pauli Nieminen <suokkos@gmail.com>
Date: Fri, 8 Nov 2013 08:11:26 +0200
Subject: [PATCH] Avoid sending package name with arch to status FD

Sending arch with package name to status fd makes other side parse the
string incorrectly because expectation is to do simple string split with
colon. But of course there would be an extra colon in the string.

Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
---
 apt-pkg/deb/dpkgpm.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index 26d79db..92b85b6 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -664,7 +664,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line)
       }
       std::string msg;
       strprintf(msg, _(iter->second), i18n_pkgname.c_str());
-      d->progress->StatusChanged(pkgname, PackagesDone, PackagesTotal, msg);
+      d->progress->StatusChanged(short_pkgname, PackagesDone, PackagesTotal, msg);
 
       // FIXME: this needs a muliarch testcase
       // FIXME2: is "pkgname" here reliable with dpkg only sending us 
@@ -693,7 +693,7 @@ void pkgDPkgPM::ProcessDpkgStatusLine(char *line)
          PackagesDone++;
 
          strprintf(msg, translation, i18n_pkgname.c_str());
-         d->progress->StatusChanged(pkgname, PackagesDone, PackagesTotal, msg);
+         d->progress->StatusChanged(short_pkgname, PackagesDone, PackagesTotal, msg);
          
       }
       if (Debug == true) 
-- 
1.8.4.2


Reply to: