| |
| |
| @@ -79,6 +79,12 @@ |
| /*@modifies db, *matchList, rpmGlobalMacroContext, |
| fileSystem, internalState @*/; |
| |
| +int rpmdbFindFpListExclude(/*@null@*/ rpmdb db, fingerPrint * fpList, |
| + /*@out@*/ dbiIndexSet * matchList, int numItems, unsigned int exclude) |
| + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ |
| + /*@modifies db, *matchList, rpmGlobalMacroContext, |
| + fileSystem, internalState @*/; |
| + |
| /* Be carefull with the memory... assert(*fullName == '/' || !scareMemory) */ |
| |
| /** |
| |
| |
| @@ -3388,11 +3388,17 @@ |
| return 0; |
| } |
| |
| -/* XXX transaction.c */ |
| -/*@-compmempass@*/ |
| int rpmdbFindFpList(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, |
| int numItems) |
| { |
| + return rpmdbFindFpListExclude(db, fpList, matchList, numItems, 0); |
| +} |
| + |
| +/* XXX transaction.c */ |
| +/*@-compmempass@*/ |
| +int rpmdbFindFpListExclude(rpmdb db, fingerPrint * fpList, dbiIndexSet * matchList, |
| + int numItems, unsigned int exclude) |
| +{ |
| DBT * key; |
| DBT * data; |
| HGE_t hge = (HGE_t)headerGetEntryMinMemory; |
| @@ -3424,7 +3430,10 @@ |
| key->size = strlen((char *)key->data); |
| if (key->size == 0) key->size++; /* XXX "/" fixup. */ |
| |
| - if (skipDir(fpList[i].entry->dirName)) |
| + /* HACK HACK HACK: don't skip dirs while removing |
| + * packages as we will loose files on conflicts. |
| + * exclude is not zero when removing */ |
| + if (!exclude && skipDir(fpList[i].entry->dirName)) |
| continue; |
| |
| xx = rpmdbGrowIterator(mi, i); |
| |
| |
| @@ -1750,7 +1750,7 @@ |
| (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); |
| /* Extract file info for all files in this package from the database. */ |
| matches = xcalloc(fc, sizeof(*matches)); |
| - if (rpmdbFindFpList(rpmtsGetRdb(ts), fi->fps, matches, fc)) { |
| + if (rpmdbFindFpListExclude(rpmtsGetRdb(ts), fi->fps, matches, fc, rpmteType(p) == TR_REMOVED ? fi->record : 0)) { |
| ps = rpmpsFree(ps); |
| rpmtsFreeLock(lock); |
| return 1; /* XXX WTFO? */ |