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

Re: phoebe and apt



On Sun, Jan 26, 2003 at 07:54:30PM -0800, Kevin Bowen wrote:
> I just upgraded to phoebe from 8.0, and apt-rpm no longer fucntions -
> apparently because the rpm util has been updated (4.2), and apt-rpm is
> expecting 4.1. Does anyone know of a workaround to this, or if a new
> version of apt-rpm exists anywhere that works with the new rpm util?

Yeah. There was a patch by Gary Peck posted to several of the relevant lists
-- you need to apply that, and then run autoconf before configure. 



--- apt-0.5.4cnc9/apt-pkg/rpm/rpmlistparser.cc.rpm42	2002-08-05 07:55:56.000000000 -0700
+++ apt-0.5.4cnc9/apt-pkg/rpm/rpmlistparser.cc	2002-12-28 03:02:09.000000000 -0800
@@ -32,6 +32,9 @@
 #ifdef HAVE_RPM41
 #include <rpm/rpmds.h>
 #endif
+#ifdef HAVE_RPM42
+#include <rpm/rpmfi.h>
+#endif
 
 // ListParser::rpmListParser - Constructor				/*{{{*/
 // ---------------------------------------------------------------------
@@ -532,19 +535,38 @@
 bool rpmListParser::CollectFileProvides(pkgCache &Cache,
 					pkgCache::VerIterator Ver)
 {
+   const char *name;
+#ifdef HAVE_RPM42
+   rpmfi fi;
+   fi = rpmfiNew(NULL, header, RPMTAG_BASENAMES, 0);
+   fi = rpmfiInit(fi, 0);
+   while (rpmfiNext(fi) >= 0) 
+   {
+      name = rpmfiFN(fi);
+#else
    const char **names = NULL;
    int count = 0;
    rpmBuildFileList(header, &names, &count);
    while (count--) 
    {
-      pkgCache::PkgIterator Pkg = Cache.FindPkg(names[count]);
+      name = names[count];
+#endif
+      pkgCache::PkgIterator Pkg = Cache.FindPkg(name);
       if (Pkg.end() == false)
       {
-	 if (!NewProvides(Ver, string(names[count]), string()))
+	 if (!NewProvides(Ver, string(name), string()))
+	 {
+#ifdef HAVE_RPM42
+             fi = rpmfiFree(fi);
+#endif
 	     return false;
+	 }
       }
    }
 
+#ifdef HAVE_RPM42
+   fi = rpmfiFree(fi);
+#endif
    return true;
 }
 
--- apt-0.5.4cnc9/buildlib/config.h.in.rpm42	2002-12-28 02:47:21.000000000 -0800
+++ apt-0.5.4cnc9/buildlib/config.h.in	2002-12-28 02:47:51.000000000 -0800
@@ -45,6 +45,7 @@
 #undef HAVE_RPM
 #undef HAVE_RPM4
 #undef HAVE_RPM41
+#undef HAVE_RPM42
 #undef HAVE_SETLOCALE
 #undef HAVE_LOCALE_H
 #undef HAVE_LIBINTL_H
--- apt-0.5.4cnc9/configure.in.rpm42	2002-12-28 03:00:21.000000000 -0800
+++ apt-0.5.4cnc9/configure.in	2002-12-28 02:59:12.000000000 -0800
@@ -94,7 +94,11 @@
          SAVE_CPPFLAGS="$SAVE_CPPFLAGS -I/usr/include/rpm"
          AC_CHECK_LIB(rpm, rpmtsUpdateDSI,
 		      [AC_DEFINE_UNQUOTED(HAVE_RPM41, 1)
-		       rpm_version="4.1"],
+		       AC_CHECK_LIB(rpm, rpmBuildFileList,
+				    [rpm_version="4.1"],
+				    [AC_DEFINE_UNQUOTED(HAVE_RPM42, 1)
+                                     rpm_version="4.2"])
+		      ],
 		      [rpm_version="4.0.X"])
 	])
 


-- 
Matthew Miller           mattdm mattdm org        <http://www.mattdm.org/>
Boston University Linux      ------>                <http://linux.bu.edu/>





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