- python: remove the old initdb/rebuilddb methods, use ts.fooDB().
authorjbj <devnull@localhost>
Thu, 25 Jul 2002 17:03:11 +0000 (17:03 +0000)
committerjbj <devnull@localhost>
Thu, 25 Jul 2002 17:03:11 +0000 (17:03 +0000)
- python: 1st crack at backport to 1.5.2.

CVS patchset: 5571
CVS date: 2002/07/25 17:03:11

38 files changed:
popt/po/cs.po
popt/po/da.po
popt/po/de.po
popt/po/es.po
popt/po/eu_ES.po
popt/po/fi.po
popt/po/fr.po
popt/po/gl.po
popt/po/hu.po
popt/po/id.po
popt/po/is.po
popt/po/it.po
popt/po/ja.po
popt/po/ko.po
popt/po/no.po
popt/po/pl.po
popt/po/popt.pot
popt/po/pt.po
popt/po/pt_BR.po
popt/po/ro.po
popt/po/ru.po
popt/po/sk.po
popt/po/sl.po
popt/po/sr.po
popt/po/sv.po
popt/po/tr.po
popt/po/uk.po
popt/po/wa.po
popt/po/zh.po
popt/po/zh_CN.GB2312.po
popt/popthelp.c
python/rpmdb-py.c
python/rpmdb-py.h
python/rpmmodule.c
python/rpmrc-py.c
python/rpmrc-py.h
python/rpmts-py.c
rpm.spec.in

index 40bbdf4..c86cd32 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-07-24 00:03+0100\n"
 "Last-Translator: Milan Kerslager <kerslage@linux.cz>\n"
 "Language-Team: Czech <cs@li.org>\n"
index 92c6987..974b4ff 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: Sun Jan 21 2001 04:30:32+0200\n"
 "Last-Translator: Martin Hansen <mah@k64.dk>\n"
 "Language-Team: Dansk <dansk@klid.dk>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 53a05a5..bbbf7ed 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: Leandro Lucarella <luca@linuxmendoza.org.ar>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index f2a23ad..d058039 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-01-17 01:01+0100\n"
 "Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
 "Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
index 4a985cf..0f19c64 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2000-08-03 23:26+0200\n"
 "Last-Translator: László Németh <nemeth@qwertynet.hu>\n"
 "Language-Team: Hungarian\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 0686373..6cf08c8 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-06-08 01:35+0000\n"
 "Last-Translator: Richard Allen <ra@hp.is>\n"
 "Language-Team: is <kde-isl@mmedia.is>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 7e5b1af..6d273f7 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-09-06 20:06+0900\n"
 "Last-Translator: Jong-Hoon Ryu <redhat4u@netian.com>\n"
 "Language-Team: GNU Translation project <ko@li.org>\n"
index 5501a12..ee34aa8 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-06-27 11:05+0200\n"
 "Last-Translator: Kjartan Maraas <kmaraas@online.no>\n"
 "Language-Team: Norwegian <no@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index b60a954..98699ad 100644 (file)
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 54f91d1..156435f 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2002-02-13 18:32+0000\n"
 "Last-Translator: Pedro Morais <morais@kde.org>\n"
 "Language-Team: pt <morais@kde.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 88a5dfc..e6a8b34 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2000-06-14 23:23+EST\n"
 "Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
 "Language-Team: Romanian <ro@li.org>\n"
index c8e0cc5..a7d719e 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-07-05 21:00-0500\n"
 "Last-Translator: Eugene Kanter <eugene@blackcatlinux.com>\n"
 "Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"
index d521434..69dc5e4 100644 (file)
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 1999-08-04 21:40+0200\n"
 "Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
 "Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
index d32e36c..ea5ea88 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2000-09-05 12:30+0200\n"
 "Last-Translator: Roman Maurer <roman.maurer@hermes.si>\n"
 "Language-Team: Slovenian <sl@li.org>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index c7b3062..1bf94d1 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2001-07-12 22:26+0100\n"
 "Last-Translator: Christian Rose <menthos@menthos.com>\n"
 "Language-Team: Swedish <sv@li.org>\n"
