From: jbj Date: Thu, 18 Jul 2002 21:42:18 +0000 (+0000) Subject: up2date functional on rpm-python-4.1 bindings. X-Git-Tag: tznext/4.11.0.1.tizen20130304~7308 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6c4025a55b46c33c8eaffe21b942aeb83fe08a3e;p=tools%2Flibrpm-tizen.git up2date functional on rpm-python-4.1 bindings. CVS patchset: 5558 CVS date: 2002/07/18 21:42:18 --- diff --git a/CHANGES b/CHANGES index 250163b..a85319c 100644 --- a/CHANGES +++ b/CHANGES @@ -171,6 +171,7 @@ - popt: mingw32 portability configure check (#67911). - teach gendiff about unreadable files (#42666). - python: sanity check fixes on rpmts/rpmte methods. + - have rpmdb-redhat autoconfigure rpm to use %%_solve_dbpath. 4.0.3 -> 4.0.4: - solaris: translate i86pc to i386 (#57182). diff --git a/doc/rpmcache.8 b/doc/rpmcache.8 index a705e40..3f0381f 100644 --- a/doc/rpmcache.8 +++ b/doc/rpmcache.8 @@ -79,7 +79,7 @@ macro should be configured in either \fI/etc/rpm/macros\fR or \fI~/.rpmmacros\fR: .TP -\fB%_sdbpath\fR +\fB%_solve_dbpath\fR The location of the database that is used to provide suggested dependency resolutions. .PP @@ -87,7 +87,7 @@ suggested dependency resolutions. .PP .nf %_cache_dbpath /var/spool/up2date/cache -%_sdbpath %{_cache_dbpath} +%_solve_dbpath %{_cache_dbpath} %_bhpath file://localhost/mnt/redhat/beehive/comps/dist %_bhcoll 7.3 %_bhN @(basesystem|bash|filesystem|glibc-common|glibc|ldconfig|libtermcap|mktemp|setup|termcap) @@ -98,7 +98,7 @@ suggested dependency resolutions. .PP .nf %_cache_dbpath /var/spool/up2date/cache -%_sdbpath %{_cache_dbpath} +%_solve_dbpath %{_cache_dbpath} %_bhpath ftp://localhost/mnt/dist %_bhcoll @(7.3|7.2|7.1|7.0|6.2|6.1|6.0|5.2|5.1|5.0) %_bhN @(%{_arch}) diff --git a/lib/rpmts.c b/lib/rpmts.c index 82d7267..f51aea2 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -175,13 +175,13 @@ static int rpmtsOpenSDB(rpmts ts) return 0; if (has_sdbpath < 0) - has_sdbpath = rpmExpandNumeric("%{?_sdbpath:1}"); + has_sdbpath = rpmExpandNumeric("%{?_solve_dbpath:1}"); /* If not configured, don't try to open. */ if (has_sdbpath <= 0) return 1; - addMacro(NULL, "_dbpath", NULL, "%{_sdbpath}", RMIL_DEFAULT); + addMacro(NULL, "_dbpath", NULL, "%{_solve_dbpath}", RMIL_DEFAULT); rc = rpmdbOpen(ts->rootDir, &ts->sdb, O_RDONLY, 0644); if (rc) { const char * dn; diff --git a/lib/transaction.c b/lib/transaction.c index 726c468..5202288 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1015,6 +1015,8 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) * For packages being removed: * - count files. */ + +rpmMessage(RPMMESS_DEBUG, _("sanity checking %d elments\n"), rpmtsNElements(ts)); ps = rpmtsProblems(ts); /* The ordering doesn't matter here */ pi = rpmtsiInit(ts); @@ -1095,6 +1097,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) * calling fpLookupList only once. I'm not sure that the speedup is * worth the trouble though. */ +rpmMessage(RPMMESS_DEBUG, _("computing %d file fingerprints\n"), totalFileCount); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, 0)) != NULL) { int fc; @@ -1171,6 +1174,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) /* =============================================== * Compute file disposition for each package in transaction set. */ +rpmMessage(RPMMESS_DEBUG, _("computing file dispositions\n")); ps = rpmtsProblems(ts); pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, 0)) != NULL) { @@ -1336,6 +1340,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) /* =============================================== * Save removed files before erasing. */ +rpmMessage(RPMMESS_DEBUG, _("repackage about-to-be-erased packages\n")); if (rpmtsFlags(ts) & (RPMTRANS_FLAG_DIRSTASH | RPMTRANS_FLAG_REPACKAGE)) { pi = rpmtsiInit(ts); while ((p = rpmtsiNext(pi, 0)) != NULL) { @@ -1361,6 +1366,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) /* =============================================== * Install and remove packages. */ +rpmMessage(RPMMESS_DEBUG, _("install/erase %d elements\n"), rpmtsNElements(ts)); lastKey = (alKey)-2; /* erased packages have -1 */ pi = rpmtsiInit(ts); /*@-branchstate@*/ /* FIX: fi reload needs work */ diff --git a/macros.in b/macros.in index 62167b5..9677e3c 100644 --- a/macros.in +++ b/macros.in @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: /usr/lib/rpm/macros # \verbatim # -# $Id: macros.in,v 1.108 2002/07/05 16:51:57 jbj Exp $ +# $Id: macros.in,v 1.109 2002/07/18 21:42:19 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -512,14 +512,16 @@ %_build_name_fmt %%{ARCH}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm # The path to the dependency universe database. The default value -# is the rpmdb-redhat location. -%_sdbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat +# is the rpmdb-redhat location. The macro is usually defined in +# /etc/rpm/macros.solve, installed with the rpmdb-redhat package. +#%_solve_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat # The output binary package file name template used when suggesting -# binary packages that solve a dependency. +# binary packages that solve a dependency. The macro is usually defined +# in /etc/rpm/macros.solve, installed with the rpmdb-redhat package. # # XXX Note: escaped %% for use in headerSprintf() -%_solve_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +#%_solve_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm # The output binary package file name template used when repackaging # erased packages. diff --git a/po/cs.po b/po/cs.po index b91c529..a42f07d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-07-24 10:02+0100\n" "Last-Translator: Milan Kerslager \n" "Language-Team: Czech \n" diff --git a/po/da.po b/po/da.po index 43a48fc..ee4f795 100644 --- a/po/da.po +++ b/po/da.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-04-05 23:03GMT\n" "Last-Translator: Claus Hindsgaul \n" "Language-Team: Danish \n" diff --git a/po/de.po b/po/de.po index 9f652d7..0c3a0e5 100644 --- a/po/de.po +++ b/po/de.po @@ -37,7 +37,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 1998-08-03 18:02+02:00\n" "Last-Translator: Karl Eichwalder \n" "Language-Team: German \n" diff --git a/po/en_RN.po b/po/en_RN.po index 328c9ba..c9774ea 100644 --- a/po/en_RN.po +++ b/po/en_RN.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/es.po b/po/es.po index 328c9ba..c9774ea 100644 --- a/po/es.po +++ b/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/eu_ES.po b/po/eu_ES.po index 328c9ba..c9774ea 100644 --- a/po/eu_ES.po +++ b/po/eu_ES.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/fi.po b/po/fi.po index ab5f9f6..28b43fb 100644 --- a/po/fi.po +++ b/po/fi.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "Last-Translator: Raimo Koski \n" "Language-Team: Finnish \n" "Content-Type: text/plain; charset=\n" diff --git a/po/fr.po b/po/fr.po index c255246..f2ef52a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/gl.po b/po/gl.po index 6b837a8..b46a159 100644 --- a/po/gl.po +++ b/po/gl.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.1\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-01-13 22:31+0100\n" "Last-Translator: Jesús Bravo Álvarez \n" "Language-Team: Galician \n" diff --git a/po/hu.po b/po/hu.po index 328c9ba..c9774ea 100644 --- a/po/hu.po +++ b/po/hu.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/id.po b/po/id.po index 328c9ba..c9774ea 100644 --- a/po/id.po +++ b/po/id.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/is.po b/po/is.po index ac88e1f..a9a2f37 100644 --- a/po/is.po +++ b/po/is.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-07-12 13:25+0000\n" "Last-Translator: Richard Allen \n" "Language-Team: is \n" diff --git a/po/it.po b/po/it.po index 328c9ba..c9774ea 100644 --- a/po/it.po +++ b/po/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/ja.po b/po/ja.po index 33e8289..f16452e 100644 --- a/po/ja.po +++ b/po/ja.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 1999-12-01 22:49 +JST\n" "Last-Translator: Kanda Mitsuru \n" "Language-Team: JRPM \n" diff --git a/po/ko.po b/po/ko.po index 7ea327e..d24ea11 100644 --- a/po/ko.po +++ b/po/ko.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.4\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2002-03-04 17:17+0900\n" "Last-Translator: Jong-Hoon Ryu \n" "Language-Team: GNU Translation project \n" diff --git a/po/no.po b/po/no.po index e7a8424..f45d207 100644 --- a/po/no.po +++ b/po/no.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-06-27 12:24+0200\n" "Last-Translator: Kjartan Maraas \n" "Language-Team: Norwegian \n" diff --git a/po/pl.po b/po/pl.po index c7e20b0..ba9f5a7 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 1999-05-25 17:00+0100\n" "Last-Translator: Pawe³ Dziekoñski \n" "Language-Team: Polish \n" diff --git a/po/pt.po b/po/pt.po index 62b2d36..05e5be7 100644 --- a/po/pt.po +++ b/po/pt.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2002-02-14 10:51+0000\n" "Last-Translator: José Nuno Coelho Sanarra Pires \n" "Language-Team: pt \n" "Language-Team: Romanian \n" diff --git a/po/rpm.pot b/po/rpm.pot index 1c9d6c8..6e9b620 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/ru.po b/po/ru.po index e805e85..1df5787 100644 --- a/po/ru.po +++ b/po/ru.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2002-04-09 16:44-0400\n" "Last-Translator: Eugene Kanter, \n" "Language-Team: Black Cat Linux Team \n" diff --git a/po/sk.po b/po/sk.po index 167ae03..605a9d7 100644 --- a/po/sk.po +++ b/po/sk.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 1999-04-08 21:37+02:00\n" "Last-Translator: Stanislav Meduna \n" "Language-Team: Slovak \n" diff --git a/po/sl.po b/po/sl.po index 702a783..a934bf6 100644 --- a/po/sl.po +++ b/po/sl.po @@ -1,12 +1,12 @@ # -*- mode:po; coding:iso-latin-2; -*- Slovenian messages for Redhat pkg. mngr. # Copyright (C) 2000 Free Software Foundation, Inc. # Primo¾ Peterlin , 2000. -# $Id: sl.po,v 1.280 2002/07/14 21:24:03 jbj Exp $ +# $Id: sl.po,v 1.281 2002/07/18 21:44:11 jbj Exp $ # msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2000-10-08 19:05+0200\n" "Last-Translator: Grega Fajdiga \n" "Language-Team: Slovenian \n" diff --git a/po/sr.po b/po/sr.po index 92608ef..69969d4 100644 --- a/po/sr.po +++ b/po/sr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "Content-Type: text/plain; charset=\n" "Date: 1998-05-02 21:41:47-0400\n" diff --git a/po/sv.po b/po/sv.po index 3df8538..1fe229e 100644 --- a/po/sv.po +++ b/po/sv.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.1\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2002-07-11 22:49+0200\n" "Last-Translator: Göran Uddeborg \n" "Language-Team: Swedish \n" diff --git a/po/tr.po b/po/tr.po index a49b707..e682288 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: 2001-07-05 08:02+300\n" "Last-Translator: Nilgun Belma Buguner \n" "Language-Team: Turkish \n" diff --git a/po/uk.po b/po/uk.po index 328c9ba..c9774ea 100644 --- a/po/uk.po +++ b/po/uk.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/wa.po b/po/wa.po index 328c9ba..c9774ea 100644 --- a/po/wa.po +++ b/po/wa.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/zh.po b/po/zh.po index 328c9ba..c9774ea 100644 --- a/po/zh.po +++ b/po/zh.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/zh_CN.GB2312.po b/po/zh_CN.GB2312.po index 328c9ba..c9774ea 100644 --- a/po/zh_CN.GB2312.po +++ b/po/zh_CN.GB2312.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: rpm 4.0.3\n" -"POT-Creation-Date: 2002-07-14 17:19-0400\n" +"POT-Creation-Date: 2002-07-15 10:05-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/python/rpmts-py.c b/python/rpmts-py.c index 2e0e72d..6e49e791 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -24,6 +24,8 @@ #include "debug.h" +static int _rpmts_debug = 0; + /*@access alKey @*/ /** \ingroup python @@ -35,9 +37,8 @@ * installation and upgrade of packages. The rpm.ts object is * instantiated by the TransactionSet function in the rpm module. * - * The TransactionSet function takes two optional arguments. The first - * argument is the root path, the second is an open database to perform - * the transaction set upon. + * The TransactionSet function takes a single optional argument. The first + * argument is the root path. * * A rpm.ts object has the following methods: * @@ -146,6 +147,10 @@ static void rpmtsAddAvailableElement(rpmts ts, Header h, provides, fi); fi = rpmfiFree(fi, 1); provides = rpmdsFree(provides); + +if (_rpmts_debug < 0) +fprintf(stderr, "\tAddAvailable(%p) list %p\n", ts, ts->availablePackages); + } /** \ingroup python @@ -160,17 +165,18 @@ rpmts_AddInstall(rpmtsObject * s, PyObject * args) char * how = NULL; int isUpgrade = 0; - if (!PyArg_ParseTuple(args, "O!O|s:Add", &hdr_Type, &h, &key, &how)) + if (!PyArg_ParseTuple(args, "O!O|s:AddInstall", &hdr_Type, &h, &key, &how)) return NULL; -#ifdef DYING { PyObject * hObj = (PyObject *) h; if (hObj->ob_type != &hdr_Type) { PyErr_SetString(PyExc_TypeError, "bad type for header argument"); return NULL; } } -#endif + +if (_rpmts_debug < 0 || (_rpmts_debug > 0 && *how != 'a')) +fprintf(stderr, "*** rpmts_AddInstall(%p) ts %p\n", s, s->ts); if (how && strcmp(how, "a") && strcmp(how, "u") && strcmp(how, "i")) { PyErr_SetString(PyExc_TypeError, "how argument must be \"u\", \"a\", or \"i\""); @@ -203,11 +209,13 @@ rpmts_AddErase(rpmtsObject * s, PyObject * args) int count; rpmdbMatchIterator mi; - if (!PyArg_ParseTuple(args, "s:Remove", &name)) +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_AddErase(%p) ts %p\n", s, s->ts); + + if (!PyArg_ParseTuple(args, "s:AddErase", &name)) return NULL; - /* XXX: Copied hack from ../lib/rpminstall.c, rpmErase() */ - mi = rpmdbInitIterator(dbFromDb(s->dbo), RPMDBI_LABEL, name, 0); + mi = rpmtsInitIterator(s->ts, RPMDBI_LABEL, name, 0); count = rpmdbGetIteratorCount(mi); if (count <= 0) { PyErr_SetString(pyrpmError, "package not installed"); @@ -241,6 +249,9 @@ rpmts_Check(rpmtsObject * s, PyObject * args) int allSuggestions = 0; int xx; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Check(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, "|i:Check", &allSuggestions)) return NULL; xx = rpmtsCheck(s->ts); @@ -323,6 +334,9 @@ rpmts_Order(rpmtsObject * s, PyObject * args) { int xx; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Order(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, ":Order")) return NULL; xx = rpmtsOrder(s->ts); @@ -338,7 +352,8 @@ rpmts_Clean(rpmtsObject * s, PyObject * args) /*@globals _Py_NoneStruct @*/ /*@modifies s, _Py_NoneStruct @*/ { - int xx; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Clean(%p) ts %p\n", s, s->ts); if (!PyArg_ParseTuple(args, ":Clean")) return NULL; @@ -357,6 +372,9 @@ rpmts_OpenDB(rpmtsObject * s, PyObject * args) { int xx; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_OpenDB(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, ":OpenDB")) return NULL; if (s->ts->dbmode == -1) @@ -376,6 +394,9 @@ rpmts_CloseDB(rpmtsObject * s, PyObject * args) { int xx; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_CloseDB(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, ":CloseDB")) return NULL; xx = rpmtsCloseDB(s->ts); @@ -396,6 +417,9 @@ rpmts_GetKeys(rpmtsObject * s, PyObject * args) int num, i; PyObject *tuple; +if (_rpmts_debug) +fprintf(stderr, "*** GetKeys(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, ":GetKeys")) return NULL; rpmtsGetKeys(s->ts, &data, &num); @@ -435,8 +459,7 @@ rpmtsCallback(/*@unused@*/ const void * hd, const rpmCallbackType what, { struct rpmtsCallbackType_s * cbInfo = data; PyObject * args, * result; - int fd; - static FD_t fdt; + static FD_t fd; if (cbInfo->pythonError) return NULL; if (cbInfo->cb == Py_None) return NULL; @@ -453,18 +476,27 @@ rpmtsCallback(/*@unused@*/ const void * hd, const rpmCallbackType what, } if (what == RPMCALLBACK_INST_OPEN_FILE) { - if (!PyArg_Parse(result, "i", &fd)) { + int fdno; + + if (!PyArg_Parse(result, "i", &fdno)) { cbInfo->pythonError = 1; return NULL; } - fdt = fdDup(fd); - Py_DECREF(result); - return fdt; - } + fd = fdDup(fdno); +if (_rpmts_debug) +fprintf(stderr, "\t%p = fdDup(%d)\n", fd, fdno); + + return fd; + } else if (what == RPMCALLBACK_INST_CLOSE_FILE) { - Fclose (fdt); +if (_rpmts_debug) +fprintf(stderr, "\tFclose(%p)\n", fd); + Fclose (fd); + } else { +if (_rpmts_debug) +fprintf(stderr, "\t%ld:%ld key %p\n", amount, total, pkgKey); } Py_DECREF(result); @@ -493,6 +525,9 @@ static PyObject * rpmts_Run(rpmtsObject * s, PyObject * args) (void) rpmtsSetNotifyCallback(s->ts, rpmtsCallback, (void *) &cbInfo); (void) rpmtsSetFlags(s->ts, flags); +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Run(%p) ts %p flags %x ignore %x\n", s, s->ts, s->ts->transFlags, ignoreSet); + rc = rpmtsRun(s->ts, NULL, ignoreSet); ps = rpmtsProblems(s->ts); @@ -533,6 +568,9 @@ rpmts_Next(rpmtsObject * s) { rpmte te; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Next(%p) ts %p\n", s, s->ts); + if (s == NULL || s->tsi == NULL) return NULL; @@ -551,6 +589,9 @@ static PyObject * rpmts_Iter(rpmtsObject * s) /*@modifies s @*/ { +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Iter(%p) ts %p\n", s, s->ts); + s->tsi = rpmtsiInit(s->ts); s->tsiFilter = 0; Py_INCREF(s); @@ -570,6 +611,9 @@ rpmts_Match (rpmtsObject * s, PyObject * args) int len = 0; int tag = RPMDBI_PACKAGES; +if (_rpmts_debug) +fprintf(stderr, "*** rpmts_Match(%p) ts %p\n", s, s->ts); + if (!PyArg_ParseTuple(args, "|Ozi", &TagN, &key, &len)) return NULL; @@ -597,10 +641,16 @@ rpmts_Match (rpmtsObject * s, PyObject * args) static struct PyMethodDef rpmts_methods[] = { {"addInstall", (PyCFunction) rpmts_AddInstall, METH_VARARGS, NULL }, + {"add", (PyCFunction) rpmts_AddInstall, METH_VARARGS, + NULL }, {"addErase", (PyCFunction) rpmts_AddErase, METH_VARARGS, NULL }, + {"remove", (PyCFunction) rpmts_AddErase, METH_VARARGS, + NULL }, {"check", (PyCFunction) rpmts_Check, METH_VARARGS, NULL }, + {"depcheck", (PyCFunction) rpmts_Check, METH_VARARGS, + NULL }, {"order", (PyCFunction) rpmts_Order, METH_VARARGS, NULL }, {"clean", (PyCFunction) rpmts_Clean, METH_VARARGS, @@ -633,11 +683,10 @@ static void rpmts_dealloc(/*@only@*/ PyObject * o) { rpmtsObject * trans = (void *) o; - trans->ts->rdb = NULL; /* XXX HACK: avoid rpmdb close/free */ +if (_rpmts_debug) +fprintf(stderr, "%p -- ts %p db %p\n", trans, trans->ts, trans->ts->rdb); rpmtsFree(trans->ts); - if (trans->dbo) { - Py_DECREF(trans->dbo); - } + if (trans->scriptFd) Fclose(trans->scriptFd); /* this will free the keyList, and decrement the ref count of all the items on the list as well :-) */ @@ -739,28 +788,20 @@ rpmtsObject * rpmts_Create(/*@unused@*/ PyObject * self, PyObject * args) { rpmtsObject * o; - rpmdbObject * db = NULL; char * rootDir = "/"; - if (!PyArg_ParseTuple(args, "|sO!:Create", &rootDir, &rpmdb_Type, &db)) - return NULL; -#ifdef DYING - if (db && ((PyObject *) db)->ob_type != &rpmdb_Type) { - PyErr_SetString(PyExc_TypeError, "bad type for database argument"); + if (!PyArg_ParseTuple(args, "|s:Create", &rootDir)) return NULL; - } -#endif o = (void *) PyObject_NEW(rpmtsObject, &rpmts_Type); - Py_XINCREF(db); - o->dbo = db; - o->scriptFd = NULL; o->ts = rpmtsCreate(); (void) rpmtsSetRootDir(o->ts, rootDir); - /* XXX this will be fun to fix */ - o->ts->rdb = (db ? dbFromDb(db) : NULL); + o->keyList = PyList_New(0); + o->scriptFd = NULL; +if (_rpmts_debug) +fprintf(stderr, "%p ++ ts %p db %p\n", o, o->ts, o->ts->rdb); return o; } diff --git a/python/rpmts-py.h b/python/rpmts-py.h index 9d50038..467612a 100644 --- a/python/rpmts-py.h +++ b/python/rpmts-py.h @@ -10,7 +10,6 @@ typedef struct rpmtsObject_s { PyObject_HEAD rpmts ts; - rpmdbObject * dbo; PyObject * keyList; /* keeps reference counts correct */ FD_t scriptFd; rpmtsi tsi; diff --git a/rpm.spec.in b/rpm.spec.in index 3da47eb..cc72822 100644 --- a/rpm.spec.in +++ b/rpm.spec.in @@ -17,7 +17,7 @@ Name: rpm %define version @VERSION@ Version: %{version} %{expand: %%define rpm_version %{version}} -Release: 0.48 +Release: 0.50 Group: System Environment/Base Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz Copyright: GPL @@ -514,6 +514,9 @@ fi %{__prefix}/include/popt.h %changelog +* Mon Jul 15 2002 Jeff Johnson 4.1-0.50 +- have rpmdb-redhat autoconfigure rpm to use %%_solve_dbpath. + * Sun Jul 14 2002 Jeff Johnson 4.1-0.49 - python: sanity check fixes on rpmts/rpmte methods. diff --git a/rpmrc.in b/rpmrc.in index 9c2dc51..c252dfb 100644 --- a/rpmrc.in +++ b/rpmrc.in @@ -1,7 +1,7 @@ #/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc # \verbatim # -# $Id: rpmrc.in,v 2.50 2002/06/28 00:35:57 jbj Exp $ +# $Id: rpmrc.in,v 2.51 2002/07/18 21:42:20 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -343,7 +343,7 @@ buildarch_compat: ia64: noarch buildarch_compat: s390: noarch buildarch_compat: s390x: noarch -macrofiles: @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.specspo:@SYSCONFIGDIR@/macros.prelink:@SYSCONFIGDIR@/macros.up2date:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros +macrofiles: @RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.specspo:@SYSCONFIGDIR@/macros.prelink:@SYSCONFIGDIR@/macros.solve:@SYSCONFIGDIR@/macros.up2date:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros # \endverbatim #*/