- permit anaconda to choose "presentation order".

CVS patchset: 6028
CVS date: 2003/01/25 20:59:52
This commit is contained in:
jbj 2003-01-25 20:59:52 +00:00
parent 8441baccd2
commit c87fa0b029
32 changed files with 5210 additions and 4867 deletions

View File

@ -112,6 +112,7 @@
- duplicate package checks with arch/os checks if colored.
- file conflict checks with colors.
- fix: debugedit.c problem.
- permit anaconda to choose "presentation order".
4.0.4 -> 4.1:
- loosely wire beecrypt library into rpm.

View File

@ -997,12 +997,16 @@ static inline int addRelation(rpmts ts,
int i = 0;
if ((Name = rpmdsN(requires)) == NULL)
return 0; /* XXX can't happen */
return 0;
/* Avoid rpmlib feature dependencies. */
if (!strncmp(Name, "rpmlib(", sizeof("rpmlib(")-1))
return 0;
/* Avoid package config dependencies. */
if (!strncmp(Name, "config(", sizeof("config(")-1))
return 0;
pkgKey = RPMAL_NOMATCH;
key = rpmalSatisfiesDepend(ts->addedPackages, requires, &pkgKey);
@ -1131,12 +1135,7 @@ int rpmtsOrder(rpmts ts)
{
rpmds requires;
int_32 Flags;
#ifdef DYING
int chainsaw = rpmtsFlags(ts) & RPMTRANS_FLAG_CHAINSAW;
#else
int chainsaw = 1;
#endif
int anaconda = rpmtsFlags(ts) & RPMTRANS_FLAG_ANACONDA;
rpmtsi pi; rpmte p;
rpmtsi qi; rpmte q;
rpmtsi ri; rpmte r;
@ -1153,6 +1152,7 @@ int rpmtsOrder(rpmts ts)
int nrescans = 10;
int _printed = 0;
char deptypechar;
size_t tsbytes;
int oType = 0;
int treex;
int depth;
@ -1175,6 +1175,7 @@ int rpmtsOrder(rpmts ts)
}
ordering = alloca(sizeof(*ordering) * (numOrderList + 1));
loopcheck = numOrderList;
tsbytes = 0;
pi = rpmtsiInit(ts);
while ((p = rpmtsiNext(pi, oType)) != NULL)
@ -1207,17 +1208,13 @@ int rpmtsOrder(rpmts ts)
case TR_REMOVED:
/* Skip if not %preun/%postun requires or legacy prereq. */
if (isInstallPreReq(Flags)
|| !( isErasePreReq(Flags)
|| isLegacyPreReq(Flags) )
)
|| !( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
case TR_ADDED:
/* Skip if not %pre/%post requires or legacy prereq. */
if (isErasePreReq(Flags)
|| !( isInstallPreReq(Flags)
|| isLegacyPreReq(Flags) )
)
|| !( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
}
@ -1238,17 +1235,13 @@ int rpmtsOrder(rpmts ts)
case TR_REMOVED:
/* Skip if %preun/%postun requires or legacy prereq. */
if (isInstallPreReq(Flags)
|| ( isErasePreReq(Flags)
|| isLegacyPreReq(Flags) )
)
|| ( isErasePreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
case TR_ADDED:
/* Skip if %pre/%post requires or legacy prereq. */
if (isErasePreReq(Flags)
|| ( isInstallPreReq(Flags)
|| isLegacyPreReq(Flags) )
)
|| ( isInstallPreReq(Flags) || isLegacyPreReq(Flags) ) )
/*@innercontinue@*/ continue;
/*@switchbreak@*/ break;
}
@ -1291,8 +1284,8 @@ rescan:
pi = rpmtsiInit(ts);
while ((p = rpmtsiNext(pi, oType)) != NULL) {
/* Prefer packages in chainsaw or presentation order. */
if (!chainsaw)
/* Prefer packages in chainsaw or anaconda presentation order. */
if (anaconda)
rpmteTSI(p)->tsi_qcnt = (ts->orderCount - rpmtsiOc(pi));
if (rpmteTSI(p)->tsi_count != 0)
@ -1335,6 +1328,7 @@ rescan:
treex = rpmteTree(q);
depth = rpmteDepth(q);
(void) rpmteSetDegree(q, 0);
tsbytes += rpmtePkgFileSize(q);
ordering[orderingCount] = rpmteAddedKey(q);
orderingCount++;
@ -1366,7 +1360,7 @@ rescan:
_printed++;
(void) rpmtsUnorderedSuccessors(ts, orderingCount);
rpmMessage(RPMMESS_DEBUG,
_("========== successors only (presentation order)\n"));
_("========== successors only (%d bytes)\n"), (int)tsbytes);
/* Relink the queue in presentation order. */
tsi = rpmteTSI(q);
@ -1535,7 +1529,7 @@ rescan:
newOrder[newOrderCount++] = q;
ts->order[j] = NULL;
if (!chainsaw)
if (anaconda)
for (j = needle->orIndex + 1; j < ts->orderCount; j++) {
if ((q = ts->order[j]) == NULL)
/*@innerbreak@*/ break;

View File

@ -159,6 +159,10 @@ struct poptOption rpmInstallPoptTable[] = {
N_("remove all packages which match <package> (normally an error is generated if <package> specified multiple packages)"),
NULL},
{ "anaconda", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmIArgs.transFlags, RPMTRANS_FLAG_ANACONDA,
N_("use anaconda \"presentation order\""), NULL},
{ "apply", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
(_noTransScripts|_noTransTriggers|
RPMTRANS_FLAG_APPLYONLY|RPMTRANS_FLAG_PKGCOMMIT),

View File

@ -952,9 +952,7 @@ typedef enum rpmtransFlags_e {
/*@=enummemuse@*/
RPMTRANS_FLAG_APPLYONLY = (1 << 25),
/*@-enummemuse@*/
RPMTRANS_FLAG_CHAINSAW = (1 << 26),
/*@=enummemuse@*/
RPMTRANS_FLAG_ANACONDA = (1 << 26),
RPMTRANS_FLAG_NOMD5 = (1 << 27), /*!< from --nomd5 */
RPMTRANS_FLAG_NOSUGGEST = (1 << 28), /*!< from --nosuggest */
RPMTRANS_FLAG_ADDINDEPS = (1 << 29), /*!< from --aid */

View File

@ -152,6 +152,8 @@ static void addTE(rpmts ts, rpmte p, Header h,
p->key = key;
p->fd = NULL;
p->pkgFileSize = 0;
p->this = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL);
p->provides = rpmdsNew(h, RPMTAG_PROVIDENAME, scareMem);
p->requires = rpmdsNew(h, RPMTAG_REQUIRENAME, scareMem);
@ -187,21 +189,28 @@ rpmte rpmteNew(const rpmts ts, Header h,
int dboffset,
alKey pkgKey)
{
rpmte te = xcalloc(1, sizeof(*te));
rpmte p = xcalloc(1, sizeof(*p));
int_32 * ep;
int xx;
addTE(ts, te, h, key, relocs);
addTE(ts, p, h, key, relocs);
switch (type) {
case TR_ADDED:
te->type = type;
te->u.addedKey = pkgKey;
p->type = type;
p->u.addedKey = pkgKey;
ep = NULL;
xx = headerGetEntry(h, RPMTAG_SIGSIZE, NULL, (void **)&ep, NULL);
/* XXX 256 is only an estimate of signature header. */
if (ep != NULL)
p->pkgFileSize += 96 + 256 + *ep;
break;
case TR_REMOVED:
te->type = type;
te->u.removed.dependsOnKey = pkgKey;
te->u.removed.dboffset = dboffset;
p->type = type;
p->u.removed.dependsOnKey = pkgKey;
p->u.removed.dboffset = dboffset;
break;
}
return te;
return p;
}
rpmElementType rpmteType(rpmte te)
@ -254,6 +263,11 @@ uint_32 rpmteSetColor(rpmte te, uint_32 color)
return ocolor;
}
uint_32 rpmtePkgFileSize(rpmte te)
{
return (te != NULL ? te->pkgFileSize : 0);
}
int rpmteDepth(rpmte te)
{
return (te != NULL ? te->depth : 0);

View File

@ -99,7 +99,8 @@ struct rpmte_s {
/*@refcounted@*/ /*@null@*/
rpmfi fi; /*!< File information. */
uint_32 color; /*!< Color bit(s) from package dependencies */
uint_32 color; /*!< Color bit(s) from package dependencies. */
uint_32 pkgFileSize; /*!< No. of bytes in package file (approx). */
/*@exposed@*/ /*@dependent@*/ /*@null@*/
fnpyKey key; /*!< (TR_ADDED) Retrieval key. */
@ -248,6 +249,15 @@ uint_32 rpmteColor(rpmte te)
uint_32 rpmteSetColor(rpmte te, uint_32 color)
/*@modifies te @*/;
/**
* Retrieve size in bytes of package file.
* @todo Signature header is estimated at 256b.
* @param te transaction element
* @return size in bytes of package file.
*/
uint_32 rpmtePkgFileSize(rpmte te)
/*@*/;
/**
* Retrieve tsort tree depth of transaction element.
* @param te transaction element

475
po/cs.po

File diff suppressed because it is too large Load Diff

475
po/da.po

File diff suppressed because it is too large Load Diff

476
po/de.po

File diff suppressed because it is too large Load Diff

474
po/fi.po

File diff suppressed because it is too large Load Diff

474
po/fr.po

File diff suppressed because it is too large Load Diff

470
po/gl.po

File diff suppressed because it is too large Load Diff

474
po/is.po

File diff suppressed because it is too large Load Diff

475
po/ja.po

File diff suppressed because it is too large Load Diff

473
po/ko.po

File diff suppressed because it is too large Load Diff

475
po/no.po

File diff suppressed because it is too large Load Diff

474
po/pl.po

File diff suppressed because it is too large Load Diff

473
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

470
po/ro.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

474
po/ru.po

File diff suppressed because it is too large Load Diff

474
po/sk.po

File diff suppressed because it is too large Load Diff

477
po/sl.po

File diff suppressed because it is too large Load Diff

474
po/sr.po

File diff suppressed because it is too large Load Diff

474
po/sv.po

File diff suppressed because it is too large Load Diff

475
po/tr.po

File diff suppressed because it is too large Load Diff

View File

@ -527,7 +527,7 @@ void initrpm(void)
REGISTER_ENUM(RPMTRANS_FLAG_NOPREUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_CHAINSAW);
REGISTER_ENUM(RPMTRANS_FLAG_ANACONDA);
REGISTER_ENUM(RPMTRANS_FLAG_NOMD5);
REGISTER_ENUM(RPMTRANS_FLAG_NOSUGGEST);
REGISTER_ENUM(RPMTRANS_FLAG_ADDINDEPS);

View File

@ -42,6 +42,7 @@
* - te.O() Return package operating system.
* - te.NEVR() Return package name-version-release.
* - te.Color() Return package color bits.
* - te.PkgFileSize() Return no. of bytes in package file (approx).
* - te.Depth() Return the level in the dependency tree (after ordering).
* - te.Npreds() Return the number of package prerequisites (after ordering).
* - te.Degree() Return the parent's degree + 1.
@ -139,6 +140,14 @@ rpmte_Color(rpmteObject * s, PyObject * args)
return Py_BuildValue("i", rpmteColor(s->te));
}
static PyObject *
rpmte_PkgFileSize(rpmteObject * s, PyObject * args)
/*@*/
{
if (!PyArg_ParseTuple(args, ":PkgFileSize")) return NULL;
return Py_BuildValue("i", rpmtePkgFileSize(s->te));
}
static PyObject *
rpmte_Depth(rpmteObject * s, PyObject * args)
/*@*/
@ -313,6 +322,8 @@ static struct PyMethodDef rpmte_methods[] = {
- Return element name-version-release.\n" },
{"Color",(PyCFunction)rpmte_Color, METH_VARARGS,
NULL},
{"PkgFileSize",(PyCFunction)rpmte_PkgFileSize, METH_VARARGS,
NULL},
{"Depth", (PyCFunction)rpmte_Depth, METH_VARARGS,
NULL},
{"Npreds", (PyCFunction)rpmte_Npreds, METH_VARARGS,

View File

@ -20,7 +20,7 @@ Name: rpm
%define version @VERSION@
Version: %{version}
%{expand: %%define rpm_version %{version}}
Release: 0.60
Release: 0.61
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/rpm-%{rpm_version}.tar.gz
Copyright: GPL
@ -470,6 +470,9 @@ exit 0
%{__includedir}/popt.h
%changelog
* Wed Jan 22 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.61
- permit anaconda to choose "presentation order".
* Wed Jan 22 2003 Jeff Johnson <jbj@redhat.com> 4.2-0.60
- fix: debugedit.c problem.

View File

@ -15,7 +15,6 @@
#include "debug.h"
static int noDeps = 1;
static int noChainsaw = 0;
static rpmVSFlags vsflags = 0;
@ -57,7 +56,6 @@ rpmGraph(rpmts ts, struct rpmInstallArguments_s * ia, const char ** fileArgv)
int argc = 0;
const char ** av = NULL;
int ac = 0;
int tsflags;
Header h;
rpmRC rpmrc;
int rc = 0;
@ -67,11 +65,6 @@ rpmGraph(rpmts ts, struct rpmInstallArguments_s * ia, const char ** fileArgv)
if (fileArgv == NULL)
return 0;
tsflags = rpmtsFlags(ts);
if (!noChainsaw)
tsflags |= RPMTRANS_FLAG_CHAINSAW;
(void) rpmtsSetFlags(ts, tsflags);
if (ia->qva_flags & VERIFY_DIGEST)
vsflags |= _RPMVSF_NODIGESTS;
if (ia->qva_flags & VERIFY_SIGNATURE)
@ -275,8 +268,9 @@ static struct poptOption optionsTable[] = {
{ "nolegacy", '\0', POPT_BIT_SET, &vsflags, RPMVSF_NEEDPAYLOAD,
N_("don't verify header+payload signature"), NULL },
{ "nochainsaw", '\0', POPT_ARGFLAG_DOC_HIDDEN, &noChainsaw, 0,
NULL, NULL},
{ "anaconda", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
&rpmIArgs.transFlags, RPMTRANS_FLAG_ANACONDA,
N_("use anaconda \"presentation order\""), NULL},
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
N_("Common options for all rpm modes and executables:"),

View File

@ -18,7 +18,6 @@ static int _depends_debug;
static int noAvailable = 1;
static const char * avdbpath =
"/usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat";
static int noChainsaw = 0;
static int noDeps = 0;
static inline /*@observer@*/ const char * const identifyDepend(int_32 f)
@ -66,8 +65,6 @@ do_tsort(const char *fileArgv[])
return 0;
ts = rpmtsCreate();
if (!noChainsaw)
(void) rpmtsSetFlags(ts, rpmtsFlags(ts) | RPMTRANS_FLAG_CHAINSAW);
rc = rpmtsOpenDB(ts, O_RDONLY);
if (rc) {
@ -277,7 +274,6 @@ exit:
static struct poptOption optionsTable[] = {
{ "noavailable", '\0', 0, &noAvailable, 0, NULL, NULL},
{ "nochainsaw", '\0', 0, &noChainsaw, 0, NULL, NULL},
{ "nodeps", '\0', 0, &noDeps, 0, NULL, NULL},
{ "verbose", 'v', 0, 0, 'v', NULL, NULL},
{ NULL, 0, 0, 0, 0, NULL, NULL}