index d958fd1..ea33233 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 2000-02-11 13:01+0200\n"
 "Last-Translator: Nilgun Belma Buguner <nilgun@technologist.com>\n"
 "Language-Team: Turkish <tr@li.org>\n"
index 4c47cb5..32bfb6e 100644 (file)
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 1999-09-30 16:54+0200\n"
 "Last-Translator: Yuri Syrota <rasta@renome.rovno.ua>\n"
 "Language-Team: Ukrainian <uk@li.org>\n"
index 6db9d08..4752ade 100644 (file)
@@ -9,7 +9,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 1999-03-18 23:11+0100\n"
 "Last-Translator: Nobody yet\n"
 "Language-Team: walon <linux-wa@chanae.alphanet.ch>\n"
index e973070..7bd8231 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 4f3deeb..b7cf54c 100644 (file)
@@ -1,7 +1,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: popt 1.6.3\n"
-"POT-Creation-Date: 2002-07-20 15:04-0400\n"
+"POT-Creation-Date: 2002-07-25 11:05-0400\n"
 "PO-Revision-Date: 1999-11-11 05:04+0800\n"
 "Last-Translator: Dillion Chen <dillon.chen@turbolinux.com.cn>\n"
 "Language-Team: TLDN\n"
index 801dca5..bb00e92 100644 (file)
 /**
  * Display arguments.
  * @param con          context
- * @param foo
+ * @param foo          (unused)
  * @param key          option(s)
- * @param arg
- * @param data
+ * @param arg          (unused)
+ * @param data         (unused)
  */
 static void displayArgs(poptContext con,
                /*@unused@*/ enum poptCallbackReason foo,
@@ -526,6 +526,7 @@ static int singleOptionUsage(FILE * fp, int cursor,
     const char * item = shortStr;
     const char * argDescrip = getArgDescrip(opt, translation_domain);
 
+fprintf(stderr, "*** singleOptionUsage(%p,%d,%p,%p)\n", fp, cursor, opt, translation_domain);
     if (opt->shortName!= '\0' ) {
        if (!(opt->argInfo & POPT_ARG_MASK)) 
            return cursor;      /* we did these already */
@@ -602,6 +603,7 @@ static int singleTableUsage(poptContext con, FILE * fp,
        /*@globals fileSystem @*/
        /*@modifies *fp, fileSystem @*/
 {
+fprintf(stderr, "*** singleTableUsage(%p,%p,%d,%p,%p)\n", con, fp, cursor, opt, translation_domain);
     /*@-branchstate@*/         /* FIX: W2DO? */
     if (opt != NULL)
     for (; (opt->longName || opt->shortName || opt->arg) ; opt++) {
index 4921fce..d784c12 100644 (file)
@@ -275,6 +275,7 @@ PyTypeObject rpmdb_Type = {
 };
 /*@=fullinitblock@*/
 
+#ifdef  _LEGACY_BINDINGS_TOO
 rpmdb dbFromDb(rpmdbObject * db)
 {
     return db->db;
@@ -322,5 +323,6 @@ PyObject * rebuildDB (/*@unused@*/ PyObject * self, PyObject * args)
 
     return Py_BuildValue("i", rpmdbRebuild(rootDir, NULL, NULL));
 }
+#endif
 
 /*@}*/
index 8c088d5..87e4a05 100644 (file)
@@ -24,6 +24,7 @@ struct rpmdbObject_s {
 /*@unchecked@*/
 extern PyTypeObject rpmdb_Type;
 
+#ifdef  _LEGACY_BINDINGS_TOO
 rpmdb dbFromDb(rpmdbObject * db)
        /*@*/;
 
@@ -32,5 +33,6 @@ rpmdbObject * rpmOpenDB(PyObject * self, PyObject * args)
 PyObject * rebuildDB (PyObject * self, PyObject * args)
        /*@globals rpmGlobalMacroContext @*/
        /*@modifies rpmGlobalMacroContext @*/;
+#endif
 
 #endif
index 3952b09..b6d3bdf 100644 (file)
@@ -178,6 +178,7 @@ static PyObject * findUpgradeSet(PyObject * self, PyObject * args)
     return result;
 }
 
+#ifdef _LEGACY_BINDINGS_TOO
 /**
  */
 static PyObject * rpmInitDB(PyObject * self, PyObject * args)
@@ -202,6 +203,7 @@ static PyObject * rpmInitDB(PyObject * self, PyObject * args)
     Py_INCREF(Py_None);
     return(Py_None);
 }
+#endif
 
 /**
  */
@@ -323,8 +325,10 @@ static PyMethodDef rpmModuleMethods[] = {
 "rpm.TransactionSet([rootDir, [db]]) -> ts\n\
 - Create a transaction set.\n" },
 
+#if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
     { "newrc", (PyCFunction) rpmrc_Create, METH_VARARGS|METH_KEYWORDS,
        NULL },
+#endif
     { "addMacro", (PyCFunction) rpmrc_AddMacro, METH_VARARGS,
        NULL },
     { "delMacro", (PyCFunction) rpmrc_DelMacro, METH_VARARGS,
@@ -340,12 +344,14 @@ static PyMethodDef rpmModuleMethods[] = {
        NULL },
     { "rhnLoad", (PyCFunction) rhnLoad, METH_VARARGS,
        NULL },
+#ifdef  _LEGACY_BINDINGS_TOO
     { "initdb", (PyCFunction) rpmInitDB, METH_VARARGS,
        NULL },
     { "opendb", (PyCFunction) rpmOpenDB, METH_VARARGS,
        NULL },
     { "rebuilddb", (PyCFunction) rebuildDB, METH_VARARGS,
        NULL },
+#endif
     { "mergeHeaderListFromFD", (PyCFunction) rpmMergeHeadersFromFD, METH_VARARGS,
        NULL },
     { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS,
@@ -386,6 +392,7 @@ void initrpm(void)
     struct headerSprintfExtension_s * ext;
     PyObject * m;
 
+#if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
     if (PyType_Ready(&hdr_Type) < 0) return;
     if (PyType_Ready(&rpmal_Type) < 0) return;
     if (PyType_Ready(&rpmdb_Type) < 0) return;
@@ -399,6 +406,7 @@ void initrpm(void)
 
     if (PyType_Ready(&rpmte_Type) < 0) return;
     if (PyType_Ready(&rpmts_Type) < 0) return;
+#endif
 
     m = Py_InitModule3("rpm", rpmModuleMethods, rpm__doc__);
     if (m == NULL)
@@ -418,6 +426,7 @@ void initrpm(void)
        PyDict_SetItemString(d, "error", pyrpmError);
 #endif
 
+#if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
     Py_INCREF(&hdr_Type);
     PyModule_AddObject(m, "hdr", (PyObject *) &hdr_Type);
 
@@ -447,6 +456,17 @@ void initrpm(void)
 
     Py_INCREF(&rpmts_Type);
     PyModule_AddObject(m, "ts", (PyObject *) &rpmts_Type);
+#else
+    hdr_Type.ob_type = &PyType_Type;
+    rpmal_Type.ob_type = &PyType_Type;
+    rpmdb_Type.ob_type = &PyType_Type;
+    rpmds_Type.ob_type = &PyType_Type;
+    rpmfd_Type.ob_type = &PyType_Type;
+    rpmfi_Type.ob_type = &PyType_Type;
+    rpmmi_Type.ob_type = &PyType_Type;
+    rpmte_Type.ob_type = &PyType_Type;
+    rpmts_Type.ob_type = &PyType_Type;
+#endif
 
     dict = PyDict_New();
 
index ad1292d..729e1d3 100644 (file)
@@ -17,21 +17,26 @@ extern PyTypeObject PyDictIter_Type;
 
 #include <rpmcli.h>
 
-#include "header-py.h"
-#include "rpmal-py.h"
-#include "rpmdb-py.h"
-#include "rpmds-py.h"
-#include "rpmfd-py.h"
-#include "rpmfi-py.h"
-#include "rpmmi-py.h"
 #include "rpmrc-py.h"
-#include "rpmte-py.h"
-#include "rpmts-py.h"
+
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
+#include "header-py.h" /* XXX debug only */
+#include "rpmal-py.h"  /* XXX debug only */
+#include "rpmdb-py.h"  /* XXX debug only */
+#include "rpmds-py.h"  /* XXX debug only */
+#include "rpmfd-py.h"  /* XXX debug only */
+#include "rpmfi-py.h"  /* XXX debug only */
+#include "rpmmi-py.h"  /* XXX debug only */
+#include "rpmte-py.h"  /* XXX debug only */
+#include "rpmts-py.h"  /* XXX debug only */
+#endif
 
 #include "debug.h"
 
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
 /*@unchecked@*/
 static int _rc_debug = 0;
+#endif
 
 /** \ingroup python
  * \class Rpmrc
@@ -45,6 +50,38 @@ static int _rc_debug = 0;
 
 /**
  */
+PyObject * rpmrc_AddMacro(/*@unused@*/ PyObject * self, PyObject * args)
+{
+    char * name, * val;
+
+    if (!PyArg_ParseTuple(args, "ss:AddMacro", &name, &val))
+       return NULL;
+
+    addMacro(NULL, name, NULL, val, -1);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+/**
+ */
+PyObject * rpmrc_DelMacro(/*@unused@*/ PyObject * self, PyObject * args)
+{
+    char * name;
+
+    if (!PyArg_ParseTuple(args, "s:DelMacro", &name))
+       return NULL;
+
+    delMacro(NULL, name);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
+/**
+ */
+
 static const char * lbl(void * s)
        /*@*/
 {
@@ -87,36 +124,6 @@ static const char * lbl(void * s)
 
 /**
  */
-PyObject * rpmrc_AddMacro(/*@unused@*/ PyObject * self, PyObject * args)
-{
-    char * name, * val;
-
-    if (!PyArg_ParseTuple(args, "ss:AddMacro", &name, &val))
-       return NULL;
-
-    addMacro(NULL, name, NULL, val, -1);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-/**
- */
-PyObject * rpmrc_DelMacro(/*@unused@*/ PyObject * self, PyObject * args)
-{
-    char * name;
-
-    if (!PyArg_ParseTuple(args, "s:DelMacro", &name))
-       return NULL;
-
-    delMacro(NULL, name);
-
-    Py_INCREF(Py_None);
-    return Py_None;
-}
-
-/**
- */
 static PyObject *
 rpmrc_getstate(rpmrcObject *s, PyObject *args)
        /*@*/
@@ -391,6 +398,7 @@ if (_rc_debug)
 fprintf(stderr, "*** rpmrc_new(%p[%s],%p,%p) ret %p[%s]\n", subtype, lbl(subtype), args, kwds, ns, lbl(ns));
     return ns;
 }
+#endif
 
 /**
  */
@@ -401,12 +409,14 @@ static struct PyMethodDef rpmrc_methods[] = {
        NULL },
     { "delMacro",      (PyCFunction) rpmrc_DelMacro, METH_VARARGS,
        NULL },
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
     { "getstate",      (PyCFunction) rpmrc_getstate, METH_VARARGS,
        "getstate() -> state"},
     { "setstate",      (PyCFunction) rpmrc_setstate, METH_VARARGS,
        "setstate(state)"},
     { "next",          (PyCFunction) rpmrc_next,     METH_VARARGS,
        "next() -- get the next value, or raise StopIteration"},
+#endif
     {NULL,             NULL}           /* sentinel */
 };
 /*@=fullinitblock@*/
@@ -414,6 +424,7 @@ static struct PyMethodDef rpmrc_methods[] = {
 /** \ingroup python
  */
 /*@-fullinitblock@*/
+#if Py_TPFLAGS_HAVE_ITER
 PyTypeObject rpmrc_Type = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,                              /* ob_size */
@@ -437,7 +448,6 @@ PyTypeObject rpmrc_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,  /* tp_flags */
        rpmrc_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        rpmrc_traverse,                 /* tp_traverse */
        rpmrc_clear,                    /* tp_clear */
        rpmrc_richcompare,              /* tp_richcompare */
@@ -457,13 +467,40 @@ PyTypeObject rpmrc_Type = {
        rpmrc_new,                      /* tp_new */
        rpmrc_free,                     /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
+#else
+PyTypeObject rpmrc_Type = {
+       PyObject_HEAD_INIT(&PyType_Type)
+       0,                              /* ob_size */
+       "rpm.rc",                       /* tp_name */
+       sizeof(rpmrcObject),            /* tp_size */
+       0,                              /* tp_itemsize */
+       0,                              /* tp_dealloc */
+       0,                              /* tp_print */
+       0,                              /* tp_getattr */
+       0,                              /* tp_setattr */
+       0,                              /* tp_compare */
+       0,                              /* tp_repr */
+       0,                              /* tp_as_number */
+       0,                              /* tp_as_sequence */
+       0,                              /* tp_as_mapping */
+       0,                              /* tp_hash */
+       0,                              /* tp_call */
+       0,                              /* tp_str */
+       0,                              /* tp_getattro */
+       0,                              /* tp_setattro */
+       0,                              /* tp_as_buffer */
+       0,                              /* tp_flags */
+       0                               /* tp_doc */
+};
+#endif
 /*@=fullinitblock@*/
 
+#if Py_TPFLAGS_HAVE_ITER
 PyObject * rpmrc_Create(/*@unused@*/ PyObject * self, PyObject *args, PyObject *kwds)
 {
     return rpmrc_new(&rpmrc_Type, args, kwds);
 }
+#endif
 
 /*@}*/
index 92e95ac..5025386 100644 (file)
@@ -12,8 +12,12 @@ typedef struct rpmrcObject_s rpmrcObject;
 /** \ingroup python
  */
 struct rpmrcObject_s {
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
     PyDictObject dict;
     int state;
+#else
+    PyObject_HEAD
+#endif
 } ;
 
 /*@unchecked@*/
@@ -26,7 +30,9 @@ PyObject * rpmrc_DelMacro(PyObject * self, PyObject * args)
        /*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
        /*@modifies rpmGlobalMacroContext, _Py_NoneStruct @*/;
 
+#if Py_TPFLAGS_HAVE_ITER       /* XXX backport to python-1.5.2 */
 PyObject * rpmrc_Create(PyObject * self, PyObject * args, PyObject * kwds)
        /*@*/;
+#endif
 
 #endif
index 1f60347..30bbc08 100644 (file)
@@ -495,7 +495,6 @@ fprintf(stderr, "*** rpmts_HdrCheck(%p) ts %p\n", s, s->ts);
     }
     uh = PyString_AsString(blob);
     uc = PyString_Size(blob);
-fprintf(stderr, "*** uh %p uc %d\n", uh, uc);
 
     rpmrc = headerCheck(s->ts, uh, uc, &msg);
 
@@ -668,6 +667,7 @@ fprintf(stderr, "*** rpmts_Run(%p) ts %p flags %x ignore %x\n", s, s->ts, s->ts-
     return list;
 }
 
+#if Py_TPFLAGS_HAVE_ITER
 static PyObject *
 rpmts_iter(rpmtsObject * s)
        /*@modifies s @*/
@@ -675,13 +675,10 @@ rpmts_iter(rpmtsObject * s)
 if (_rpmts_debug)
 fprintf(stderr, "*** rpmts_iter(%p) ts %p\n", s, s->ts);
 
-#ifdef DYING
-    s->tsi = rpmtsiInit(s->ts);
-    s->tsiFilter = 0;
-#endif
     Py_INCREF(s);
     return (PyObject *)s;
 }
+#endif
 
 /**
  * @todo Add TR_ADDED filter to iterator.
index 6a7f88b..8a60ad7 100644 (file)
@@ -17,7 +17,7 @@ Name: rpm
 %define version @VERSION@
 Version: %{version}
 %{expand: %%define rpm_version %{version}}
-Release: 0.55
+Release: 0.56
 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,10 @@ fi
 %{__prefix}/include/popt.h
 
 %changelog
+* Thu Jul 25 2002 Jeff Johnson <jbj@redhat.com>
+- python: remove the old initdb/rebuilddb methods, use ts.fooDB().
+- python: 1st crack at backport to 1.5.2.
+
 * Wed Jul 24 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.55
 - imbue %ghost with missingok attribute with --verify (#68933).
 - fix: segfault if given a text file as 2nd arg to -Uvh (#69508).