summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2008-08-12 21:19:11 +0200
committerFlorian Festi <ffesti@redhat.com>2008-10-24 10:34:25 +0200
commiteecfbcbeb0b102c4518c5576e88d48c039ac635f (patch)
tree2255dfb987846ae0914ea92008248f625b53f1f9
parentc65019affca0988705ea4b8b9b38adbeca6ac98f (diff)
downloadlibrpm-tizen-eecfbcbeb0b102c4518c5576e88d48c039ac635f.tar.gz
librpm-tizen-eecfbcbeb0b102c4518c5576e88d48c039ac635f.tar.bz2
librpm-tizen-eecfbcbeb0b102c4518c5576e88d48c039ac635f.zip
Delete findFps foobar
including fpsCompare and the fpsdebug opt
-rw-r--r--lib/poptALL.c4
-rw-r--r--lib/rpmts.h1
-rw-r--r--lib/transaction.c129
3 files changed, 0 insertions, 134 deletions
diff --git a/lib/poptALL.c b/lib/poptALL.c
index 8bfe8f9a2..4bce0e046 100644
--- a/lib/poptALL.c
+++ b/lib/poptALL.c
@@ -26,8 +26,6 @@ static int _debug = 0;
extern int _rpmds_nopromote;
-extern int _fps_debug;
-
extern int _fsm_debug;
extern int _fsm_threads;
@@ -253,8 +251,6 @@ struct poptOption rpmcliAllPoptTable[] = {
{ "promoteepoch", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmds_nopromote, 0,
NULL, NULL},
- { "fpsdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fps_debug, -1,
- NULL, NULL},
{ "fsmdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fsm_debug, -1,
N_("debug payload file state machine"), NULL},
{ "fsmthreads", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_fsm_threads, -1,
diff --git a/lib/rpmts.h b/lib/rpmts.h
index da97d0fd2..2fda5807b 100644
--- a/lib/rpmts.h
+++ b/lib/rpmts.h
@@ -21,7 +21,6 @@ extern "C" {
extern int _rpmts_debug;
extern int _rpmts_stats;
-extern int _fps_debug;
/** \ingroup rpmts
* Bit(s) to control rpmtsRun() operation.
diff --git a/lib/transaction.c b/lib/transaction.c
index cf60d0be4..69e110378 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -239,135 +239,6 @@ static int handleRmvdInstalledFiles(const rpmts ts, rpmfi fi,
return 0;
}
-#define ISROOT(_d) (((_d)[0] == '/' && (_d)[1] == '\0') ? "" : (_d))
-
-int _fps_debug = 0;
-
-static int fpsCompare (const void * one, const void * two)
-{
- const struct fingerPrint_s * a = (const struct fingerPrint_s *)one;
- const struct fingerPrint_s * b = (const struct fingerPrint_s *)two;
- size_t adnlen = strlen(a->entry->dirName);
- size_t asnlen = (a->subDir ? strlen(a->subDir) : 0);
- size_t abnlen = strlen(a->baseName);
- size_t bdnlen = strlen(b->entry->dirName);
- size_t bsnlen = (b->subDir ? strlen(b->subDir) : 0);
- size_t bbnlen = strlen(b->baseName);
- char *afn = NULL, *bfn = NULL;
- int rc = 0;
-
- if (adnlen == 1 && asnlen != 0) adnlen = 0;
- if (bdnlen == 1 && bsnlen != 0) bdnlen = 0;
-
- if (adnlen) rstrcat(&afn, a->entry->dirName);
- rstrcat(&afn, "/");
- if (a->subDir && asnlen) rstrcat(&afn, a->subDir);
- if (abnlen) rstrcat(&afn, a->baseName);
- if (afn[0] == '/' && afn[1] == '/') {
- memmove(afn, afn+1, strlen(afn+1)+1);
- }
-
- if (bdnlen) rstrcat(&bfn, b->entry->dirName);
- rstrcat(&bfn, "/");
- if (b->subDir && bsnlen) rstrcat(&bfn, b->subDir);
- if (bbnlen) rstrcat(&bfn, b->baseName);
- if (bfn[0] == '/' && bfn[1] == '/') {
- memmove(bfn, bfn+1, strlen(bfn+1)+1);
- }
-
- rc = strcmp(afn, bfn);
-if (_fps_debug)
-fprintf(stderr, "\trc(%d) = strcmp(\"%s\", \"%s\")\n", rc, afn, bfn);
-
-if (_fps_debug)
-fprintf(stderr, "\t%s/%s%s\trc %d\n",
-ISROOT(b->entry->dirName),
-(b->subDir ? b->subDir : ""),
-b->baseName,
-rc
-);
- free(afn);
- free(bfn);
-
- return rc;
-}
-
-static int _linear_fps_search = 0;
-
-static int findFps(const struct fingerPrint_s * fiFps,
- const struct fingerPrint_s * otherFps,
- int otherFc)
-{
- int otherFileNum;
-
-if (_fps_debug)
-fprintf(stderr, "==> %s/%s%s\n",
-ISROOT(fiFps->entry->dirName),
-(fiFps->subDir ? fiFps->subDir : ""),
-fiFps->baseName);
-
- if (_linear_fps_search) {
-
-linear:
- for (otherFileNum = 0; otherFileNum < otherFc; otherFileNum++, otherFps++) {
-
-if (_fps_debug)
-fprintf(stderr, "\t%4d %s/%s%s\n", otherFileNum,
-ISROOT(otherFps->entry->dirName),
-(otherFps->subDir ? otherFps->subDir : ""),
-otherFps->baseName);
-
- /* If the addresses are the same, so are the values. */
- if (fiFps == otherFps)
- break;
-
- /* Otherwise, compare fingerprints by value. */
- if (FP_EQUAL((*fiFps), (*otherFps)))
- break;
- }
-
-if (otherFileNum == otherFc) {
-if (_fps_debug)
-fprintf(stderr, "*** FP_EQUAL NULL %s/%s%s\n",
-ISROOT(fiFps->entry->dirName),
-(fiFps->subDir ? fiFps->subDir : ""),
-fiFps->baseName);
-}
-
- return otherFileNum;
-
- } else {
-
- const struct fingerPrint_s * bingoFps;
-
- bingoFps = bsearch(fiFps, otherFps, otherFc, sizeof(*otherFps), fpsCompare);
- if (bingoFps == NULL) {
-if (_fps_debug)
-fprintf(stderr, "*** bingoFps NULL %s/%s%s\n",
-ISROOT(fiFps->entry->dirName),
-(fiFps->subDir ? fiFps->subDir : ""),
-fiFps->baseName);
- goto linear;
- }
-
- /* If the addresses are the same, so are the values. */
- /* LCL: looks good to me */
- if (!(fiFps == bingoFps || FP_EQUAL((*fiFps), (*bingoFps)))) {
-if (_fps_debug)
-fprintf(stderr, "*** BAD %s/%s%s\n",
-ISROOT(bingoFps->entry->dirName),
-(bingoFps->subDir ? bingoFps->subDir : ""),
-bingoFps->baseName);
- goto linear;
- }
-
- otherFileNum = (bingoFps != NULL ? (bingoFps - otherFps) : 0);
-
- }
-
- return otherFileNum;
-}
-
/**
* Update disk space needs on each partition for this package's files.
*/