summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-08-09 22:25:04 +0000
committerjbj <devnull@localhost>2002-08-09 22:25:04 +0000
commit7937158c01c71774eb5872f742a9d9c771df5b79 (patch)
tree266dc866f50b92e40c23b39df7f2be6e79719ff7
parentc961f3f78e34e77989f603dcdd92e269bbe15546 (diff)
downloadrpm-7937158c01c71774eb5872f742a9d9c771df5b79.tar.gz
rpm-7937158c01c71774eb5872f742a9d9c771df5b79.tar.bz2
rpm-7937158c01c71774eb5872f742a9d9c771df5b79.zip
- python: add (optional) ts.check() callback.
CVS patchset: 5619 CVS date: 2002/08/09 22:25:04
-rw-r--r--CHANGES1
-rw-r--r--lib/depends.c2
-rw-r--r--lib/rpmts.c15
-rw-r--r--lib/rpmts.h22
-rw-r--r--po/cs.po4
-rw-r--r--po/da.po4
-rw-r--r--po/de.po4
-rw-r--r--po/en_RN.po4
-rw-r--r--po/es.po4
-rw-r--r--po/eu_ES.po4
-rw-r--r--po/fi.po4
-rw-r--r--po/fr.po4
-rw-r--r--po/gl.po4
-rw-r--r--po/hu.po4
-rw-r--r--po/id.po4
-rw-r--r--po/is.po4
-rw-r--r--po/it.po4
-rw-r--r--po/ja.po4
-rw-r--r--po/ko.po4
-rw-r--r--po/no.po4
-rw-r--r--po/pl.po4
-rw-r--r--po/pt.po4
-rw-r--r--po/pt_BR.po4
-rw-r--r--po/ro.po4
-rw-r--r--po/rpm.pot4
-rw-r--r--po/ru.po4
-rw-r--r--po/sk.po4
-rw-r--r--po/sl.po6
-rw-r--r--po/sr.po4
-rw-r--r--po/sv.po4
-rw-r--r--po/tr.po4
-rw-r--r--po/uk.po4
-rw-r--r--po/wa.po4
-rw-r--r--po/zh.po4
-rw-r--r--po/zh_CN.GB2312.po4
-rw-r--r--python/rpmts-py.c105
-rw-r--r--rpm.spec.in3
37 files changed, 186 insertions, 88 deletions
diff --git a/CHANGES b/CHANGES
index 3fe9776d5..d0a16f88e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -229,6 +229,7 @@
- fix: src.rpm installs need fd pos at payload.
- python: add return codes for rollbacks and fooDB methods.
- avoid generating fingerprints for locale/zoneinfo sub-directories.
+ - python: add (optional) ts.check() callback.
4.0.3 -> 4.0.4:
- solaris: translate i86pc to i386 (#57182).
diff --git a/lib/depends.c b/lib/depends.c
index 70c9db24e..8c6c0e3f7 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -502,7 +502,7 @@ static int unsatisfiedDepend(rpmts ts, rpmds dep, int adding)
/*@-boundsread@*/
if (adding && !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOSUGGEST)) {
if (ts->solve != NULL)
- xx = (*ts->solve) (ts, dep);
+ xx = (*ts->solve) (ts, dep, ts->solveData);
}
/*@=boundsread@*/
diff --git a/lib/rpmts.c b/lib/rpmts.c
index f8cf0ec3a..253335550 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -341,7 +341,7 @@ static int sugcmp(const void * a, const void * b)
}
/*@-bounds@*/
-int rpmtsSolve(rpmts ts, rpmds ds)
+int rpmtsSolve(rpmts ts, rpmds ds, /*@unused@*/ const void * data)
{
const char * errstr;
const char * str;
@@ -464,6 +464,18 @@ int rpmtsAvailable(rpmts ts, const rpmds ds)
/*@=nullstate@*/
}
+int rpmtsSetSolveCallback(rpmts ts,
+ int (*solve) (rpmts ts, rpmds key, const void * data),
+ const void * solveData)
+{
+ int rc = 0;
+ if (ts) {
+ ts->solve = solve;
+ ts->solveData = solveData;
+ }
+ return rc;
+}
+
rpmps rpmtsProblems(rpmts ts)
{
rpmps ps = NULL;
@@ -1043,6 +1055,7 @@ rpmts rpmtsCreate(void)
ts->dsi = NULL;
ts->solve = rpmtsSolve;
+ ts->solveData = NULL;
ts->nsuggests = 0;
ts->suggests = NULL;
ts->sdb = NULL;
diff --git a/lib/rpmts.h b/lib/rpmts.h
index 81ec9f4b1..4a64a8c21 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -112,8 +112,9 @@ struct rpmts_s {
rpmdb sdb; /*!< Solve database handle. */
int sdbmode; /*!< Solve database open mode. */
/*@null@*/
- int (*solve) (rpmts ts, const rpmds key)
+ int (*solve) (rpmts ts, rpmds key, const void * data)
/*@modifies ts @*/; /*!< Search for NEVRA key. */
+ const void * solveData; /*!< Solve callback data */
int nsuggests; /*!< No. of depCheck suggestions. */
/*@only@*/ /*@null@*/
const void ** suggests; /*!< Possible depCheck suggestions. */
@@ -370,13 +371,14 @@ int rpmtsOpenSDB(rpmts ts, int dbmode)
/*@=exportlocal@*/
/**
- * Attempt to solve a needed dependency using the solve database..
+ * Attempt to solve a needed dependency using the solve database.
* @param ts transaction set
* @param ds dependency set
- * @return 0 if resolved (and added to ts), 1 not found
+ * @param data opaque data associated with callback
+ * @return 0 if resolved, 1 not found
*/
/*@-exportlocal@*/
-int rpmtsSolve(rpmts ts, rpmds ds)
+int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
/*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
/*@=exportlocal@*/
@@ -394,6 +396,18 @@ int rpmtsAvailable(rpmts ts, const rpmds ds)
/*@modifies ts, fileSystem @*/;
/**
+ * Set dependency solver callback.
+ * @param ts transaction set
+ * @param (*solve) dependency solver callback
+ * @param solveData dependency solver callback data (opaque)
+ * @return 0 on success
+ */
+int rpmtsSetSolveCallback(rpmts ts,
+ int (*solve) (rpmts ts, rpmds ds, const void * data),
+ const void * solveData)
+ /*@modifies ts @*/;
+
+/**
* Return current transaction set problems.
* @param ts transaction set
* @return current problem set (or NULL)
diff --git a/po/cs.po b/po/cs.po
index eda7cf8e5..11cda61dc 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-07-24 10:02+0100\n"
"Last-Translator: Milan Kerslager <kerslage@linux.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
@@ -2811,7 +2811,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "nemohu otevøít RPM databázi v %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "získávám seznam pøipojených systémù souborù\n"
diff --git a/po/da.po b/po/da.po
index 74afd9ddd..5414aebc2 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-04-05 23:03GMT\n"
"Last-Translator: Claus Hindsgaul <claus_h@image.dk>\n"
"Language-Team: Danish <dansk@klid.dk>\n"
@@ -2828,7 +2828,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "kan ikke åbne rpm-database i %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "henter liste over monterede filsystemer\n"
diff --git a/po/de.po b/po/de.po
index 68df25394..5046536e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 1998-08-03 18:02+02:00\n"
"Last-Translator: Karl Eichwalder <ke@SuSE.DE>\n"
"Language-Team: German <de@li.org>\n"
@@ -3001,7 +3001,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "Fehler: kann nicht öffnen %s%s/packages.rpm\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/en_RN.po b/po/en_RN.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/es.po b/po/es.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/eu_ES.po b/po/eu_ES.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/fi.po b/po/fi.po
index 3b7dd6b18..b07ff0a3d 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"Last-Translator: Raimo Koski <rkoski@pp.weppi.fi>\n"
"Language-Team: Finnish <linux@sot.com>\n"
"Content-Type: text/plain; charset=\n"
@@ -2864,7 +2864,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "virhe: en voi avata %s%s/packages.rpm\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index dfbc3b3bf..d093ae426 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2905,7 +2905,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "impossible d'ouvrir: %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/gl.po b/po/gl.po
index 3317a9147..c9dc5504a 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-01-13 22:31+0100\n"
"Last-Translator: Jesús Bravo Álvarez <jba@pobox.com>\n"
"Language-Team: Galician <trasno@ceu.fi.udc.es>\n"
@@ -2726,7 +2726,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/id.po b/po/id.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/is.po b/po/is.po
index 6f302ea0c..ae4972649 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-07-12 13:25+0000\n"
"Last-Translator: Richard Allen <ra@hp.is>\n"
"Language-Team: is <kde-isl@mmedia.is>\n"
@@ -2754,7 +2754,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "get ekki opnað pakka gagnagrunn í %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/ja.po b/po/ja.po
index 8fe61eeb9..35b90dff0 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 1999-12-01 22:49 +JST\n"
"Last-Translator: Kanda Mitsuru <kanda@nn.iij4u.or.jp>\n"
"Language-Team: JRPM <jrpm@linux.or.jp>\n"
@@ -2914,7 +2914,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "%s/packages.rpm ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥ê¥¹¥È¤ò¼èÆÀ¤·¤Æ¤¤¤Þ¤¹\n"
diff --git a/po/ko.po b/po/ko.po
index aed64b266..12170fa74 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2002-03-04 17:17+0900\n"
"Last-Translator: Jong-Hoon Ryu <redhat4u@netian.com>\n"
"Language-Team: GNU Translation project <ko@li.org>\n"
@@ -2805,7 +2805,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "%sÀÇ rpm µ¥ÀÌÅͺ£À̽º¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/no.po b/po/no.po
index 43707595c..bcb7b954f 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-06-27 12:24+0200\n"
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
"Language-Team: Norwegian <no@li.org>\n"
@@ -2784,7 +2784,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "kan ikke åpne database i %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "henter liste over monterte filsystemer\n"
diff --git a/po/pl.po b/po/pl.po
index bb7fa2feb..78501e307 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 1999-05-25 17:00+0100\n"
"Last-Translator: Pawe³ Dziekoñski <pdziekonski@mml.ch.pwr.wroc.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
@@ -2868,7 +2868,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "nie mo¿na otworzyæ %s/packages.rpm\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/pt.po b/po/pt.po
index 5e216621f..eb34095c6 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: rpm\n"
-"POT-Creation-Date: 2002-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2002-02-14 10:51+0000\n"
"Last-Translator: José Nuno Coelho Sanarra Pires <jncp@rnl.ist.utl.pt>\n"
"Language-Team: pt <morais@kde.org\n"
@@ -2814,7 +2814,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "não consigo a base de dados do RPM em %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 613381603..2fe0400bc 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -4,7 +4,7 @@
msgid ""
msgstr ""
"Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2002-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
#: build.c:40
#, fuzzy
@@ -3049,7 +3049,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "No consegui abrir: %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/ro.po b/po/ro.po
index 39f29bc34..9e1ae73ea 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2002-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 1999-04-10 12:00+EST\n"
"Last-Translator: Cristian Gafton <gafton@redhat.com>\n"
"Language-Team: Romanian <ro@li.org>\n"
@@ -2726,7 +2726,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/rpm.pot b/po/rpm.pot
index da5c72b77..70e4ad735 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2732,7 +2732,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 8df545ec7..1f6e87019 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2002-04-09 16:44-0400\n"
"Last-Translator: Eugene Kanter, <eugene@bcl.bz>\n"
"Language-Team: Black Cat Linux Team <blackcat-support@blackcatlinux.com>\n"
@@ -2813,7 +2813,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "ÎÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ÂÁÚÕ ÄÁÎÎÙÈ RPM × %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/sk.po b/po/sk.po
index d290fbca8..864c66e1c 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 1999-04-08 21:37+02:00\n"
"Last-Translator: Stanislav Meduna <stano@eunet.sk>\n"
"Language-Team: Slovak <sk-i18n@rak.isternet.sk>\n"
@@ -2864,7 +2864,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "nie je mo¾né otvori» %s/packages.rpm\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/sl.po b/po/sl.po
index 977e3ccdd..9d99a278d 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 <primoz.peterlin@biofiz.mf.uni-lj.si>, 2000.
-# $Id: sl.po,v 1.309 2002/08/08 22:21:11 jbj Exp $
+# $Id: sl.po,v 1.310 2002/08/09 22:26:04 jbj Exp $
#
msgid ""
msgstr ""
"Project-Id-Version: rpm 4.0.3\n"
-"POT-Creation-Date: 2002-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2000-10-08 19:05+0200\n"
"Last-Translator: Grega Fajdiga <gregor.fajdiga@telemach.net>\n"
"Language-Team: Slovenian <sl@li.org>\n"
@@ -2867,7 +2867,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "datoteke %s/packages.rpm ni mogo¾no odpreti\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "zbiranje seznama priklopljenih datoteènih sistemov.\n"
diff --git a/po/sr.po b/po/sr.po
index 47a03a05d..e61396565 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"Content-Type: text/plain; charset=\n"
"Date: 1998-05-02 21:41:47-0400\n"
@@ -2855,7 +2855,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "gre¹ka: ne mogu da otvorim %s%s/packages.rpm\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/sv.po b/po/sv.po
index 4f0e04b20..3fd99c8bf 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2002-07-11 22:49+0200\n"
"Last-Translator: Göran Uddeborg <goeran@uddeborg.pp.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
@@ -2771,7 +2771,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "kan inte öppna paketdatabas i %s\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "hämtar lista över monterade filsystem\n"
diff --git a/po/tr.po b/po/tr.po
index c341b7f70..fee55e143 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-0400\n"
"PO-Revision-Date: 2001-07-05 08:02+300\n"
"Last-Translator: Nilgun Belma Buguner <nilgun@technologist.com>\n"
"Language-Team: Turkish <tr@li.org>\n"
@@ -2827,7 +2827,7 @@ msgid "cannot open Solve database in %s\n"
msgstr "%s dizininde rpm veritabaný açýlamýyor\n"
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr "baðlý dosya sistemlerinin listesi alýnýyor\n"
diff --git a/po/uk.po b/po/uk.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/wa.po b/po/wa.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/zh.po b/po/zh.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/po/zh_CN.GB2312.po b/po/zh_CN.GB2312.po
index 10d8e4a26..e8bb766e4 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-08-08 18:03-0400\n"
+"POT-Creation-Date: 2002-08-09 18:19-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"
@@ -2731,7 +2731,7 @@ msgid "cannot open Solve database in %s\n"
msgstr ""
#. Get available space on mounted file systems.
-#: lib/rpmts.c:797
+#: lib/rpmts.c:809
msgid "getting list of mounted filesystems\n"
msgstr ""
diff --git a/python/rpmts-py.c b/python/rpmts-py.c
index 1eba25acc..9864279e3 100644
--- a/python/rpmts-py.c
+++ b/python/rpmts-py.c
@@ -12,9 +12,9 @@
#include <rpmcli.h>
#include <rpmpgp.h>
+#include <rpmdb.h>
#include "header-py.h"
-#include "rpmdb-py.h"
#include "rpmds-py.h" /* XXX for rpmdsNew */
#include "rpmfi-py.h" /* XXX for rpmfiNew */
#include "rpmmi-py.h"
@@ -144,6 +144,16 @@ static int _rpmts_debug = 0;
/** \ingroup python
*/
+struct rpmtsCallbackType_s {
+ PyObject * cb;
+ PyObject * data;
+ rpmtsObject * tso;
+ int pythonError;
+ PyThreadState *_save;
+};
+
+/** \ingroup python
+ */
static PyObject *
rpmts_Debug(/*@unused@*/ rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -267,6 +277,43 @@ fprintf(stderr, "*** rpmts_AddErase(%p) ts %p\n", s, s->ts);
/** \ingroup python
*/
+static int
+rpmts_SolveCallback(rpmts ts, rpmds ds, void * data)
+ /*@*/
+{
+ struct rpmtsCallbackType_s * cbInfo = data;
+ PyObject * args, * result;
+ int res = 1;
+
+if (_rpmts_debug)
+fprintf(stderr, "*** rpmts_SolveCallback(%p,%p,%p) %s\n", ts, ds, data, rpmdsDNEVR(ds));
+
+ if (cbInfo->tso == NULL) return res;
+ if (cbInfo->pythonError) return res;
+ if (cbInfo->cb == Py_None) return res;
+
+ PyEval_RestoreThread(cbInfo->_save);
+
+ args = Py_BuildValue("(Oissi)", cbInfo->tso,
+ rpmdsTagN(ds), rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds));
+ result = PyEval_CallObject(cbInfo->cb, args);
+ Py_DECREF(args);
+
+ if (!result) {
+ cbInfo->pythonError = 1;
+ } else {
+ if (PyInt_Check(result))
+ res = PyInt_AsLong(result);
+ Py_DECREF(result);
+ }
+
+ cbInfo->_save = PyEval_SaveThread();
+
+ return res;
+}
+
+/** \ingroup python
+ */
static PyObject *
rpmts_Check(rpmtsObject * s, PyObject * args)
/*@globals _Py_NoneStruct @*/
@@ -275,20 +322,40 @@ rpmts_Check(rpmtsObject * s, PyObject * args)
rpmps ps;
rpmProblem p;
PyObject * list, * cf;
+ struct rpmtsCallbackType_s cbInfo;
int i;
- int allSuggestions = 0;
int xx;
+ pemset(&cbInfo, 0, sizeof(cbInfo));
+ if (!PyArg_ParseTuple(args, "|O:Check", &cbInfo.cb))
+ return NULL;
+
+ if (cbInfo.cb != NULL) {
+ if (!PyCallable_Check(cbInfo.cb)) {
+ PyErr_SetString(PyExc_TypeError, "expected a callable");
+ return NULL;
+ }
+ xx = rpmtsSetSolveCallback(s->ts, rpmts_SolveCallback, (void *)&cbInfo);
+ }
+
if (_rpmts_debug)
-fprintf(stderr, "*** rpmts_Check(%p) ts %p\n", s, s->ts);
+fprintf(stderr, "*** rpmts_Check(%p) ts %p cb %p\n", s, s->ts, cbInfo.cb);
- if (!PyArg_ParseTuple(args, "|i:Check", &allSuggestions)) return NULL;
+ cbInfo.tso = s;
+ cbInfo.pythonError = 0;
+ cbInfo._save = PyEval_SaveThread();
- Py_BEGIN_ALLOW_THREADS
- xx = rpmtsCheck(s->ts);
+ if (cbInfo.cb)
+ xx = rpmtsCheck(s->ts);
ps = rpmtsProblems(s->ts);
- Py_END_ALLOW_THREADS
+
+ if (cbInfo.cb) {
+ xx = rpmtsSetSolveCallback(s->ts, rpmtsSolve, NULL);
+ }
+
+ PyEval_RestoreThread(cbInfo._save);
+
if (ps) {
list = PyList_New(0);
@@ -832,15 +899,6 @@ fprintf(stderr, "*** rpmts_GetKeys(%p) ts %p\n", s, s->ts);
/** \ingroup python
*/
-struct rpmtsCallbackType_s {
- PyObject * cb;
- PyObject * data;
- int pythonError;
- PyThreadState *_save;
-};
-
-/** \ingroup python
- */
static void *
rpmtsCallback(/*@unused@*/ const void * hd, const rpmCallbackType what,
const unsigned long amount, const unsigned long total,
@@ -916,19 +974,30 @@ static PyObject * rpmts_Run(rpmtsObject * s, PyObject * args)
&cbInfo.data))
return NULL;
+ cbInfo.tso = s;
cbInfo.pythonError = 0;
cbInfo._save = PyEval_SaveThread();
- (void) rpmtsSetNotifyCallback(s->ts, rpmtsCallback, (void *) &cbInfo);
+ if (cbInfo.cb != NULL) {
+ if (!PyCallable_Check(cbInfo.cb)) {
+ PyErr_SetString(PyExc_TypeError, "expected a callable");
+ return NULL;
+ }
+ (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);
+ if (cbInfo.cb) {
+ (void) rpmtsSetNotifyCallback(s->ts, NULL, NULL);
+ }
+
PyEval_RestoreThread(cbInfo._save);
if (cbInfo.pythonError) {
diff --git a/rpm.spec.in b/rpm.spec.in
index 376b4a5e8..59309f809 100644
--- a/rpm.spec.in
+++ b/rpm.spec.in
@@ -517,9 +517,10 @@ fi
%{__prefix}/include/popt.h
%changelog
-* Thu Aug 8 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.76
+* Fri Aug 9 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.76
- python: add return codes for rollbacks and fooDB methods.
- avoid generating fingerprints for locale/zoneinfo sub-directories.
+- python: add (optional) ts.check() callback.
* Wed Aug 7 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.75
- fix: src.rpm installs need fd pos at payload.