From 0cfcf669ccbc5b6030077f300ba9ba3fdc084ac3 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Jan 04 2008 08:32:46 +0000 Subject: - fix build with gcc 4.3 --- diff --git a/apt-0.5.15lorg3.93-gcc43.patch b/apt-0.5.15lorg3.93-gcc43.patch new file mode 100644 index 0000000..0a9f6a0 --- /dev/null +++ b/apt-0.5.15lorg3.93-gcc43.patch @@ -0,0 +1,308 @@ +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmmisc.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmmisc.h +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmmisc.h.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmmisc.h 2008-01-04 10:12:07.000000000 +0200 +@@ -3,6 +3,8 @@ + + #include + ++#include ++ + #ifdef APT_WITH_GNU_HASH_MAP + + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmpm.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmpm.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmpm.cc.gcc43 2007-07-11 10:28:26.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmpm.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + + #if RPM_VERSION >= 0x040100 + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmrecords.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmrecords.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmrecords.cc.gcc43 2007-07-09 10:03:30.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmrecords.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -25,6 +25,8 @@ + + #include + ++#include ++ + using namespace std; + + // RecordParser::rpmRecordParser - Constructor /*{{{*/ +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.cc.gcc43 2007-08-17 13:49:37.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -1434,7 +1435,7 @@ bool RPMRepomdReaderHandler::Skip() + return true; + } + +-string RPMRepomdReaderHandler::FindTag(char *Tag) ++string RPMRepomdReaderHandler::FindTag(const char *Tag) + { + string str = ""; + if (NodeP) { +@@ -1447,7 +1448,7 @@ string RPMRepomdReaderHandler::FindTag(c + return str; + } + +-string RPMRepomdReaderHandler::FindVerTag(char *Tag) ++string RPMRepomdReaderHandler::FindVerTag(const char *Tag) + { + string str = ""; + for (xmlNode *n = NodeP->children; n; n = n->next) { +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmcallback.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmcallback.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmcallback.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmcallback.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -9,7 +9,7 @@ + #include + using namespace std; + +-static char *copyTags[] = {"name", ++static const char *copyTags[] = {"name", + "version", + "release", + "arch", +@@ -18,7 +18,7 @@ static char *copyTags[] = {"name", + + static void getPackageData(const Header h, map &Data) + { +- char **Tag = ©Tags[0]; ++ const char **Tag = ©Tags[0]; + char rTag[20]; + Data.clear(); + for (Tag = ©Tags[0]; *Tag != NULL; *Tag++) { +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/repomd.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/repomd.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/repomd.cc.gcc43 2007-07-09 10:03:30.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/repomd.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -19,6 +19,8 @@ + #ifdef APT_WITH_REPOMD + + #include ++#include ++ + #include + #include + #include +@@ -27,6 +29,7 @@ + + #include + ++ + using namespace std; + + // Parse repomd.xml file for checksums +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmsystem.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmsystem.cc +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmsystem.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmsystem.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -31,6 +31,7 @@ + + #include + ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.h +--- apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.h.gcc43 2007-07-09 10:03:30.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/rpm/rpmhandler.h 2008-01-04 10:12:07.000000000 +0200 +@@ -24,6 +24,9 @@ + #include + #include + ++#include ++#include ++ + #include + + // Our Extra RPM tags. These should not be accessed directly. Use +@@ -328,8 +331,8 @@ class RPMRepomdReaderHandler : public RP + string XmlPath; + xmlNode *NodeP; + +- string FindTag(char *Tag); +- string FindVerTag(char *Tag); ++ string FindTag(const char *Tag); ++ string FindVerTag(const char *Tag); + + public: + virtual bool Skip(); +diff -up apt-0.5.15lorg3.93/apt-pkg/indexfile.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/indexfile.cc +--- apt-0.5.15lorg3.93/apt-pkg/indexfile.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/indexfile.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -15,6 +15,7 @@ + #include + #include + /*}}}*/ ++#include + + // Global list of Item supported + static pkgIndexFile::Type *ItmList[10]; +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/fileutl.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/fileutl.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/fileutl.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/fileutl.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -22,6 +22,7 @@ + #include + + #include ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/progress.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/progress.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/progress.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/progress.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -17,6 +17,7 @@ + + #include + ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/sqlite.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/sqlite.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/sqlite.cc.gcc43 2007-07-09 10:03:30.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/sqlite.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -9,6 +9,8 @@ + #include + #include + ++#include ++ + // debug stuff.. + #include + using namespace std; +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/strutl.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/strutl.h +--- apt-0.5.15lorg3.93/apt-pkg/contrib/strutl.h.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/strutl.h 2008-01-04 10:12:07.000000000 +0200 +@@ -21,6 +21,7 @@ + #endif + + #include ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/error.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/error.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/error.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/error.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/md5.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/md5.h +--- apt-0.5.15lorg3.93/apt-pkg/contrib/md5.h.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/md5.h 2008-01-04 10:12:07.000000000 +0200 +@@ -28,6 +28,7 @@ + #endif + + #include ++#include + + using std::string; + +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/sha1.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/sha1.h +--- apt-0.5.15lorg3.93/apt-pkg/contrib/sha1.h.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/sha1.h 2008-01-04 10:12:07.000000000 +0200 +@@ -18,6 +18,7 @@ + #pragma interface "apt-pkg/sha1.h" + #endif + ++#include + #include + + using std::string; +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/cmndline.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/cmndline.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/cmndline.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/cmndline.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -19,6 +19,8 @@ + #include + + #include ++ ++#include + /*}}}*/ + using namespace std; + +diff -up apt-0.5.15lorg3.93/apt-pkg/contrib/mmap.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/contrib/mmap.cc +--- apt-0.5.15lorg3.93/apt-pkg/contrib/mmap.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/contrib/mmap.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -30,6 +30,7 @@ + + #include + ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/pkgsystem.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/pkgsystem.cc +--- apt-0.5.15lorg3.93/apt-pkg/pkgsystem.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/pkgsystem.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -17,6 +17,7 @@ + #include + #include + /*}}}*/ ++#include + + pkgSystem *_system = 0; + static pkgSystem *SysList[10]; +diff -up apt-0.5.15lorg3.93/apt-pkg/algorithms.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/algorithms.cc +--- apt-0.5.15lorg3.93/apt-pkg/algorithms.cc.gcc43 2008-01-04 10:12:07.000000000 +0200 ++++ apt-0.5.15lorg3.93/apt-pkg/algorithms.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -29,6 +29,7 @@ + #include + + #include ++#include + /*}}}*/ + using namespace std; + +diff -up apt-0.5.15lorg3.93/apt-pkg/clean.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/clean.cc +--- apt-0.5.15lorg3.93/apt-pkg/clean.cc.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/clean.cc 2008-01-04 10:12:07.000000000 +0200 +@@ -19,6 +19,7 @@ + + #include + ++#include + #include + #include + #include +diff -up apt-0.5.15lorg3.93/apt-pkg/pkgcachegen.h.gcc43 apt-0.5.15lorg3.93/apt-pkg/pkgcachegen.h +--- apt-0.5.15lorg3.93/apt-pkg/pkgcachegen.h.gcc43 2007-05-14 12:01:55.000000000 +0300 ++++ apt-0.5.15lorg3.93/apt-pkg/pkgcachegen.h 2008-01-04 10:12:07.000000000 +0200 +@@ -59,7 +59,7 @@ class pkgCacheGenerator + public: + + // CNC:2003-02-27 - We need this in rpmListParser. +- bool NewPackage(pkgCache::PkgIterator &Pkg,string Pkg); ++ bool NewPackage(pkgCache::PkgIterator &Pkg,string Name); + + unsigned long WriteUniqString(const char *S,unsigned int Size); + inline unsigned long WriteUniqString(string S) {return WriteUniqString(S.c_str(),S.length());}; +diff -up apt-0.5.15lorg3.93/apt-pkg/init.cc.gcc43 apt-0.5.15lorg3.93/apt-pkg/init.cc +--- apt-0.5.15lorg3.93/apt-pkg/init.cc.gcc43 2008-01-04 10:19:47.000000000 +0200 ++++ apt-0.5.15lorg3.93/apt-pkg/init.cc 2008-01-04 10:19:56.000000000 +0200 +@@ -13,6 +13,7 @@ + #include + + #include ++#include + #include + #include + #include diff --git a/apt.spec b/apt.spec index 8503605..e807d9c 100644 --- a/apt.spec +++ b/apt.spec @@ -6,7 +6,7 @@ Summary: Debian's Advanced Packaging Tool with RPM support Name: apt Version: 0.5.15lorg3.93 -Release: 4%{?dist} +Release: 5%{?dist} Group: System Environment/Base URL: http://apt-rpm.org/ # SourceLicense: GPLv2+ except lua/ which is MIT @@ -40,6 +40,8 @@ Patch1: apt-0.5.15lorg3.x-cache-corruption.patch Patch2: apt-0.5.15lorg3.93-multilib-obsoletes-hack.patch # avoid assertion failure when repomd.xml doesn't exist Patch3: apt-0.5.15lorg3.93-repomd-assert.patch +# assorted correctness fixes to make gcc 4.3 happier +Patch4: apt-0.5.15lorg3.93-gcc43.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -126,6 +128,7 @@ RHL/RHEL/FC distributions. %patch1 -p0 -b .mmap %patch2 -p1 -b .obsoletes-hack %patch3 -p1 -b .repomd-assert +%patch4 -p1 -b .gcc43 install -pm 644 %{SOURCE19} comps2prio.xsl @@ -291,6 +294,9 @@ fi %changelog +* Fri Jan 04 2008 Panu Matilainen 0.5.15lorg3.93-5 +- fix build with gcc 4.3 + * Mon Nov 19 2007 Panu Matilainen 0.5.15lorg3.93-4 - Fix assert failure when repomd.xml isn't available locally (#389361)