rpm 5.2.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

python/rpmmodule.c
Go to the documentation of this file.

    00001
    00005 #include "system.h"
    00006
    00007 #include <rpmio_internal.h>
    00008 #include <rpmcb.h>
    00009 #include <rpmsq.h>
    00010 #include <argv.h>
    00011
    00012 #define _RPMTAG_INTERNAL
    00013 #include <rpmtag.h>
    00014 #define _RPMEVR_INTERNAL
    00015 #include <rpmevr.h>
    00016 #include <rpmdb.h>
    00017 #include <rpmcli.h>     /* XXX for rpmCheckSig */
    00018
    00019 #include "legacy.h"
    00020 #include "misc.h"
    00021
    00022 #include "header-py.h"
    00023 #include "rpmal-py.h"
    00024 #include "rpmds-py.h"
    00025 #include "rpmfd-py.h"
    00026 #include "rpmfts-py.h"
    00027 #include "rpmfi-py.h"
    00028 #include "rpmkeyring-py.h"
    00029 #include "rpmmacro-py.h"
    00030 #include "rpmmi-py.h"
    00031 #include "rpmps-py.h"
    00032 #include "rpmtd-py.h"
    00033 #include "rpmte-py.h"
    00034 #include "rpmts-py.h"
    00035 #include "spec-py.h"
    00036
    00037 #include "debug.h"
    00038
    00039 #ifdef __LCLINT__
    00040 #undef  PyObject_HEAD
    00041 #define PyObject_HEAD   int _PyObjectHead
    00042 #endif
    00043
    00048
    00051 PyObject * pyrpmError;
    00052
    00053 extern sigset_t rpmsqCaught;
    00054
    00057 static PyObject * archScore(PyObject * s, PyObject * args,
    00058                 PyObject * kwds)
    00059 {
    00060     char * arch;
    00061     char * platform;
    00062     int score;
    00063     char * kwlist[] = {"arch", NULL};
    00064
    00065     if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
    00066         return NULL;
    00067
    00068 #if defined(RPM_VENDOR_WINDRIVER)
    00069     platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
    00070 #else
    00071     platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
    00072 #endif
    00073     score = rpmPlatformScore(platform, NULL, 0);
    00074     platform = _free(platform);
    00075
    00076     return Py_BuildValue("i", score);
    00077 }
    00078
    00081 static PyObject * platformScore(PyObject * s, PyObject * args,
    00082                 PyObject * kwds)
    00083 {
    00084     char * platform;
    00085     int score;
    00086     char * kwlist[] = {"platform", NULL};
    00087
    00088     if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &platform))
    00089         return NULL;
    00090
    00091     score = rpmPlatformScore(platform, NULL, 0);
    00092
    00093     return Py_BuildValue("i", score);
    00094 }
    00095
    00098 static PyObject * signalsCaught(PyObject * s, PyObject * check)
    00099 {
    00100     PyObject *caught, *o;
    00101     Py_ssize_t llen;
    00102     int signum, i;
    00103     sigset_t newMask, oldMask;
    00104
    00105     if (!PyList_Check(check)) {
    00106         PyErr_SetString(PyExc_TypeError, "list expected");
    00107         return NULL;
    00108     }
    00109
    00110     llen = PyList_Size(check);
    00111     caught = PyList_New(0);
    00112
    00113     /* block signals while checking for them */
    00114     (void) sigfillset(&newMask);
    00115     (void) sigprocmask(SIG_BLOCK, &newMask, &oldMask);
    00116
    00117     for (i = 0; i < llen; i++) {
    00118         o = PyList_GetItem(check, i);
    00119         signum = PyInt_AsLong(o);
    00120         if (sigismember(&rpmsqCaught, signum)) {
    00121             PyList_Append(caught, o);
    00122         }
    00123     }
    00124     (void) sigprocmask(SIG_SETMASK, &oldMask, NULL);
    00125
    00126     return caught;
    00127 }
    00128
    00131 static PyObject * checkSignals(PyObject * s, PyObject * args)
    00132 {
    00133     if (!PyArg_ParseTuple(args, ":checkSignals")) return NULL;
    00134     rpmdbCheckSignals();
    00135     Py_INCREF(Py_None);
    00136     return Py_None;
    00137 }
    00138
    00141 static PyObject * setLogFile (PyObject * s, PyObject * args,
    00142                 PyObject *kwds)
    00143 {
    00144     PyObject * fop = NULL;
    00145     FILE * fp = NULL;
    00146     char * kwlist[] = {"fileObject", NULL};
    00147
    00148     if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:logSetFile", kwlist, &fop))
    00149         return NULL;
    00150
    00151     if (fop) {
    00152         if (!PyFile_Check(fop)) {
    00153             PyErr_SetString(pyrpmError, "requires file object");
    00154             return NULL;
    00155         }
    00156         fp = PyFile_AsFile(fop);
    00157     }
    00158
    00159     (void) rpmlogSetFile(fp);
    00160
    00161     Py_INCREF(Py_None);
    00162     return (PyObject *) Py_None;
    00163 }
    00164
    00167 static PyObject *
    00168 setVerbosity (PyObject * s, PyObject * args, PyObject *kwds)
    00169 {
    00170     int level;
    00171     char * kwlist[] = {"level", NULL};
    00172
    00173     if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &level))
    00174         return NULL;
    00175
    00176     rpmSetVerbosity(level);
    00177
    00178     Py_INCREF(Py_None);
    00179     return (PyObject *) Py_None;
    00180 }
    00181
    00184 static PyObject *
    00185 setEpochPromote (PyObject * s, PyObject * args, PyObject * kwds)
    00186 {
    00187     char * kwlist[] = {"promote", NULL};
    00188
    00189     if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist,
    00190             &_rpmds_nopromote))
    00191         return NULL;
    00192
    00193     Py_INCREF(Py_None);
    00194     return (PyObject *) Py_None;
    00195 }
    00196
    00199 static PyObject * setStats (PyObject * s, PyObject * args,
    00200                 PyObject * kwds)
    00201 {
    00202     char * kwlist[] = {"stats", NULL};
    00203
    00204     if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmts_stats))
    00205         return NULL;
    00206
    00207     Py_INCREF(Py_None);
    00208     return (PyObject *) Py_None;
    00209 }
    00214 static PyMethodDef rpmModuleMethods[] = {
    00215     { "TransactionSet", (PyCFunction) rpmts_Create, METH_VARARGS|METH_KEYWORDS,
    00216 "rpm.TransactionSet([rootDir, [db]]) -> ts\n\
    00217 - Create a transaction set.\n" },
    00218
    00219     { "addMacro", (PyCFunction) rpmmacro_AddMacro, METH_VARARGS|METH_KEYWORDS,
    00220         NULL },
    00221     { "delMacro", (PyCFunction) rpmmacro_DelMacro, METH_VARARGS|METH_KEYWORDS,
    00222         NULL },
    00223     { "expandMacro", (PyCFunction)rpmmacro_ExpandMacro, METH_VARARGS|METH_KEYWORDS,
    00224         NULL },
    00225     { "getMacros", (PyCFunction) rpmmacro_GetMacros, METH_VARARGS|METH_KEYWORDS,
    00226         NULL },
    00227
    00228     { "archscore", (PyCFunction) archScore, METH_VARARGS|METH_KEYWORDS,
    00229         NULL },
    00230     { "platformscore", (PyCFunction) platformScore, METH_VARARGS|METH_KEYWORDS,
    00231         NULL },
    00232
    00233     { "signalsCaught", (PyCFunction) signalsCaught, METH_O,
    00234         NULL },
    00235     { "checkSignals", (PyCFunction) checkSignals, METH_VARARGS,
    00236         NULL },
    00237
    00238     { "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS|METH_KEYWORDS,
    00239         NULL },
    00240
    00241     { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS|METH_KEYWORDS,
    00242         NULL },
    00243     { "readHeaderListFromFile", (PyCFunction) rpmHeaderFromFile, METH_VARARGS|METH_KEYWORDS,
    00244         NULL },
    00245     { "readHeaderFromFD", (PyCFunction) rpmSingleHeaderFromFD, METH_VARARGS|METH_KEYWORDS,
    00246         NULL },
    00247     { "writeHeaderListToFD", (PyCFunction) rpmHeaderToFD, METH_VARARGS|METH_KEYWORDS,
    00248         NULL },
    00249     { "writeHeaderListToFile", (PyCFunction) rpmHeaderToFile, METH_VARARGS|METH_KEYWORDS,
    00250         NULL },
    00251
    00252     { "setLogFile", (PyCFunction) setLogFile, METH_VARARGS|METH_KEYWORDS,
    00253         NULL },
    00254
    00255     { "versionCompare", (PyCFunction) versionCompare, METH_VARARGS|METH_KEYWORDS,
    00256         NULL },
    00257     { "labelCompare", (PyCFunction) labelCompare, METH_VARARGS|METH_KEYWORDS,
    00258         NULL },
    00259     { "setVerbosity", (PyCFunction) setVerbosity, METH_VARARGS|METH_KEYWORDS,
    00260         NULL },
    00261     { "setEpochPromote", (PyCFunction) setEpochPromote, METH_VARARGS|METH_KEYWORDS,
    00262         NULL },
    00263     { "setStats", (PyCFunction) setStats, METH_VARARGS|METH_KEYWORDS,
    00264         NULL },
    00265
    00266     { "dsSingle", (PyCFunction) rpmds_Single, METH_VARARGS|METH_KEYWORDS,
    00267 "rpm.dsSingle(TagN, N, [EVR, [Flags]] -> ds\n\
    00268 - Create a single element dependency set.\n" },
    00269     { NULL }
    00270 } ;
    00271
    00272 /*
    00273  * Force clean up of open iterators and dbs on exit.
    00274  */
    00275 static void rpm_exithook(void)
    00276 {
    00277    rpmdbCheckTerminate(1);
    00278 }
    00279
    00280 /*
    00281  * Add rpm tag dictionaries to the module
    00282  */
    00283 static void addRpmTags(PyObject *module)
    00284 {
    00285     PyObject * dict = PyDict_New();
    00286
    00287 #ifdef  NOTYET
    00288
    00289     PyObject *pyval, *pyname;
    00290     rpmtd names = rpmtdNew();
    00291     rpmTagGetNames(names, 1);
    00292     const char *tagname, *shortname;
    00293     rpmTag tagval;
    00294
    00295     while ((tagname = rpmtdNextString(names))) {
    00296         shortname = tagname + strlen("RPMTAG_");
    00297         tagval = rpmTagGetValue(shortname);
    00298
    00299         PyModule_AddIntConstant(module, tagname, tagval);
    00300         pyval = PyInt_FromLong(tagval);
    00301         pyname = PyString_FromString(shortname);
    00302         PyDict_SetItem(dict, pyval, pyname);
    00303         Py_DECREF(pyval);
    00304         Py_DECREF(pyname);
    00305     }
    00306     PyModule_AddObject(module, "tagnames", dict);
    00307     rpmtdFreeData(names);
    00308     rpmtdFree(names);
    00309
    00310 #else
    00311
    00312     PyObject * d = PyModule_GetDict(module);
    00313     PyObject * o;
    00314
    00315  {  const struct headerTagTableEntry_s * t;
    00316     PyObject * to;
    00317     for (t = rpmTagTable; t && t->name; t++) {
    00318         PyDict_SetItemString(d, (char *) t->name, to=PyInt_FromLong(t->val));
    00319         Py_DECREF(to);
    00320         PyDict_SetItem(dict, to, o=PyString_FromString(t->name + 7));
    00321         Py_DECREF(o);
    00322     }
    00323  }
    00324
    00325  {  headerSprintfExtension exts = rpmHeaderFormats;
    00326     headerSprintfExtension ext;
    00327     PyObject * to;
    00328     int extNum;
    00329     for (ext = exts, extNum = 0; ext != NULL && ext->type != HEADER_EXT_LAST;
    00330         ext = (ext->type == HEADER_EXT_MORE ? *ext->u.more : ext+1), extNum++)
    00331     {
    00332         if (ext->name == NULL || ext->type != HEADER_EXT_TAG)
    00333             continue;
    00334         PyDict_SetItemString(d, (char *) ext->name, to=PyCObject_FromVoidPtr((void *)ext, NULL));
    00335         Py_DECREF(to);
    00336         PyDict_SetItem(dict, to, o=PyString_FromString(ext->name + 7));
    00337         Py_DECREF(o);
    00338     }
    00339  }
    00340
    00341     PyDict_SetItemString(d, "tagnames", dict);
    00342     Py_DECREF(dict);
    00343
    00344 #endif
    00345 }
    00346
    00349 static char rpm__doc__[] =
    00350 "";
    00351
    00352 void init_rpm(void);    /* XXX eliminate gcc warning */
    00355 void init_rpm(void)
    00356 {
    00357     PyObject * d, * o, * m;
    00358
    00359 #if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
    00360     if (PyType_Ready(&hdr_Type) < 0) return;
    00361     if (PyType_Ready(&rpmal_Type) < 0) return;
    00362     if (PyType_Ready(&rpmds_Type) < 0) return;
    00363     if (PyType_Ready(&rpmfd_Type) < 0) return;
    00364     if (PyType_Ready(&rpmfts_Type) < 0) return;
    00365     if (PyType_Ready(&rpmfi_Type) < 0) return;
    00366     if (PyType_Ready(&rpmmi_Type) < 0) return;
    00367     if (PyType_Ready(&rpmps_Type) < 0) return;
    00368
    00369     if (PyType_Ready(&rpmtd_Type) < 0) return;
    00370     if (PyType_Ready(&rpmKeyring_Type) < 0) return;
    00371     if (PyType_Ready(&rpmPubkey_Type) < 0) return;
    00372
    00373     if (PyType_Ready(&rpmte_Type) < 0) return;
    00374     if (PyType_Ready(&rpmts_Type) < 0) return;
    00375     if (PyType_Ready(&spec_Type) < 0) return;
    00376 #endif
    00377
    00378     m = Py_InitModule3("_rpm", rpmModuleMethods, rpm__doc__);
    00379     if (m == NULL)
    00380         return;
    00381
    00382     /*
    00383      * treat error to register rpm cleanup hook as fatal, tracebacks
    00384      * can and will leave stale locks around if we can't clean up
    00385      */
    00386     if (Py_AtExit(rpm_exithook) == -1)
    00387         return;
    00388
    00389     rpmReadConfigFiles(NULL, NULL);
    00390
    00391     d = PyModule_GetDict(m);
    00392
    00393 #ifdef  HACK
    00394     pyrpmError = PyString_FromString("_rpm.error");
    00395     PyDict_SetItemString(d, "error", pyrpmError);
    00396     Py_DECREF(pyrpmError);
    00397 #else
    00398     pyrpmError = PyErr_NewException("_rpm.error", NULL, NULL);
    00399     if (pyrpmError != NULL)
    00400         PyDict_SetItemString(d, "error", pyrpmError);
    00401 #endif
    00402
    00403 #if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
    00404     Py_INCREF(&hdr_Type);
    00405     PyModule_AddObject(m, "hdr", (PyObject *) &hdr_Type);
    00406
    00407     Py_INCREF(&rpmal_Type);
    00408     PyModule_AddObject(m, "al", (PyObject *) &rpmal_Type);
    00409
    00410     Py_INCREF(&rpmds_Type);
    00411     PyModule_AddObject(m, "ds", (PyObject *) &rpmds_Type);
    00412
    00413     Py_INCREF(&rpmfd_Type);
    00414     PyModule_AddObject(m, "fd", (PyObject *) &rpmfd_Type);
    00415
    00416     Py_INCREF(&rpmfts_Type);
    00417     PyModule_AddObject(m, "fts", (PyObject *) &rpmfts_Type);
    00418
    00419     Py_INCREF(&rpmfi_Type);
    00420     PyModule_AddObject(m, "fi", (PyObject *) &rpmfi_Type);
    00421
    00422     Py_INCREF(&rpmKeyring_Type);
    00423     PyModule_AddObject(m, "Keyring", (PyObject *) &rpmKeyring_Type);
    00424     Py_INCREF(&rpmPubkey_Type);
    00425     PyModule_AddObject(m, "Pubkey", (PyObject *) &rpmPubkey_Type);
    00426
    00427     Py_INCREF(&rpmmi_Type);
    00428     PyModule_AddObject(m, "mi", (PyObject *) &rpmmi_Type);
    00429
    00430     Py_INCREF(&rpmps_Type);
    00431     PyModule_AddObject(m, "ps", (PyObject *) &rpmps_Type);
    00432
    00433     Py_INCREF(&rpmtd_Type);
    00434     PyModule_AddObject(m, "td", (PyObject *) &rpmtd_Type);
    00435
    00436     Py_INCREF(&rpmte_Type);
    00437     PyModule_AddObject(m, "te", (PyObject *) &rpmte_Type);
    00438
    00439     Py_INCREF(&rpmts_Type);
    00440     PyModule_AddObject(m, "ts", (PyObject *) &rpmts_Type);
    00441
    00442     Py_INCREF(&spec_Type);
    00443     PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
    00444 #else
    00445     hdr_Type.ob_type = &PyType_Type;
    00446     rpmal_Type.ob_type = &PyType_Type;
    00447     rpmds_Type.ob_type = &PyType_Type;
    00448     rpmfd_Type.ob_type = &PyType_Type;
    00449     rpmfts_Type.ob_type = &PyType_Type;
    00450     rpmfi_Type.ob_type = &PyType_Type;
    00451     rpmmi_Type.ob_type = &PyType_Type;
    00452     rpmps_Type.ob_type = &PyType_Type;
    00453     rpmte_Type.ob_type = &PyType_Type;
    00454     rpmts_Type.ob_type = &PyType_Type;
    00455     spec_Type.ob_type =  &PyType_Type;
    00456 #endif
    00457
    00458     addRpmTags(m);
    00459
    00460 #define REGISTER_ENUM(val) \
    00461     PyDict_SetItemString(d, #val, o=PyInt_FromLong( val )); \
    00462     Py_DECREF(o);
    00463
    00464     REGISTER_ENUM(RPMFILE_STATE_NORMAL);
    00465     REGISTER_ENUM(RPMFILE_STATE_REPLACED);
    00466     REGISTER_ENUM(RPMFILE_STATE_NOTINSTALLED);
    00467     REGISTER_ENUM(RPMFILE_STATE_NETSHARED);
    00468     REGISTER_ENUM(RPMFILE_STATE_WRONGCOLOR);
    00469
    00470     REGISTER_ENUM(RPMFILE_CONFIG);
    00471     REGISTER_ENUM(RPMFILE_DOC);
    00472     REGISTER_ENUM(RPMFILE_ICON);
    00473     REGISTER_ENUM(RPMFILE_MISSINGOK);
    00474     REGISTER_ENUM(RPMFILE_NOREPLACE);
    00475     REGISTER_ENUM(RPMFILE_GHOST);
    00476     REGISTER_ENUM(RPMFILE_LICENSE);
    00477     REGISTER_ENUM(RPMFILE_README);
    00478     REGISTER_ENUM(RPMFILE_EXCLUDE);
    00479     REGISTER_ENUM(RPMFILE_UNPATCHED);
    00480     REGISTER_ENUM(RPMFILE_PUBKEY);
    00481
    00482     REGISTER_ENUM(RPMDEP_SENSE_REQUIRES);
    00483     REGISTER_ENUM(RPMDEP_SENSE_CONFLICTS);
    00484
    00485     REGISTER_ENUM(RPMSENSE_LESS);
    00486     REGISTER_ENUM(RPMSENSE_GREATER);
    00487     REGISTER_ENUM(RPMSENSE_EQUAL);
    00488     REGISTER_ENUM(RPMSENSE_NOTEQUAL);
    00489     REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
    00490
    00491     REGISTER_ENUM(RPMDEPS_FLAG_NOUPGRADE);
    00492     REGISTER_ENUM(RPMDEPS_FLAG_NOREQUIRES);
    00493     REGISTER_ENUM(RPMDEPS_FLAG_NOCONFLICTS);
    00494     REGISTER_ENUM(RPMDEPS_FLAG_NOOBSOLETES);
    00495     REGISTER_ENUM(RPMDEPS_FLAG_NOPARENTDIRS);
    00496     REGISTER_ENUM(RPMDEPS_FLAG_NOLINKTOS);
    00497     REGISTER_ENUM(RPMDEPS_FLAG_ANACONDA);
    00498     REGISTER_ENUM(RPMDEPS_FLAG_NOSUGGEST);
    00499     REGISTER_ENUM(RPMDEPS_FLAG_ADDINDEPS);
    00500     REGISTER_ENUM(RPMDEPS_FLAG_DEPLOOPS);
    00501
    00502     REGISTER_ENUM(RPMTRANS_FLAG_TEST);
    00503     REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS);
    00504     REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS);
    00505     REGISTER_ENUM(RPMTRANS_FLAG_JUSTDB);
    00506     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERS);
    00507     REGISTER_ENUM(RPMTRANS_FLAG_NODOCS);
    00508     REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES);
    00509     REGISTER_ENUM(RPMTRANS_FLAG_NORPMDB);
    00510     REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE);
    00511     REGISTER_ENUM(RPMTRANS_FLAG_NOPRE);
    00512     REGISTER_ENUM(RPMTRANS_FLAG_NOPOST);
    00513     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPREIN);
    00514     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERIN);
    00515     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERUN);
    00516     REGISTER_ENUM(RPMTRANS_FLAG_NOPREUN);
    00517     REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
    00518     REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
    00519     REGISTER_ENUM(RPMTRANS_FLAG_NOFDIGESTS);
    00520     REGISTER_ENUM(RPMTRANS_FLAG_NOCONFIGS);
    00521
    00522     REGISTER_ENUM(RPMPROB_FILTER_IGNOREOS);
    00523     REGISTER_ENUM(RPMPROB_FILTER_IGNOREARCH);
    00524     REGISTER_ENUM(RPMPROB_FILTER_REPLACEPKG);
    00525     REGISTER_ENUM(RPMPROB_FILTER_FORCERELOCATE);
    00526     REGISTER_ENUM(RPMPROB_FILTER_REPLACENEWFILES);
    00527     REGISTER_ENUM(RPMPROB_FILTER_REPLACEOLDFILES);
    00528     REGISTER_ENUM(RPMPROB_FILTER_OLDPACKAGE);
    00529     REGISTER_ENUM(RPMPROB_FILTER_DISKSPACE);
    00530     REGISTER_ENUM(RPMPROB_FILTER_DISKNODES);
    00531
    00532     REGISTER_ENUM(RPMCALLBACK_UNKNOWN);
    00533     REGISTER_ENUM(RPMCALLBACK_INST_PROGRESS);
    00534     REGISTER_ENUM(RPMCALLBACK_INST_START);
    00535     REGISTER_ENUM(RPMCALLBACK_INST_OPEN_FILE);
    00536     REGISTER_ENUM(RPMCALLBACK_INST_CLOSE_FILE);
    00537     REGISTER_ENUM(RPMCALLBACK_TRANS_PROGRESS);
    00538     REGISTER_ENUM(RPMCALLBACK_TRANS_START);
    00539     REGISTER_ENUM(RPMCALLBACK_TRANS_STOP);
    00540     REGISTER_ENUM(RPMCALLBACK_UNINST_PROGRESS);
    00541     REGISTER_ENUM(RPMCALLBACK_UNINST_START);
    00542     REGISTER_ENUM(RPMCALLBACK_UNINST_STOP);
    00543     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_PROGRESS);
    00544     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_START);
    00545     REGISTER_ENUM(RPMCALLBACK_REPACKAGE_STOP);
    00546     REGISTER_ENUM(RPMCALLBACK_UNPACK_ERROR);
    00547     REGISTER_ENUM(RPMCALLBACK_CPIO_ERROR);
    00548     REGISTER_ENUM(RPMCALLBACK_SCRIPT_ERROR);
    00549
    00550     REGISTER_ENUM(RPMPROB_BADARCH);
    00551     REGISTER_ENUM(RPMPROB_BADOS);
    00552     REGISTER_ENUM(RPMPROB_PKG_INSTALLED);
    00553     REGISTER_ENUM(RPMPROB_BADRELOCATE);
    00554     REGISTER_ENUM(RPMPROB_REQUIRES);
    00555     REGISTER_ENUM(RPMPROB_CONFLICT);
    00556     REGISTER_ENUM(RPMPROB_NEW_FILE_CONFLICT);
    00557     REGISTER_ENUM(RPMPROB_FILE_CONFLICT);
    00558     REGISTER_ENUM(RPMPROB_OLDPACKAGE);
    00559     REGISTER_ENUM(RPMPROB_DISKSPACE);
    00560     REGISTER_ENUM(RPMPROB_DISKNODES);
    00561     REGISTER_ENUM(RPMPROB_BADPRETRANS);
    00562
    00563     REGISTER_ENUM(VERIFY_DIGEST);
    00564     REGISTER_ENUM(VERIFY_SIGNATURE);
    00565
    00566     REGISTER_ENUM(RPMLOG_EMERG);
    00567     REGISTER_ENUM(RPMLOG_ALERT);
    00568     REGISTER_ENUM(RPMLOG_CRIT);
    00569     REGISTER_ENUM(RPMLOG_ERR);
    00570     REGISTER_ENUM(RPMLOG_WARNING);
    00571     REGISTER_ENUM(RPMLOG_NOTICE);
    00572     REGISTER_ENUM(RPMLOG_INFO);
    00573     REGISTER_ENUM(RPMLOG_DEBUG);
    00574
    00575     REGISTER_ENUM(RPMMIRE_DEFAULT);
    00576     REGISTER_ENUM(RPMMIRE_STRCMP);
    00577     REGISTER_ENUM(RPMMIRE_REGEX);
    00578     REGISTER_ENUM(RPMMIRE_GLOB);
    00579
    00580     REGISTER_ENUM(RPMVSF_DEFAULT);
    00581     REGISTER_ENUM(RPMVSF_NOHDRCHK);
    00582     REGISTER_ENUM(RPMVSF_NEEDPAYLOAD);
    00583     REGISTER_ENUM(RPMVSF_NOSHA1HEADER);
    00584     REGISTER_ENUM(RPMVSF_NOMD5HEADER);
    00585     REGISTER_ENUM(RPMVSF_NODSAHEADER);
    00586     REGISTER_ENUM(RPMVSF_NORSAHEADER);
    00587     REGISTER_ENUM(RPMVSF_NOSHA1);
    00588     REGISTER_ENUM(RPMVSF_NOMD5);
    00589     REGISTER_ENUM(RPMVSF_NODSA);
    00590     REGISTER_ENUM(RPMVSF_NORSA);
    00591     REGISTER_ENUM(_RPMVSF_NODIGESTS);
    00592     REGISTER_ENUM(_RPMVSF_NOSIGNATURES);
    00593     REGISTER_ENUM(_RPMVSF_NOHEADER);
    00594     REGISTER_ENUM(_RPMVSF_NOPAYLOAD);
    00595
    00596     REGISTER_ENUM(TR_ADDED);
    00597     REGISTER_ENUM(TR_REMOVED);
    00598
    00599     REGISTER_ENUM(RPMDBI_PACKAGES);
    00600
    00601     REGISTER_ENUM((long)RPMAL_NOMATCH);
    00602 }