Example #1
0
static PyObject *
rpmts_Check(rpmtsObject * s, PyObject * args, PyObject * kwds)
{
    struct rpmtsCallbackType_s cbInfo;
    int rc;
    char * kwlist[] = {"callback", NULL};

    memset(&cbInfo, 0, sizeof(cbInfo));
    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:Check", kwlist,
	    &cbInfo.cb))
	return NULL;

    if (cbInfo.cb != NULL) {
	if (!PyCallable_Check(cbInfo.cb)) {
	    PyErr_SetString(PyExc_TypeError, "expected a callable");
	    return NULL;
	}
	rc = rpmtsSetSolveCallback(s->ts, rpmts_SolveCallback, (void *)&cbInfo);
    }

    cbInfo.tso = s;
    cbInfo._save = PyEval_SaveThread();

    rc = rpmtsCheck(s->ts);

    PyEval_RestoreThread(cbInfo._save);

    return PyBool_FromLong((rc == 0));
}
Example #2
0
/*************************************************************************
* FUNCTION      :   RPMTransaction_Set::RPMTransaction_Set               *
* ARGUMENTS     :   interp, name , transaction                           *
* RETURNS       :   none                                                 *
* EXCEPTIONS    :   none                                                 *
* PURPOSE       :   Set up an empty transaction list                     *
*************************************************************************/
RPMTransaction_Set::RPMTransaction_Set(Tcl_Interp *interp,const char *name,rpmts ts)
    :Cmd_base(interp,name,&cmds[0].base,sizeof(cmds[0])),
     transaction(ts),
     header_list(0),
     my_dirty_count(0),
     prob_flags(rpmtsFilterFlags(transaction))
{
    // Init our DB dirty counter
    RPM_for_TCL::Are_DBs_dirty(my_dirty_count);
    rpmtsSetNotifyCallback(transaction,RPM_callback_entry,this);
    rpmtsSetSolveCallback(transaction,Solve,this);
    rpmtsSetRootDir(transaction,"/");
    OK(name);
}