diff options
author | jbj <devnull@localhost> | 2002-08-09 22:25:04 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-08-09 22:25:04 +0000 |
commit | 7937158c01c71774eb5872f742a9d9c771df5b79 (patch) | |
tree | 266dc866f50b92e40c23b39df7f2be6e79719ff7 | |
parent | c961f3f78e34e77989f603dcdd92e269bbe15546 (diff) | |
download | librpm-tizen-7937158c01c71774eb5872f742a9d9c771df5b79.tar.gz librpm-tizen-7937158c01c71774eb5872f742a9d9c771df5b79.tar.bz2 librpm-tizen-7937158c01c71774eb5872f742a9d9c771df5b79.zip |
- python: add (optional) ts.check() callback.
CVS patchset: 5619
CVS date: 2002/08/09 22:25:04
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/depends.c | 2 | ||||
-rw-r--r-- | lib/rpmts.c | 15 | ||||
-rw-r--r-- | lib/rpmts.h | 22 | ||||
-rw-r--r-- | po/cs.po | 4 | ||||
-rw-r--r-- | po/da.po | 4 | ||||
-rw-r--r-- | po/de.po | 4 | ||||
-rw-r--r-- | po/en_RN.po | 4 | ||||
-rw-r--r-- | po/es.po | 4 | ||||
-rw-r--r-- | po/eu_ES.po | 4 | ||||
-rw-r--r-- | po/fi.po | 4 | ||||
-rw-r--r-- | po/fr.po | 4 | ||||
-rw-r--r-- | po/gl.po | 4 | ||||
-rw-r--r-- | po/hu.po | 4 | ||||
-rw-r--r-- | po/id.po | 4 | ||||
-rw-r--r-- | po/is.po | 4 | ||||
-rw-r--r-- | po/it.po | 4 | ||||
-rw-r--r-- | po/ja.po | 4 | ||||
-rw-r--r-- | po/ko.po | 4 | ||||
-rw-r--r-- | po/no.po | 4 | ||||
-rw-r--r-- | po/pl.po | 4 | ||||
-rw-r--r-- | po/pt.po | 4 | ||||
-rw-r--r-- | po/pt_BR.po | 4 | ||||
-rw-r--r-- | po/ro.po | 4 | ||||
-rw-r--r-- | po/rpm.pot | 4 | ||||
-rw-r--r-- | po/ru.po | 4 | ||||
-rw-r--r-- | po/sk.po | 4 | ||||
-rw-r--r-- | po/sl.po | 6 | ||||
-rw-r--r-- | po/sr.po | 4 | ||||
-rw-r--r-- | po/sv.po | 4 | ||||
-rw-r--r-- | po/tr.po | 4 | ||||
-rw-r--r-- | po/uk.po | 4 | ||||
-rw-r--r-- | po/wa.po | 4 | ||||
-rw-r--r-- | po/zh.po | 4 | ||||
-rw-r--r-- | po/zh_CN.GB2312.po | 4 | ||||
-rw-r--r-- | python/rpmts-py.c | 105 | ||||
-rw-r--r-- | rpm.spec.in | 3 |
37 files changed, 186 insertions, 88 deletions
@@ -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) @@ -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" @@ -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" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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" @@ -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 "" @@ -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" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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 "" @@ -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" @@ -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 "" @@ -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" @@ -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" @@ -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 "" @@ -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 "" @@ -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. |