Main Page Modules Data Structures File List Data Fields Globals Related Pages

# python/rpmmodule.c

Go to the documentation of this file.

    00001
    00005 #include "system.h"
    00006
    00007 #include "Python.h"
    00008 #ifdef __LCLINT__
    00009 #undef  PyObject_HEAD
    00010 #define PyObject_HEAD   int _PyObjectHead;
    00011 #endif
    00012
    00013 #include <rpmcli.h>     /* XXX for rpmCheckSig */
    00014 #include <rpmdb.h>
    00015
    00016 #include "legacy.h"
    00017 #include "misc.h"
    00018 #include "header_internal.h"
    00019 #include "upgrade.h"
    00020
    00021 #include "header-py.h"
    00022 #include "rpmal-py.h"
    00023 #include "rpmds-py.h"
    00024 #include "rpmfd-py.h"
    00025 #include "rpmfi-py.h"
    00026 #include "rpmmi-py.h"
    00027 #include "rpmrc-py.h"
    00028 #include "rpmte-py.h"
    00029 #include "rpmts-py.h"
    00030
    00031 #include "debug.h"
    00032
    00033 #ifdef __LCLINT__
    00034 #undef  PyObject_HEAD
    00035 #define PyObject_HEAD   int _PyObjectHead
    00036 #endif
    00037
    00042
    00045 static PyObject * archScore(PyObject * self, PyObject * args)
    00046 {
    00047     char * arch;
    00048     int score;
    00049
    00050     if (!PyArg_ParseTuple(args, "s", &arch))
    00051         return NULL;
    00052
    00053     score = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch);
    00054
    00055     return Py_BuildValue("i", score);
    00056 }
    00057
    00060 static int psGetArchScore(Header h)
    00061 {
    00062     void * pkgArch;
    00063     int type, count;
    00064
    00065     if (!headerGetEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &count) ||
    00066         type == RPM_INT8_TYPE)
    00067        return 150;
    00068     else
    00069         return rpmMachineScore(RPM_MACHTABLE_INSTARCH, pkgArch);
    00070 }
    00071
    00074 static int pkgCompareVer(void * first, void * second)
    00075 {
    00076     struct packageInfo ** a = first;
    00077     struct packageInfo ** b = second;
    00078     int ret, score1, score2;
    00079
    00080     /* put packages w/o names at the end */
    00081     if (!(*a)->name) return 1;
    00082     if (!(*b)->name) return -1;
    00083
    00084     ret = xstrcasecmp((*a)->name, (*b)->name);
    00085     if (ret) return ret;
    00086     score1 = psGetArchScore((*a)->h);
    00087     if (!score1) return 1;
    00088     score2 = psGetArchScore((*b)->h);
    00089     if (!score2) return -1;
    00090     if (score1 < score2) return -1;
    00091     if (score1 > score2) return 1;
    00092     return rpmVersionCompare((*b)->h, (*a)->h);
    00093 }
    00094
    00097 static void pkgSort(struct pkgSet * psp)
    00098 {
    00099     int i;
    00100     char *name;
    00101
    00102     if (psp->numPackages <= 0)
    00103         return;
    00104
    00105     qsort(psp->packages, psp->numPackages, sizeof(*psp->packages),
    00106          (void *) pkgCompareVer);
    00107
    00108     name = psp->packages[0]->name;
    00109     if (!name) {
    00110        psp->numPackages = 0;
    00111        return;
    00112     }
    00113     for (i = 1; i < psp->numPackages; i++) {
    00114        if (!psp->packages[i]->name) break;
    00115        if (!strcmp(psp->packages[i]->name, name))
    00116            psp->packages[i]->name = NULL;
    00117        else
    00118            name = psp->packages[i]->name;
    00119     }
    00120
    00121     qsort(psp->packages, psp->numPackages, sizeof(*psp->packages),
    00122          (void *) pkgCompareVer);
    00123
    00124     for (i = 0; i < psp->numPackages; i++)
    00125        if (!psp->packages[i]->name) break;
    00126     psp->numPackages = i;
    00127 }
    00128
    00131 static PyObject * findUpgradeSet(PyObject * self, PyObject * args)
    00132 {
    00133     PyObject * hdrList, * result;
    00134     char * root = "/";
    00135     int i;
    00136     struct pkgSet list;
    00137     hdrObject * hdr;
    00138
    00139     if (!PyArg_ParseTuple(args, "O|s", &hdrList, &root)) return NULL;
    00140
    00141     if (!PyList_Check(hdrList)) {
    00142         PyErr_SetString(PyExc_TypeError, "list of headers expected");
    00143         return NULL;
    00144     }
    00145
    00146     list.numPackages = PyList_Size(hdrList);
    00147     list.packages = alloca(sizeof(list.packages) * list.numPackages);
    00148     for (i = 0; i < list.numPackages; i++) {
    00149         hdr = (hdrObject *) PyList_GetItem(hdrList, i);
    00150         if (((PyObject *) hdr)->ob_type != &hdr_Type) {
    00151             PyErr_SetString(PyExc_TypeError, "list of headers expected");
    00152             return NULL;
    00153         }
    00154         list.packages[i] = alloca(sizeof(struct packageInfo));
    00155         list.packages[i]->h = hdrGetHeader(hdr);
    00156         list.packages[i]->selected = 0;
    00157         list.packages[i]->data = hdr;
    00158
    00159         headerGetEntry(list.packages[i]->h, RPMTAG_NAME, NULL,
    00160                       (void **) &list.packages[i]->name, NULL);
    00161     }
    00162
    00163     pkgSort (&list);
    00164
    00165     if (ugFindUpgradePackages(&list, root)) {
    00166         PyErr_SetString(pyrpmError, "error during upgrade check");
    00167         return NULL;
    00168     }
    00169
    00170     result = PyList_New(0);
    00171     for (i = 0; i < list.numPackages; i++) {
    00172         if (list.packages[i]->selected) {
    00173             PyList_Append(result, list.packages[i]->data);
    00174 /*          Py_DECREF(list.packages[i]->data); */
    00175         }
    00176     }
    00177
    00178     return result;
    00179 }
    00180
    00183 static PyObject * errorCB = NULL;
    00184 static PyObject * errorData = NULL;
    00185
    00188 static void errorcb (void)
    00189 {
    00190     PyObject * result, * args = NULL;
    00191
    00192     if (errorData)
    00193         args = Py_BuildValue("(O)", errorData);
    00194
    00195     result = PyEval_CallObject(errorCB, args);
    00196     Py_XDECREF(args);
    00197
    00198     if (result == NULL) {
    00199         PyErr_Print();
    00200         PyErr_Clear();
    00201     }
    00202     Py_DECREF (result);
    00203 }
    00204
    00207 static PyObject * errorSetCallback (PyObject * self, PyObject * args)
    00208 {
    00209     PyObject *newCB = NULL, *newData = NULL;
    00210
    00211     if (!PyArg_ParseTuple(args, "O|O", &newCB, &newData)) return NULL;
    00212
    00213     /* if we're getting a void*, set the error callback to this. */
    00214     /* also, we can possibly decref any python callbacks we had  */
    00215     /* and set them to NULL.                                     */
    00216     if (PyCObject_Check (newCB)) {
    00217         rpmErrorSetCallback (PyCObject_AsVoidPtr(newCB));
    00218
    00219         Py_XDECREF (errorCB);
    00220         Py_XDECREF (errorData);
    00221
    00222         errorCB   = NULL;
    00223         errorData = NULL;
    00224
    00225         Py_INCREF(Py_None);
    00226         return Py_None;
    00227     }
    00228
    00229     if (!PyCallable_Check (newCB)) {
    00230         PyErr_SetString(PyExc_TypeError, "parameter must be callable");
    00231         return NULL;
    00232     }
    00233
    00234     Py_XDECREF(errorCB);
    00235     Py_XDECREF(errorData);
    00236
    00237     errorCB = newCB;
    00238     errorData = newData;
    00239
    00240     Py_INCREF (errorCB);
    00241     Py_XINCREF (errorData);
    00242
    00243     return PyCObject_FromVoidPtr(rpmErrorSetCallback (errorcb), NULL);
    00244 }
    00245
    00248 static PyObject * errorString (PyObject * self, PyObject * args)
    00249 {
    00250     return PyString_FromString(rpmErrorString ());
    00251 }
    00252
    00255 static PyObject * setVerbosity (PyObject * self, PyObject * args)
    00256 {
    00257     int level;
    00258
    00259     if (!PyArg_ParseTuple(args, "i", &level))
    00260         return NULL;
    00261
    00262     rpmSetVerbosity(level);
    00263
    00264     Py_INCREF(Py_None);
    00265     return (PyObject *) Py_None;
    00266 }
    00267
    00270 static PyObject * setEpochPromote (PyObject * self, PyObject * args)
    00271 {
    00272     if (!PyArg_ParseTuple(args, "i", &_rpmds_nopromote))
    00273         return NULL;
    00274     Py_INCREF(Py_None);
    00275     return (PyObject *) Py_None;
    00276 }
    00277
    00280 static PyMethodDef rpmModuleMethods[] = {
    00281     { "TransactionSet", (PyCFunction) rpmts_Create, METH_VARARGS,
    00282 "rpm.TransactionSet([rootDir, [db]]) -> ts\n\
    00283 - Create a transaction set.\n" },
    00284
    00285 #if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
    00286     { "newrc", (PyCFunction) rpmrc_Create, METH_VARARGS|METH_KEYWORDS,
    00287         NULL },
    00288 #endif
    00289     { "addMacro", (PyCFunction) rpmrc_AddMacro, METH_VARARGS,
    00290         NULL },
    00291     { "delMacro", (PyCFunction) rpmrc_DelMacro, METH_VARARGS,
    00292         NULL },
    00293
    00294     { "archscore", (PyCFunction) archScore, METH_VARARGS,
    00295         NULL },
    00296     { "findUpgradeSet", (PyCFunction) findUpgradeSet, METH_VARARGS,
    00297         NULL },
    00298     { "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS,
    00299         NULL },
    00300     { "rhnLoad", (PyCFunction) rhnLoad, METH_VARARGS,
    00301         NULL },
    00302     { "mergeHeaderListFromFD", (PyCFunction) rpmMergeHeadersFromFD, METH_VARARGS,
    00303         NULL },
    00304     { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS,
    00305         NULL },
    00306     { "readHeaderListFromFile", (PyCFunction) rpmHeaderFromFile, METH_VARARGS,
    00307         NULL },
    00308     { "errorSetCallback", (PyCFunction) errorSetCallback, METH_VARARGS,
    00309         NULL },
    00310     { "errorString", (PyCFunction) errorString, METH_VARARGS,
    00311         NULL },
    00312     { "versionCompare", (PyCFunction) versionCompare, METH_VARARGS,
    00313         NULL },
    00314     { "labelCompare", (PyCFunction) labelCompare, METH_VARARGS,
    00315         NULL },
    00316     { "setVerbosity", (PyCFunction) setVerbosity, METH_VARARGS,
    00317         NULL },
    00318     { "setEpochPromote", (PyCFunction) setEpochPromote, METH_VARARGS,
    00319         NULL },
    00320     { "dsSingle", (PyCFunction) rpmds_Single, METH_VARARGS,
    00321 "rpm.dsSingle(TagN, N, [EVR, [Flags]] -> ds\n\
    00322 - Create a single element dependency set.\n" },
    00323     { NULL }
    00324 } ;
    00325
    00328 static char rpm__doc__[] =
    00329 "";
    00330
    00331 void initrpm(void);     /* XXX eliminate gcc warning */
    00334 void initrpm(void)
    00335 {
    00336     PyObject * d, *o, * tag = NULL, * dict;
    00337     int i;
    00338     const struct headerSprintfExtension_s * extensions = rpmHeaderFormats;
    00339     struct headerSprintfExtension_s * ext;
    00340     PyObject * m;
    00341
    00342 #if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
    00343     if (PyType_Ready(&hdr_Type) < 0) return;
    00344     if (PyType_Ready(&rpmal_Type) < 0) return;
    00345     if (PyType_Ready(&rpmds_Type) < 0) return;
    00346     if (PyType_Ready(&rpmfd_Type) < 0) return;
    00347     if (PyType_Ready(&rpmfi_Type) < 0) return;
    00348     if (PyType_Ready(&rpmmi_Type) < 0) return;
    00349
    00350     rpmrc_Type.tp_base = &PyDict_Type;
    00351     if (PyType_Ready(&rpmrc_Type) < 0) return;
    00352
    00353     if (PyType_Ready(&rpmte_Type) < 0) return;
    00354     if (PyType_Ready(&rpmts_Type) < 0) return;
    00355 #endif
    00356
    00357     m = Py_InitModule3("rpm", rpmModuleMethods, rpm__doc__);
    00358     if (m == NULL)
    00359         return;
    00360
    00361     rpmReadConfigFiles(NULL, NULL);
    00362
    00363     d = PyModule_GetDict(m);
    00364
    00365 #ifdef  HACK
    00366     pyrpmError = PyString_FromString("rpm.error");
    00367     PyDict_SetItemString(d, "error", pyrpmError);
    00368     Py_DECREF(pyrpmError);
    00369 #else
    00370     pyrpmError = PyErr_NewException("rpm.error", NULL, NULL);
    00371     if (pyrpmError != NULL)
    00372         PyDict_SetItemString(d, "error", pyrpmError);
    00373 #endif
    00374
    00375 #if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
    00376     Py_INCREF(&hdr_Type);
    00377     PyModule_AddObject(m, "hdr", (PyObject *) &hdr_Type);
    00378
    00379     Py_INCREF(&rpmal_Type);
    00380     PyModule_AddObject(m, "al", (PyObject *) &rpmal_Type);
    00381
    00382     Py_INCREF(&rpmds_Type);
    00383     PyModule_AddObject(m, "ds", (PyObject *) &rpmds_Type);
    00384
    00385     Py_INCREF(&rpmfd_Type);
    00386     PyModule_AddObject(m, "fd", (PyObject *) &rpmfd_Type);
    00387
    00388     Py_INCREF(&rpmfi_Type);
    00389     PyModule_AddObject(m, "fi", (PyObject *) &rpmfi_Type);
    00390
    00391     Py_INCREF(&rpmmi_Type);
    00392     PyModule_AddObject(m, "mi", (PyObject *) &rpmmi_Type);
    00393
    00394     Py_INCREF(&rpmrc_Type);
    00395     PyModule_AddObject(m, "rc", (PyObject *) &rpmrc_Type);
    00396
    00397     Py_INCREF(&rpmte_Type);
    00398     PyModule_AddObject(m, "te", (PyObject *) &rpmte_Type);
    00399
    00400     Py_INCREF(&rpmts_Type);
    00401     PyModule_AddObject(m, "ts", (PyObject *) &rpmts_Type);
    00402 #else
    00403     hdr_Type.ob_type = &PyType_Type;
    00404     rpmal_Type.ob_type = &PyType_Type;
    00405     rpmds_Type.ob_type = &PyType_Type;
    00406     rpmfd_Type.ob_type = &PyType_Type;
    00407     rpmfi_Type.ob_type = &PyType_Type;
    00408     rpmmi_Type.ob_type = &PyType_Type;
    00409     rpmte_Type.ob_type = &PyType_Type;
    00410     rpmts_Type.ob_type = &PyType_Type;
    00411 #endif
    00412
    00413     dict = PyDict_New();
    00414
    00415     for (i = 0; i < rpmTagTableSize; i++) {
    00416         tag = PyInt_FromLong(rpmTagTable[i].val);
    00417         PyDict_SetItemString(d, (char *) rpmTagTable[i].name, tag);
    00418         Py_DECREF(tag);
    00419         PyDict_SetItem(dict, tag, o=PyString_FromString(rpmTagTable[i].name + 7));
    00420         Py_DECREF(o);
    00421     }
    00422
    00423     while (extensions->name) {
    00424         if (extensions->type == HEADER_EXT_TAG) {
    00425             (const struct headerSprintfExtension *) ext = extensions;
    00426             PyDict_SetItemString(d, (char *) extensions->name, o=PyCObject_FromVoidPtr(ext, NULL));
    00427             Py_DECREF(o);
    00428             PyDict_SetItem(dict, tag, o=PyString_FromString(ext->name + 7));
    00429             Py_DECREF(o);
    00430         }
    00431         extensions++;
    00432     }
    00433
    00434     PyDict_SetItemString(d, "tagnames", dict);
    00435     Py_DECREF(dict);
    00436
    00437
    00438 #define REGISTER_ENUM(val) \
    00439     PyDict_SetItemString(d, #val, o=PyInt_FromLong( val )); \
    00440     Py_DECREF(o);
    00441
    00442     REGISTER_ENUM(RPMFILE_STATE_NORMAL);
    00443     REGISTER_ENUM(RPMFILE_STATE_REPLACED);
    00444     REGISTER_ENUM(RPMFILE_STATE_NOTINSTALLED);
    00445     REGISTER_ENUM(RPMFILE_STATE_NETSHARED);
    00446
    00447     REGISTER_ENUM(RPMFILE_CONFIG);
    00448     REGISTER_ENUM(RPMFILE_DOC);
    00449     REGISTER_ENUM(RPMFILE_MISSINGOK);
    00450     REGISTER_ENUM(RPMFILE_NOREPLACE);
    00451     REGISTER_ENUM(RPMFILE_GHOST);
    00452     REGISTER_ENUM(RPMFILE_LICENSE);
    00453     REGISTER_ENUM(RPMFILE_README);
    00454
    00455     REGISTER_ENUM(RPMDEP_SENSE_REQUIRES);
    00456     REGISTER_ENUM(RPMDEP_SENSE_CONFLICTS);
    00457
    00458     REGISTER_ENUM(RPMSENSE_SERIAL);
    00459     REGISTER_ENUM(RPMSENSE_LESS);
    00460     REGISTER_ENUM(RPMSENSE_GREATER);
    00461     REGISTER_ENUM(RPMSENSE_EQUAL);
    00462     REGISTER_ENUM(RPMSENSE_PREREQ);
    00463     REGISTER_ENUM(RPMSENSE_INTERP);
    00464     REGISTER_ENUM(RPMSENSE_SCRIPT_PRE);
    00465     REGISTER_ENUM(RPMSENSE_SCRIPT_POST);
    00466     REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN);
    00467     REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN);
    00468     REGISTER_ENUM(RPMSENSE_SCRIPT_VERIFY);
    00469     REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
    00470     REGISTER_ENUM(RPMSENSE_FIND_PROVIDES);
    00471     REGISTER_ENUM(RPMSENSE_TRIGGERIN);
    00472     REGISTER_ENUM(RPMSENSE_TRIGGERUN);
    00473     REGISTER_ENUM(RPMSENSE_TRIGGERPOSTUN);
    00474     REGISTER_ENUM(RPMSENSE_MULTILIB);
    00475     REGISTER_ENUM(RPMSENSE_SCRIPT_PREP);
    00476     REGISTER_ENUM(RPMSENSE_SCRIPT_BUILD);
    00477     REGISTER_ENUM(RPMSENSE_SCRIPT_INSTALL);
    00478     REGISTER_ENUM(RPMSENSE_SCRIPT_CLEAN);
    00479     REGISTER_ENUM(RPMSENSE_RPMLIB);
    00480     REGISTER_ENUM(RPMSENSE_TRIGGERPREIN);
    00481     REGISTER_ENUM(RPMSENSE_KEYRING);
    00482     REGISTER_ENUM(RPMSENSE_PATCHES);
    00483
    00484     REGISTER_ENUM(RPMTRANS_FLAG_TEST);
    00485     REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS);
    00486     REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS);
    00487     REGISTER_ENUM(RPMTRANS_FLAG_JUSTDB);
    00488     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERS);
    00489     REGISTER_ENUM(RPMTRANS_FLAG_NODOCS);
    00490     REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES);
    00491     REGISTER_ENUM(RPMTRANS_FLAG_KEEPOBSOLETE);
    00492     REGISTER_ENUM(RPMTRANS_FLAG_MULTILIB);
    00493     REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE);
    00494     REGISTER_ENUM(RPMTRANS_FLAG_NOPRE);
    00495     REGISTER_ENUM(RPMTRANS_FLAG_NOPOST);
    00496     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERIN);
    00497     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERUN);
    00498     REGISTER_ENUM(RPMTRANS_FLAG_NOPREUN);
    00499     REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
    00500     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
    00501     REGISTER_ENUM(RPMTRANS_FLAG_CHAINSAW);
    00502     REGISTER_ENUM(RPMTRANS_FLAG_NOMD5);
    00503     REGISTER_ENUM(RPMTRANS_FLAG_NOSUGGEST);
    00504     REGISTER_ENUM(RPMTRANS_FLAG_ADDINDEPS);
    00505
    00506     REGISTER_ENUM(RPMPROB_FILTER_IGNOREOS);
    00507     REGISTER_ENUM(RPMPROB_FILTER_IGNOREARCH);
    00508     REGISTER_ENUM(RPMPROB_FILTER_REPLACEPKG);
    00509     REGISTER_ENUM(RPMPROB_FILTER_FORCERELOCATE);
    00510     REGISTER_ENUM(RPMPROB_FILTER_REPLACENEWFILES);
    00511     REGISTER_ENUM(RPMPROB_FILTER_REPLACEOLDFILES);
    00512     REGISTER_ENUM(RPMPROB_FILTER_OLDPACKAGE);
    00513     REGISTER_ENUM(RPMPROB_FILTER_DISKSPACE);
    00514     REGISTER_ENUM(RPMPROB_FILTER_DISKNODES);
    00515
    00516     REGISTER_ENUM(RPMCALLBACK_UNKNOWN);
    00517     REGISTER_ENUM(RPMCALLBACK_INST_PROGRESS);
    00518     REGISTER_ENUM(RPMCALLBACK_INST_START);
    00519     REGISTER_ENUM(RPMCALLBACK_INST_OPEN_FILE);
    00520     REGISTER_ENUM(RPMCALLBACK_INST_CLOSE_FILE);
    00521     REGISTER_ENUM(RPMCALLBACK_TRANS_PROGRESS);
    00522     REGISTER_ENUM(RPMCALLBACK_TRANS_START);
    00523     REGISTER_ENUM(RPMCALLBACK_TRANS_STOP);
    00524     REGISTER_ENUM(RPMCALLBACK_UNINST_PROGRESS);
    00525     REGISTER_ENUM(RPMCALLBACK_UNINST_START);
    00526     REGISTER_ENUM(RPMCALLBACK_UNINST_STOP);
    00527     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_PROGRESS);
    00528     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_START);
    00529     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_STOP);
    00530     REGISTER_ENUM(RPMCALLBACK_UNPACK_ERROR);
    00531     REGISTER_ENUM(RPMCALLBACK_CPIO_ERROR);
    00532
    00533     REGISTER_ENUM(RPMPROB_BADARCH);
    00534     REGISTER_ENUM(RPMPROB_BADOS);
    00535     REGISTER_ENUM(RPMPROB_PKG_INSTALLED);
    00536     REGISTER_ENUM(RPMPROB_BADRELOCATE);
    00537     REGISTER_ENUM(RPMPROB_REQUIRES);
    00538     REGISTER_ENUM(RPMPROB_CONFLICT);
    00539     REGISTER_ENUM(RPMPROB_NEW_FILE_CONFLICT);
    00540     REGISTER_ENUM(RPMPROB_FILE_CONFLICT);
    00541     REGISTER_ENUM(RPMPROB_OLDPACKAGE);
    00542     REGISTER_ENUM(RPMPROB_DISKSPACE);
    00543     REGISTER_ENUM(RPMPROB_DISKNODES);
    00544     REGISTER_ENUM(RPMPROB_BADPRETRANS);
    00545
    00546     REGISTER_ENUM(VERIFY_DIGEST);
    00547     REGISTER_ENUM(VERIFY_SIGNATURE);
    00548
    00549     REGISTER_ENUM(RPMLOG_EMERG);
    00550     REGISTER_ENUM(RPMLOG_ALERT);
    00551     REGISTER_ENUM(RPMLOG_CRIT);
    00552     REGISTER_ENUM(RPMLOG_ERR);
    00553     REGISTER_ENUM(RPMLOG_WARNING);
    00554     REGISTER_ENUM(RPMLOG_NOTICE);
    00555     REGISTER_ENUM(RPMLOG_INFO);
    00556     REGISTER_ENUM(RPMLOG_DEBUG);
    00557
    00558     REGISTER_ENUM(RPMMIRE_DEFAULT);
    00559     REGISTER_ENUM(RPMMIRE_STRCMP);
    00560     REGISTER_ENUM(RPMMIRE_REGEX);
    00561     REGISTER_ENUM(RPMMIRE_GLOB);
    00562
    00563     REGISTER_ENUM(RPMVSF_DEFAULT);
    00564     REGISTER_ENUM(RPMVSF_NOHDRCHK);
    00565     REGISTER_ENUM(RPMVSF_NEEDPAYLOAD);
    00566     REGISTER_ENUM(RPMVSF_NOSHA1HEADER);
    00567     REGISTER_ENUM(RPMVSF_NOMD5HEADER);
    00568     REGISTER_ENUM(RPMVSF_NODSAHEADER);
    00569     REGISTER_ENUM(RPMVSF_NORSAHEADER);
    00570     REGISTER_ENUM(RPMVSF_NOSHA1);
    00571     REGISTER_ENUM(RPMVSF_NOMD5);
    00572     REGISTER_ENUM(RPMVSF_NODSA);
    00573     REGISTER_ENUM(RPMVSF_NORSA);
    00574     REGISTER_ENUM(_RPMVSF_NODIGESTS);
    00575     REGISTER_ENUM(_RPMVSF_NOSIGNATURES);
    00576     REGISTER_ENUM(_RPMVSF_NOHEADER);
    00577     REGISTER_ENUM(_RPMVSF_NOPAYLOAD);
    00578
    00579     PyDict_SetItemString(d, "RPMAL_NOMATCH", o=PyInt_FromLong( (long)RPMAL_NOMATCH ));
    00580     Py_DECREF(o);
    00581 }
    00582