Bug#192373: apt-ftparchive: reports E: Unparsible control file
Package: apt-utils
Version: 0.5.5
Severity: normal
Tags: patch
Tracked down this problem to a changed return type of
pkgTagFile::pkgTagFile, but all usage of this function was
not updated.
Attached patch corrects all calls I found.
Peter
diff -ru apt-0.5.5.org/apt-inst/deb/debfile.cc apt-0.5.5/apt-inst/deb/debfile.cc
--- apt-0.5.5.org/apt-inst/deb/debfile.cc 2003-02-10 00:36:12 +0000
+++ apt-0.5.5/apt-inst/deb/debfile.cc 2003-05-07 23:23:44 +0000
@@ -239,7 +239,7 @@
Control[Length] = '\n';
Control[Length+1] = '\n';
- if (Section.Scan(Control,Length+2) == false)
+ if (Section.Scan(Control,Length+2) != pkgTagSection::ScanSuccess)
return _error->Error(_("Unparsible control file"));
return true;
}
@@ -257,7 +257,7 @@
Control[Length] = '\n';
Control[Length+1] = '\n';
- return Section.Scan(Control,Length+2);
+ return Section.Scan(Control,Length+2) == pkgTagSection::ScanSuccess;
}
/*}}}*/
diff -ru apt-0.5.5.org/cmdline/apt-cache.cc apt-0.5.5/cmdline/apt-cache.cc
--- apt-0.5.5.org/cmdline/apt-cache.cc 2003-04-27 02:47:44.000000000 +0000
+++ apt-0.5.5/cmdline/apt-cache.cc 2003-05-07 23:20:37.000000000 +0000
@@ -481,7 +481,7 @@
pkgTagSection Tags;
TFRewriteData RW[] = {{"Status",0},{"Config-Version",0},{}};
const char *Zero = 0;
- if (Tags.Scan(Buffer+Jitter,VF.Size+1) == false ||
+ if (Tags.Scan(Buffer+Jitter,VF.Size+1) != pkgTagSection::ScanSuccess ||
TFRewrite(stdout,Tags,&Zero,RW) == false)
{
_error->Error("Internal Error, Unable to parse a package record");
diff -ru apt-0.5.5.org/cmdline/apt-extracttemplates.cc apt-0.5.5/cmdline/apt-extracttemplates.cc
--- apt-0.5.5.org/cmdline/apt-extracttemplates.cc 2003-01-11 07:18:44.000000000 +0000
+++ apt-0.5.5/cmdline/apt-extracttemplates.cc 2003-05-07 23:19:30.000000000 +0000
@@ -172,7 +172,8 @@
if (Control == NULL) return false;
pkgTagSection Section;
- Section.Scan(Control, ControlLen);
+ if (Section.Scan(Control, ControlLen) != pkgTagSection::ScanSuccess)
+ return false;
Package = Section.FindS("Package");
Version = GetInstalledVer(Package);
diff -ru apt-0.5.5.org/cmdline/apt-sortpkgs.cc apt-0.5.5/cmdline/apt-sortpkgs.cc
--- apt-0.5.5.org/cmdline/apt-sortpkgs.cc 2003-01-11 07:18:44.000000000 +0000
+++ apt-0.5.5/cmdline/apt-sortpkgs.cc 2003-05-07 23:14:52.000000000 +0000
@@ -116,7 +116,7 @@
}
Buffer[I->Length] = '\n';
- if (Section.Scan((char *)Buffer,I->Length+1) == false)
+ if (Section.Scan((char *)Buffer,I->Length+1) != pkgTagSection::ScanSuccess)
{
delete [] Buffer;
return _error->Error("Internal error, failed to scan buffer");
diff -ru apt-0.5.5.org/ftparchive/writer.cc apt-0.5.5/ftparchive/writer.cc
--- apt-0.5.5.org/ftparchive/writer.cc 2003-02-10 07:34:41.000000000 +0000
+++ apt-0.5.5/ftparchive/writer.cc 2003-05-07 23:25:17.000000000 +0000
@@ -525,7 +525,7 @@
do
{
unsigned Pos;
- if (Tags.Scan(Start,BlkEnd - Start) == false)
+ if (Tags.Scan(Start,BlkEnd - Start) != pkgTagSection::ScanSuccess)
return _error->Error("Could not find a record in the DSC '%s'",FileName.c_str());
if (Tags.Find("Source",Pos) == true)
break;
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux debian 2.5.66-i4k #7 Sat Apr 19 17:40:57 CEST 2003 i686
Locale: LANG=sv_SE.ISO-8859-1, LC_CTYPE=sv_SE.ISO-8859-1
Versions of packages apt-utils depends on:
ii apt [libapt-pkg-libc6.3-5-3. 0.5.5 Advanced front-end for dpkg
ii libc6 2.3.1-17 GNU C Library: Shared libraries an
ii libdb2 2:2.7.7.0-8 The Berkeley database routines (ru
ii libgcc1 1:3.3-0pre7 GCC support library
ii libstdc++5 1:3.3-0pre7 The GNU Standard C++ Library v3
-- no debconf information
Reply to: