* \file lib/depends.c
*/
-#define _DS_SCAREMEM 1
+#define _DS_SCAREMEM 0
#include "system.h"
#define _NEED_TEITERATOR 1
#include "depends.h"
-#include "rpmal.h"
#include "rpmdb.h" /* XXX response cache needs dbiOpen et al. */
#include "debug.h"
p->epoch = _free(p->epoch);
p->name = _free(p->name);
p->NEVR = _free(p->NEVR);
+
+ p->h = headerFree(p->h, "delTE");
+
memset(p, 0, sizeof(*p)); /* XXX trash and burn */
/*@-nullstate@*/ /* FIX: p->{NEVR,name} annotations */
return;
addTE(p, h, fd, key, relocs);
p->type = TR_ADDED;
- pkgKey = alAddPackage(ts->addedPackages, pkgKey, p->key, h,
+ pkgKey = alAddPackage(ts->addedPackages, pkgKey, p->key,
p->provides, p->fns);
if (pkgKey == RPMAL_NOMATCH) {
ec = 1;
goto exit;
}
p->u.addedKey = pkgKey;
+ p->h = headerLink(h, "rpmtransAddPackage");
p->multiLib = 0;
rpmFNSet fns = fnsNew(h, RPMTAG_BASENAMES, scareMem);
/* XXX FIXME: return code RPMAL_NOMATCH is error */
- (void) alAddPackage(ts->availablePackages, RPMAL_NOMATCH, key, h,
+ (void) alAddPackage(ts->availablePackages, RPMAL_NOMATCH, key,
provides, fns);
fns = fnsFree(fns);
provides = dsFree(provides);
#include <header.h>
#include <rpmhash.h>
+#include "rpmal.h"
+
typedef /*@abstract@*/ struct tsortInfo_s * tsortInfo;
typedef /*@abstract@*/ struct transactionElement_s * transactionElement;
typedef /*@abstract@*/ struct teIterator_s * teIterator;
-typedef /*@abstract@*/ struct availableList_s * availableList;
-
/*@unchecked@*/
/*@-exportlocal@*/
extern int _cacheDependsRC;
TR_REMOVED /*!< Package will be removed. */
} type; /*!< Package disposition (installed/removed). */
+/*@refcounted@*/ /*@null@*/
+ Header h; /*!< Package header. */
/*@only@*/
const char * NEVR; /*!< Package name-version-release. */
/*@owned@*/
#include "system.h"
#include "psm.h"
-#include "rpmal.h"
#include <rpmmacro.h>
#include <rpmurl.h>
int isSource;
rpmRC rc;
int i;
- alKey pkgKey = (alKey)0;
/*@-mods -temptrans -assignexpose@*/
ts->notify = notify;
fi->type = TR_ADDED;
- fi->h = alGetHeader(ts->addedPackages, pkgKey, 1);
- /* XXX can't happen */
- if (fi->h == NULL) {
- rc = RPMRC_FAIL;
- goto exit;
- }
+ fi->h = headerLink(h, "InstallSourcePackage");
fi->multiLib = 0; /* MULTILIB for src.rpm's? */
#include "debug.h"
-/*@access Header@*/ /* XXX compared with NULL */
-/*@access FD_t@*/ /* XXX compared with NULL */
-
-typedef /*@abstract@*/ struct fileIndexEntry_s * fileIndexEntry;
-typedef /*@abstract@*/ struct dirInfo_s * dirInfo;
-typedef /*@abstract@*/ struct availableIndexEntry_s * availableIndexEntry;
-typedef /*@abstract@*/ struct availableIndex_s * availableIndex;
-
-/*@access availableIndexEntry@*/
-/*@access availableIndex@*/
-/*@access fileIndexEntry@*/
-/*@access dirInfo@*/
/*@access availableList@*/
-/*@access availablePackage@*/
+#ifdef DYING
/*@access tsortInfo@*/
+#endif
/*@access alKey@*/
/*@access alNum@*/
/*@access rpmFNSet@*/
+typedef /*@abstract@*/ struct availablePackage_s * availablePackage;
+/*@access availablePackage@*/
+
/** \ingroup rpmdep
* Info about a single package to be installed.
*/
struct availablePackage_s {
-/*@refcounted@*/
- Header h; /*!< Package header. */
-/*@dependent@*/
- const char * name; /*!< Header name. */
-/*@dependent@*/
- const char * version; /*!< Header version. */
-/*@dependent@*/
- const char * release; /*!< Header release. */
-/*@dependent@*//*@null@*/
- int_32 * epoch; /*!< Header epoch (if any). */
-
/*@refcounted@*/ /*@null@*/
rpmDepSet provides; /*!< Provides: dependencies. */
/*@refcounted@*/ /*@null@*/
};
+typedef /*@abstract@*/ struct availableIndexEntry_s * availableIndexEntry;
+/*@access availableIndexEntry@*/
+
/** \ingroup rpmdep
* A single available item (e.g. a Provides: dependency).
*/
} type; /*!< Type of available item. */
};
+typedef /*@abstract@*/ struct availableIndex_s * availableIndex;
+/*@access availableIndex@*/
+
/** \ingroup rpmdep
* Index of all available items.
*/
int k; /*!< Current index. */
};
+typedef /*@abstract@*/ struct fileIndexEntry_s * fileIndexEntry;
+/*@access fileIndexEntry@*/
+
/** \ingroup rpmdep
* A file to be installed/removed.
*/
int fileFlags; /* MULTILIB */
};
+typedef /*@abstract@*/ struct dirInfo_s * dirInfo;
+/*@access dirInfo@*/
+
/** \ingroup rpmdep
* A directory to be installed/removed.
*/
/*@=nullret =temptrans =retalias @*/
}
+#ifdef DYING
/**
* Return available package.
* @param al available list
/*@=modfilesys@*/
return alp;
}
-
-Header alGetHeader(availableList al, alKey pkgKey, int unlink)
-{
- availablePackage alp = alGetPkg(al, pkgKey);
- Header h = NULL;
-
- if (alp != NULL && alp->h != NULL) {
- h = headerLink(alp->h, "alGetHeader");
- if (unlink) {
- alp->h = headerFree(alp->h, "alGetHeader unlink");
- alp->h = NULL;
- }
- }
- return h;
-}
+#endif
availableList alCreate(int delta)
{
for (i = 0; i < al->size; i++, alp++) {
alp->provides = dsFree(alp->provides);
alp->fns = fnsFree(alp->fns);
- alp->h = headerFree(alp->h, "alFree");
-
}
if ((die = al->dirs) != NULL)
/*@-modfilesys@*/
if (_al_debug)
-fprintf(stderr, "*** del %p[%d] %s-%s-%s\n", al->list, pkgNum, alp->name, alp->version, alp->release);
+fprintf(stderr, "*** del %p[%d]\n", al->list, pkgNum);
/*@=modfilesys@*/
/* Delete directory/file info entries from added package list. */
alp->provides = dsFree(alp->provides);
alp->fns = fnsFree(alp->fns);
- alp->h = headerFree(alp->h, "alDelPackage");
memset(alp, 0, sizeof(*alp)); /* XXX trash and burn */
/*@-nullstate@*/ /* FIX: al->list->h may be NULL */
/*@=nullstate@*/
}
-alKey alAddPackage(availableList al, alKey pkgKey, fnpyKey key, Header h,
+alKey alAddPackage(availableList al, alKey pkgKey, fnpyKey key,
rpmDepSet provides, rpmFNSet fns)
- /*@modifies al, h @*/
{
- HGE_t hge = (HGE_t)headerGetEntryMinMemory;
availablePackage alp;
alNum pkgNum = alKey2Num(al, pkgKey);
- int xx;
if (pkgNum >= 0 && pkgNum < al->size) {
alDelPackage(al, pkgKey);
alp = al->list + pkgNum;
/*@=nullptrarith@*/
- alp->h = headerLink(h, "alAddPackage");
-
/*@-assignexpose -temptrans @*/
alp->key = key;
/*@=assignexpose =temptrans @*/
- xx = headerNVR(alp->h, &alp->name, &alp->version, &alp->release);
- if (!hge(h, RPMTAG_EPOCH, NULL, (void **) &alp->epoch, NULL))
- alp->epoch = NULL;
-
/*@-modfilesys@*/
if (_al_debug)
-fprintf(stderr, "*** add %p[%d] %s-%s-%s\n", al->list, pkgNum, alp->name, alp->version, alp->release);
+fprintf(stderr, "*** add %p[%d]\n", al->list, pkgNum);
/*@=modfilesys@*/
/*@-assignexpose -temptrans@*/
* Structures used for managing added/available package lists.
*/
-/**
- * A package from an availableList.
- */
-typedef /*@abstract@*/ struct availablePackage_s * availablePackage;
-
-/**
- * Return available package header.
- * @param al available list
- * @param pkgKey available package key
- * @param unlink Should alp->h be unlinked?
- * @return available package header
- */
-Header alGetHeader(/*@null@*/ availableList al, /*@null@*/ alKey pkgKey,
- int unlink)
- /*@modifies al @*/;
+typedef /*@abstract@*/ struct availableList_s * availableList;
/**
* Initialize available packckages, items, and directory list.
* @param al available list
* @param pkgKey package key, RPMAL_NOMATCH to force an append
* @param key associated file name/python object
- * @param h package header
* @param provides provides dependency set
* @param fns file info set
* @return available package index
*/
alKey alAddPackage(availableList al, /*@null@*/ alKey pkgKey,
- fnpyKey key, Header h, rpmDepSet provides, rpmFNSet fns)
- /*@modifies al, h, provides, fns @*/;
+ fnpyKey key, rpmDepSet provides, rpmFNSet fns)
+ /*@modifies al, provides, fns @*/;
/**
* Add package provides to available list index.
return result;
}
-int headerMatchesDepFlags(Header h, const rpmDepSet req)
+int headerMatchesDepFlags(const Header h, const rpmDepSet req)
{
HGE_t hge = (HGE_t)headerGetEntryMinMemory;
const char * pkgN, * v, * r;
* @param req dependency
* @return 1 if dependency overlaps, 0 otherwise
*/
-int headerMatchesDepFlags(Header h, const rpmDepSet req)
+int headerMatchesDepFlags(const Header h, const rpmDepSet req)
/*@*/;
#ifdef __cplusplus
#include "system.h"
+#include <rpmmacro.h> /* XXX for rpmExpand */
+
+
#define _NEED_TEITERATOR 1
#include "psm.h"
-#include "rpmds.h"
-#include "rpmal.h"
-#include <rpmmacro.h> /* XXX for rpmExpand */
+#include "rpmds.h"
#include "fprint.h"
#include "legacy.h" /* XXX mdfile */
* @param h installed header
* @return 0 if not newer, 1 if okay
*/
-#ifdef DYING
static int ensureOlder(rpmTransactionSet ts,
- const Header h, /*@null@*/ const Header old,
- /*@dependent@*/ /*@null@*/ const void * key)
- /*@modifies ts @*/
-{
- int result, rc = 0;
-
- if (old == NULL) return 1;
-
- result = rpmVersionCompare(old, h);
- if (result <= 0)
- rc = 0;
- else if (result > 0) {
- const char * pkgNEVR = hGetNEVR(h, NULL);
- const char * altNEVR = hGetNEVR(old, NULL);
- /*@-evalorder@*/ /* LCL: is confused */
- rpmProblemSetAppend(ts->probs, RPMPROB_OLDPACKAGE,
- pkgNEVR, key,
- NULL, NULL,
- altNEVR,
- 0);
- /*@=evalorder@*/
- pkgNEVR = _free(pkgNEVR);
- altNEVR = _free(altNEVR);
- rc = 1;
- }
-
- return rc;
-}
-#else
-static int ensureOlder(rpmTransactionSet ts, transactionElement p, Header h)
+ const transactionElement p, const Header h)
/*@modifies ts @*/
{
int_32 reqFlags = (RPMSENSE_LESS | RPMSENSE_EQUAL);
return rc;
}
-#endif
/**
*/
teIterator tei;
int xx;
-int keep_header = 1; /* XXX rpmProblemSetAppend prevents dumping headers. */
+int keep_header = 0;
/* FIXME: what if the same package is included in ts twice? */
while ((p = teNext(tei, TR_ADDED)) != NULL) {
rpmdbMatchIterator mi;
- pkgKey = p->u.addedKey;
-
/*@-branchstate@*/ /* FIX: p->key ??? */
if (!archOkay(p->arch) && !(ts->ignoreSet & RPMPROB_FILTER_IGNOREARCH))
rpmProblemSetAppend(ts->probs, RPMPROB_BADARCH,
case TR_ADDED:
fi->record = 0;
- pkgKey = ts->order[oc].u.addedKey;
+/*@i@*/ fi->h = headerLink(ts->order[oc].h, "xfer to fi->h");
+ ts->order[oc].h = headerFree(ts->order[oc].h, "xfer to fi->h");
- fi->h = alGetHeader(ts->addedPackages, pkgKey, 1);
#ifdef DYING /* XXX MULTILIB multiLib from transactionElement */
fi->multiLib = alGetMultiLib(ts->addedPackages, i);
#else
/*@=noeffectuncon @*/
fi->fd = NULL;
}
+fi->h = headerFree(fi->h, "TR_ADDED fini");
freeFi(fi);
/*@switchbreak@*/ break;
case TR_REMOVED:
if (psmStage(psm, PSM_PKGERASE))
ourrc++;
}
+fi->h = headerFree(fi->h, "TR_REMOVED fini");
freeFi(fi);
/*@switchbreak@*/ break;
}
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2001-11-10 19:10-0500\n"
+"POT-Creation-Date: 2001-11-10 20:39-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Could not open %s: %s\n"
msgstr ""
-#: build/pack.c:603 lib/psm.c:2146
+#: build/pack.c:603 lib/psm.c:2139
#, c-format
msgid "Unable to write package: %s\n"
msgstr ""
msgid "Unable to write payload to %s: %s\n"
msgstr ""
-#: build/pack.c:683 lib/psm.c:2411
+#: build/pack.c:683 lib/psm.c:2404
#, c-format
msgid "Wrote: %s\n"
msgstr ""
msgid " failed - "
msgstr ""
-#: lib/depends.c:114
+#: lib/depends.c:113
#, c-format
msgid "cannot open Packages database in %s\n"
msgstr ""
-#: lib/depends.c:413
+#: lib/depends.c:415
#, c-format
msgid "package %s was already added, replacing with %s\n"
msgstr ""
-#: lib/depends.c:681
+#: lib/depends.c:684
msgid "(cached)"
msgstr ""
-#: lib/depends.c:706
+#: lib/depends.c:709
msgid "(rpmrc provides)"
msgstr ""
-#: lib/depends.c:722
+#: lib/depends.c:725
msgid "(rpmlib provides)"
msgstr ""
-#: lib/depends.c:743
+#: lib/depends.c:746
msgid "(db files)"
msgstr ""
-#: lib/depends.c:755
+#: lib/depends.c:758
msgid "(db provides)"
msgstr ""
-#: lib/depends.c:768
+#: lib/depends.c:771
msgid "(db package)"
msgstr ""
-#: lib/depends.c:807
+#: lib/depends.c:810
#, c-format
msgid "%9s: (%s, %s) added to Depends cache.\n"
msgstr ""
-#: lib/depends.c:809 lib/rpmds.c:563 lib/rpmds.c:721
+#: lib/depends.c:812 lib/rpmds.c:563 lib/rpmds.c:721
msgid "NO "
msgstr ""
-#: lib/depends.c:809 lib/rpmds.c:563 lib/rpmds.c:721
+#: lib/depends.c:812 lib/rpmds.c:563 lib/rpmds.c:721
msgid "YES"
msgstr ""
-#: lib/depends.c:1151
+#: lib/depends.c:1154
#, c-format
msgid "removing %s \"%s\" from tsort relations.\n"
msgstr ""
#. Record all relations.
-#: lib/depends.c:1384
+#: lib/depends.c:1387
msgid "========== recording tsort relations\n"
msgstr ""
#. T4. Scan for zeroes.
-#: lib/depends.c:1455
+#: lib/depends.c:1458
msgid ""
"========== tsorting packages (order, #predecessors, #succesors, depth)\n"
msgstr ""
-#: lib/depends.c:1530
+#: lib/depends.c:1533
msgid "========== successors only (presentation order)\n"
msgstr ""
-#: lib/depends.c:1590
+#: lib/depends.c:1593
msgid "LOOP:\n"
msgstr ""
-#: lib/depends.c:1625
+#: lib/depends.c:1628
msgid "========== continuing tsort ...\n"
msgstr ""
#. Return no. of packages that could not be ordered.
-#: lib/depends.c:1630
+#: lib/depends.c:1633
#, c-format
msgid "rpmdepOrder failed, %d elements remain\n"
msgstr ""
msgstr ""
#. @-modfilesys@
-#: lib/header.c:384 lib/header_internal.c:161 lib/psm.c:956
+#: lib/header.c:384 lib/header_internal.c:161 lib/psm.c:955
#, c-format
msgid "Data type %d not supported\n"
msgstr ""
msgid "is needed by"
msgstr ""
-#: lib/psm.c:272
+#: lib/psm.c:271
msgid "========== relocations\n"
msgstr ""
-#: lib/psm.c:276
+#: lib/psm.c:275
#, c-format
msgid "%5d exclude %s\n"
msgstr ""
-#: lib/psm.c:279
+#: lib/psm.c:278
#, c-format
msgid "%5d relocate %s -> %s\n"
msgstr ""
-#: lib/psm.c:349
+#: lib/psm.c:348
#, c-format
msgid "excluding multilib path %s%s\n"
msgstr ""
-#: lib/psm.c:415
+#: lib/psm.c:414
#, c-format
msgid "excluding %s %s\n"
msgstr ""
-#: lib/psm.c:425
+#: lib/psm.c:424
#, c-format
msgid "relocating %s to %s\n"
msgstr ""
-#: lib/psm.c:504
+#: lib/psm.c:503
#, c-format
msgid "relocating directory %s to %s\n"
msgstr ""
-#: lib/psm.c:1153
+#: lib/psm.c:1152
#, c-format
msgid "cannot create %%%s %s\n"
msgstr ""
-#: lib/psm.c:1159
+#: lib/psm.c:1158
#, c-format
msgid "cannot write to %%%s %s\n"
msgstr ""
-#: lib/psm.c:1200
+#: lib/psm.c:1198
msgid "source package expected, binary found\n"
msgstr ""
-#: lib/psm.c:1324
+#: lib/psm.c:1317
msgid "source package contains no .spec file\n"
msgstr ""
-#: lib/psm.c:1434
+#: lib/psm.c:1427
#, c-format
msgid "%s: running %s scriptlet\n"
msgstr ""
-#: lib/psm.c:1602
+#: lib/psm.c:1595
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n"
msgstr ""
-#: lib/psm.c:1609
+#: lib/psm.c:1602
#, c-format
msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n"
msgstr ""
-#: lib/psm.c:1951
+#: lib/psm.c:1944
#, c-format
msgid "%s: %s-%s-%s has %d files, test = %d\n"
msgstr ""
-#: lib/psm.c:2068
+#: lib/psm.c:2061
#, c-format
msgid "%s: %s scriptlet failed (%d), skipping %s-%s-%s\n"
msgstr ""
-#: lib/psm.c:2182
+#: lib/psm.c:2175
#, c-format
msgid "user %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:2191
+#: lib/psm.c:2184
#, c-format
msgid "group %s does not exist - using root\n"
msgstr ""
-#: lib/psm.c:2232
+#: lib/psm.c:2225
#, c-format
msgid "unpacking of archive failed%s%s: %s\n"
msgstr ""
-#: lib/psm.c:2233
+#: lib/psm.c:2226
msgid " on file "
msgstr ""
-#: lib/psm.c:2419
+#: lib/psm.c:2412
#, c-format
msgid "%s failed on file %s: %s\n"
msgstr ""
-#: lib/psm.c:2422
+#: lib/psm.c:2415
#, c-format
msgid "%s failed: %s\n"
msgstr ""
msgid "package %s is not installed\n"
msgstr ""
-#: lib/rpmal.c:688
+#: lib/rpmal.c:656
msgid "(added files)"
msgstr ""
-#: lib/rpmal.c:787
+#: lib/rpmal.c:755
msgid "(added provide)"
msgstr ""
msgid "Signature: UNKNOWN (%d)\n"
msgstr ""
-#: lib/transaction.c:205
+#: lib/transaction.c:206
#, c-format
msgid "%s skipped due to missingok flag\n"
msgstr ""
#. @innercontinue@
-#: lib/transaction.c:906
+#: lib/transaction.c:876
#, c-format
msgid "excluding directory %s\n"
msgstr ""