Remove DYING code.
authorjbj <devnull@localhost>
Mon, 29 Oct 2001 16:39:13 +0000 (16:39 +0000)
committerjbj <devnull@localhost>
Mon, 29 Oct 2001 16:39:13 +0000 (16:39 +0000)
CVS patchset: 5139
CVS date: 2001/10/29 16:39:13

lib/misc.h
lib/psm.c
lib/psm.h
lib/transaction.c

index c730a72..b530c40 100644 (file)
@@ -6,14 +6,6 @@
  *
  */
 
-#ifdef DYING
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "header.h"
-#include "ugid.h"
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index cd18d47..f86995d 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -73,83 +73,6 @@ int rpmVersionCompare(Header first, Header second)
     return rpmvercmp(one, two);
 }
 
-#ifdef DYING
-rpmProblemSet rpmProblemSetCreate(void)
-{
-    rpmProblemSet probs;
-
-    probs = xcalloc(1, sizeof(*probs));        /* XXX memory leak */
-    probs->numProblems = probs->numProblemsAlloced = 0;
-    probs->probs = NULL;
-
-    return probs;
-}
-
-void rpmProblemSetAppend(rpmProblemSet probs, rpmProblemType type,
-               const availablePackage alp,
-               const char * dn, const char * bn,
-               Header altH, unsigned long ulong1)
-{
-    rpmProblem p;
-    char *t;
-
-    if (probs->numProblems == probs->numProblemsAlloced) {
-       if (probs->numProblemsAlloced)
-           probs->numProblemsAlloced *= 2;
-       else
-           probs->numProblemsAlloced = 2;
-       probs->probs = xrealloc(probs->probs,
-                       probs->numProblemsAlloced * sizeof(*probs->probs));
-    }
-
-    p = probs->probs + probs->numProblems;
-    probs->numProblems++;
-    memset(p, 0, sizeof(*p));
-    p->type = type;
-    /*@-assignexpose@*/
-    p->key = alp->key;
-    /*@=assignexpose@*/
-    p->ulong1 = ulong1;
-    p->ignoreProblem = 0;
-    p->str1 = NULL;
-    p->h = NULL;
-    p->pkgNEVR = NULL;
-    p->altNEVR = NULL;
-
-    if (dn || bn) {
-       p->str1 =
-           t = xcalloc(1, (dn ? strlen(dn) : 0) + (bn ? strlen(bn) : 0) + 1);
-       if (dn) t = stpcpy(t, dn);
-       if (bn) t = stpcpy(t, bn);
-    }
-
-    if (alp) {
-       p->h = headerLink(alp->h);
-       p->pkgNEVR =
-           t = xcalloc(1, strlen(alp->name) +
-                          strlen(alp->version) +
-                          strlen(alp->release) + sizeof("--"));
-       t = stpcpy(t, alp->name);
-       t = stpcpy(t, "-");
-       t = stpcpy(t, alp->version);
-       t = stpcpy(t, "-");
-       t = stpcpy(t, alp->release);
-    }
-
-    if (altH) {
-       const char * n, * v, * r;
-       (void) headerNVR(altH, &n, &v, &r);
-       p->altNEVR =
-           t = xcalloc(1, strlen(n) + strlen(v) + strlen(r) + sizeof("--"));
-       t = stpcpy(t, n);
-       t = stpcpy(t, "-");
-       t = stpcpy(t, v);
-       t = stpcpy(t, "-");
-       t = stpcpy(t, r);
-    }
-}
-#endif /* DYING */
-
 /**
  */
 static /*@observer@*/ const char *const ftstring (fileTypes ft)
index 1af348d..873e61a 100644 (file)
--- a/lib/psm.h
+++ b/lib/psm.h
@@ -173,23 +173,6 @@ struct psm_s {
 extern "C" {
 #endif
 
-#ifdef DYING
-/**
- * Create problem set.
- */
-/*@only@*/ rpmProblemSet rpmProblemSetCreate(void)
-       /*@*/;
-
-/**
- * Append problem to set.
- */
-void rpmProblemSetAppend(rpmProblemSet tsprobs, rpmProblemType type,
-               const availablePackage alp,
-               const char * dn, const char * bn,
-               Header altH, unsigned long ulong1)
-       /*@modifies tsprobs, alp @*/;
-#endif /* DYING */
-
 /**
  * Return file type from mode_t.
  * @param mode         file mode bits (from header)
index b8313fc..f33b1c4 100644 (file)
@@ -77,10 +77,6 @@ struct diskspaceInfo {
    probably right :-( */
 #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
 
-#ifdef DYING
-#define XSTRCMP(a, b) ((!(a) && !(b)) || ((a) && (b) && !strcmp((a), (b))))
-#endif
-
 /**
  */
 static /*@null@*/ void * freeFl(rpmTransactionSet ts,
@@ -199,75 +195,6 @@ static int osOkay(Header h)
     return 1;
 }
 
-#ifdef DYING
-void rpmProblemSetFree(rpmProblemSet tsprobs)
-{
-    int i;
-
-    for (i = 0; i < tsprobs->numProblems; i++) {
-       rpmProblem p = tsprobs->probs + i;
-       p->h = headerFree(p->h);
-       p->pkgNEVR = _free(p->pkgNEVR);
-       p->altNEVR = _free(p->altNEVR);
-       p->str1 = _free(p->str1);
-    }
-    free(tsprobs);
-}
-
-/**
- * Filter a problem set.
- * As the problem sets are generated in an order solely dependent
- * on the ordering of the packages in the transaction, and that
- * ordering can't be changed, the problem sets must be parallel to
- * one another. Additionally, the filter set must be a subset of the
- * target set, given the operations available on transaction set.
- * This is good, as it lets us perform this trim in linear time, rather
- * then logarithmic or quadratic.
- *
- * @param tsprobs      transaction problem set
- * @param filter       filter
- * @return             0 no problems, 1 if problems remain
- */
-static int rpmProblemSetTrim(rpmProblemSet tsprobs, rpmProblemSet filter)
-       /*@modifies tsprobs @*/
-{
-    rpmProblem t = tsprobs->probs;
-    rpmProblem f = filter->probs;
-    int gotProblems = 0;
-
-    /*@-branchstate@*/
-    while ((f - filter->probs) < filter->numProblems) {
-       if (!f->ignoreProblem) {
-           f++;
-           continue;
-       }
-       while ((t - tsprobs->probs) < tsprobs->numProblems) {
-           /*@-nullpass@*/     /* LCL: looks good to me */
-           if (f->h == t->h && f->type == t->type && t->key == f->key &&
-                    XSTRCMP(f->str1, t->str1))
-               /*@innerbreak@*/ break;
-           /*@=nullpass@*/
-           t++;
-           gotProblems = 1;
-       }
-
-       if ((t - tsprobs->probs) == tsprobs->numProblems) {
-           /* this can't happen ;-) let's be sane if it doesn though */
-           break;
-       }
-
-       t->ignoreProblem = f->ignoreProblem;
-       t++, f++;
-    }
-    /*@=branchstate@*/
-
-    if ((t - tsprobs->probs) < tsprobs->numProblems)
-       gotProblems = 1;
-
-    return gotProblems;
-}
-#endif /* DYING */
-
 /**
  */
 static int sharedCmp(const void * one, const void * two)