- python: add ts.setProbFilter() method, remove ts.run() argument.
CVS patchset: 5652
CVS date: 2002/08/20 22:05:18
- skip redundant /sbin/ldconfig scripts on upgrade (if possible).
- python: stupid typo broke ts.check().
- fix: add epoch to "already installed" check.
+ - check for interrupt during iteration.
+ - python: add ts.setProbFilter() method, remove ts.run() argument.
4.0.3 -> 4.0.4:
- solaris: translate i86pc to i386 (#57182).
/*@access Header @*/
/*@access rpmfi @*/
+/*@access rpmte @*/
/*@access FD_t @*/
/*@access StringBuf @*/ /* compared with NULL */
if (fi == NULL) return; /* XXX can't happen */
+/*@-onlytrans@*/
fi->te = xcalloc(1, sizeof(*fi->te));
+/*@=onlytrans@*/
fi->te->type = TR_ADDED;
fi->dnl = _free(fi->dnl);
/*@modifies psm, fileSystem, internalState @*/
{
if (psm->reaper) {
- /* XXX FIXME: signal race on psm->reaped prevents pause(3) */
+ /*@-infloops@*/
while (psm->reaped == 0)
(void) sleep(2);
/*@=infloops@*/
/*@unchecked@*/
static int ldconfig_done = 0;
-/*@unchecked@*/ /*@observer@*/
+/*@unchecked@*/ /*@observer@*/ /*@null@*/
static const char * ldconfig_path = "/sbin/ldconfig";
/**
const char * sln,
int progArgc, const char ** progArgv,
const char * script, int arg1, int arg2)
- /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/
- /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@globals ldconfig_done, rpmGlobalMacroContext,
+ fileSystem, internalState@*/
+ /*@modifies psm, ldconfig_done, rpmGlobalMacroContext,
+ fileSystem, internalState @*/
{
const rpmts ts = psm->ts;
rpmfi fi = psm->fi;
*/
static int handleOneTrigger(const rpmpsm psm, Header sourceH, Header triggeredH,
int arg2, unsigned char * triggersAlreadyRun)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState@*/
- /*@modifies psm, triggeredH, *triggersAlreadyRun, rpmGlobalMacroContext,
- fileSystem, internalState @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/
+ /*@modifies psm, sourceH, triggeredH, *triggersAlreadyRun,
+ rpmGlobalMacroContext, fileSystem, internalState @*/
{
int scareMem = 1;
const rpmts ts = psm->ts;
if (!(Flags & psm->sense))
continue;
- if (!rpmdsNVRMatchesDep(sourceH, trigger, 1))
+ /*
+ * XXX Trigger on any provided dependency, not just the package NEVR.
+ */
+ if (!rpmdsAnyMatchesDep(sourceH, trigger, 1))
continue;
if (!( hge(triggeredH, RPMTAG_TRIGGERINDEX, &tit,
assert(psm->mi == NULL);
psm->mi = rpmtsInitIterator(ts, RPMTAG_NAME, rpmteN(psm->te), 0);
- xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION,
- RPMMIRE_DEFAULT, rpmteV(psm->te));
- xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE,
- RPMMIRE_DEFAULT, rpmteR(psm->te));
+ xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_EPOCH, RPMMIRE_DEFAULT,
+ rpmteE(psm->te));
+ xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_VERSION, RPMMIRE_DEFAULT,
+ rpmteV(psm->te));
+ xx = rpmdbSetIteratorRE(psm->mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT,
+ rpmteR(psm->te));
while ((psm->oh = rpmdbNextIterator(psm->mi))) {
fi->record = rpmdbGetIteratorOffset(psm->mi);
}
fi = xcalloc(1, sizeof(*fi));
+ if (fi == NULL) /* XXX can't happen */
+ goto exit;
fi->magic = RPMFIMAGIC;
fi->Type = Type;
/*@observer@*/ /*@unchecked@*/
static const char * platform = "/etc/rpm/platform";
-/*@only@*/ /*@unchecked@*/
+/*@only@*/ /*@relnul@*/ /*@unchecked@*/
static const char ** platpat = NULL;
/*@unchecked@*/
static int nplatpat = 0;
{
int i, j, k;
+/*@-onlyunqglobaltrans -unqualifiedtrans @*/
if (platpat)
for (i = 0; i < nplatpat; i++)
platpat[i] = _free(platpat[i]);
platpat = _free(platpat);
+/*@-onlyunqglobaltrans =unqualifiedtrans @*/
nplatpat = 0;
for (i = 0; i < RPM_MACHTABLE_COUNT; i++) {
current[OS] = _free(current[OS]);
current[ARCH] = _free(current[ARCH]);
defaultsInitialized = 0;
-/*@-nullstate@*/ /* FIX: current may be NULL */
+/*@-globstate -nullstate@*/ /* FIX: platpat/current may be NULL */
return;
-/*@=nullstate@*/
+/*@=globstate =nullstate@*/
}
/** \ingroup rpmrc
/*@-type@*/ /* FIX: rpmte not opaque */
{
/*@-noeffectuncon@*/ /* FIX: notify annotations */
- p->fd = ts->notify(fi->h, RPMCALLBACK_INST_OPEN_FILE, 0, 0,
+ p->fd = ts->notify(p->h, RPMCALLBACK_INST_OPEN_FILE, 0, 0,
rpmteKey(p), ts->notifyData);
/*@=noeffectuncon@*/
if (rpmteFd(p) != NULL) {
if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADSIZE)) {
/*@-noeffectuncon@*/ /* FIX: notify annotations */
- p->fd = ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE,
+ p->fd = ts->notify(p->h, RPMCALLBACK_INST_CLOSE_FILE,
0, 0,
rpmteKey(p), ts->notifyData);
/*@=noeffectuncon@*/
fi->actions = NULL;
fi = rpmfiFree(fi);
fi = rpmfiNew(ts, p->h, RPMTAG_BASENAMES, 1);
- p->fi = fi;
- fi->te = p;
- fi->fstates = _free(fi->fstates);
- fi->fstates = fstates;
- fi->actions = _free(fi->actions);
- fi->actions = actions;
+ if (fi != NULL) { /* XXX can't happen */
+ fi->te = p;
+ fi->fstates = _free(fi->fstates);
+ fi->fstates = fstates;
+ fi->actions = _free(fi->actions);
+ fi->actions = actions;
+ p->fi = fi;
+ }
}
psm->fi = rpmfiLink(p->fi, NULL);
lastFailKey = pkgKey;
}
/*@=nullstate@*/
- fi->h = headerFree(fi->h);
} else {
ourrc++;
lastFailKey = pkgKey;
}
- p->h = headerFree(p->h);
-
if (gotfd) {
/*@-noeffectuncon @*/ /* FIX: check rc */
- (void) ts->notify(fi->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0,
+ (void) ts->notify(p->h, RPMCALLBACK_INST_CLOSE_FILE, 0, 0,
rpmteKey(p), ts->notifyData);
/*@=noeffectuncon @*/
/*@-type@*/
p->fd = NULL;
/*@=type@*/
}
+
+ p->h = headerFree(p->h);
+
/*@switchbreak@*/ break;
case TR_REMOVED:
rpmMessage(RPMMESS_DEBUG, "========== --- %s\n", rpmteNEVR(p));
/*@=nullstate@*/
/*@-type@*/ /* FIX: p is almost opaque */
- p->fi = rpmfiFree(fi);
+ p->fi = rpmfiFree(p->fi);
/*@=type@*/
}
* packages.
* @return previous transFlags
*
- * - run(problemSetFilter,callback,data) Attempt to execute a
- * transaction set. After the transaction set has been populated
- * with install and upgrade actions, it can be executed by invoking
- * the run() method.
+ * - ts.setProbFilter(ignoreSet) Set transaction set problem filter.
* @param problemSetFilter - control bit(s) to ignore classes of problems,
- * any of
+ * a logical or of one or more of the following bit(s):
* - rpm.RPMPROB_FILTER_IGNOREOS -
* - rpm.RPMPROB_FILTER_IGNOREARCH -
* - rpm.RPMPROB_FILTER_REPLACEPKG -
* - rpm.RPMPROB_FILTER_REPLACEOLDFILES -
* - rpm.RPMPROB_FILTER_OLDPACKAGE -
* - rpm.RPMPROB_FILTER_DISKSPACE -
+ * @return previous ignoreSet
+ *
+ * - ts.run(callback,data) Attempt to execute a transaction set.
+ * After the transaction set has been populated with install/upgrade or
+ * erase actions, the transaction set can be executed by invoking
+ * the ts.run() method.
*/
/** \ingroup python
/** \ingroup python
*/
+static PyObject * rpmts_SetProbFilter(rpmtsObject * s, PyObject * args)
+ /*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
+ /*@modifies s, rpmGlobalMacroContext, _Py_NoneStruct @*/
+{
+ rpmprobFilterFlags ignoreSet = 0;
+ rpmprobFilterFlags oignoreSet;
+
+ if (!PyArg_ParseTuple(args, "i:ProbFilter", &ignoreSet))
+ return NULL;
+
+if (_rpmts_debug)
+fprintf(stderr, "*** rpmts_SetProbFilter(%p) ts %p ignoreSet %x\n", s, s->ts, ignoreSet);
+
+ oignoreSet = s->ignoreSet;
+ s->ignoreSet = ignoreSet;
+
+ return Py_BuildValue("i", oignoreSet);
+}
+
+/** \ingroup python
+ */
static PyObject * rpmts_Run(rpmtsObject * s, PyObject * args)
/*@globals rpmGlobalMacroContext, _Py_NoneStruct @*/
/*@modifies s, rpmGlobalMacroContext, _Py_NoneStruct @*/
{
- int ignoreSet;
int rc, i;
PyObject * list;
rpmps ps;
struct rpmtsCallbackType_s cbInfo;
- if (!PyArg_ParseTuple(args, "iOO:Run", &ignoreSet, &cbInfo.cb,
- &cbInfo.data))
+ if (!PyArg_ParseTuple(args, "OO:Run", &cbInfo.cb, &cbInfo.data))
return NULL;
cbInfo.tso = s;
if (_rpmts_debug)
-fprintf(stderr, "*** rpmts_Run(%p) ts %p ignore %x\n", s, s->ts, ignoreSet);
+fprintf(stderr, "*** rpmts_Run(%p) ts %p ignore %x\n", s, s->ts, s->ignoreSet);
- rc = rpmtsRun(s->ts, NULL, ignoreSet);
+ rc = rpmtsRun(s->ts, NULL, s->ignoreSet);
ps = rpmtsProblems(s->ts);
if (cbInfo.cb) {
NULL },
{"setFlags", (PyCFunction) rpmts_SetFlags, METH_VARARGS,
"ts.setFlags(transFlags) -> previous transFlags\n\
-- Set control bit(s) for processing a transaction set.\n\
- Note: This method sets bit(s) passed as the first argument to ts.run()\n" },
+- Set control bit(s) for executing ts.run().\n\
+ Note: This method replaces the 1st argument to the old ts.run()\n" },
+ {"setProbFilter", (PyCFunction) rpmts_SetProbFilter, METH_VARARGS,
+"ts.setProbFilter(ignoreSet) -> previous ignoreSet\n\
+- Set control bit(s) for ignoring problems found by ts.run().\n\
+ Note: This method replaces the 2nd argument to the old ts.run()\n" },
{"run", (PyCFunction) rpmts_Run, METH_VARARGS,
NULL },
{"clean", (PyCFunction) rpmts_Clean, METH_VARARGS,
FD_t scriptFd;
rpmtsi tsi;
rpmElementType tsiFilter;
+ rpmprobFilterFlags ignoreSet;
} rpmtsObject;
/*@unchecked@*/
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
-Release: 0.84
+Release: 0.85
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
%{__prefix}/include/popt.h
%changelog
-* Tue Aug 20 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.84
+* Tue Aug 20 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.85
- python: stupid typo broke ts.check().
- fix: add epoch to "already installed" check.
+- check for interrupt during iteration.
+- python: add ts.setProbFilter() method, remove ts.run() argument.
* Mon Aug 19 2002 Jeff Johnson <jbj@redhat.com> 4.1-0.82
- add --with-efence to configure, check install/upgrade with efence.
/*@=branchstate@*/
if (tag->arrayCount) {
- /*@-observertrans -modobserver@*/
+ /*@-branchstate -observertrans -modobserver@*/
if (datafree)
data = headerFreeData(data, type);
- /*@=observertrans =modobserver@*/
+ /*@=branchstate =observertrans =modobserver@*/
countBuf = count;
data = &countBuf;
if (mire->tag != RPMTAG_EPOCH)
continue;
t = RPM_INT32_TYPE;
+/*@-immediatetrans@*/
u.i32p = &zero;
+/*@=immediatetrans@*/
c = 1;
}
if (mi == NULL)
return NULL;
+ (void) checkSignals();
+
dbi = dbiOpen(mi->mi_db, RPMDBI_PACKAGES, 0);
if (dbi == NULL)
return NULL;