--- apt-0.5.15cnc6/apt-pkg/rpm/rpmlistparser.cc.rpm446 2006-06-15 20:37:39.414803207 +0200 +++ apt-0.5.15cnc6/apt-pkg/rpm/rpmlistparser.cc 2006-06-15 20:42:05.649004281 +0200 @@ -519,7 +519,7 @@ const char **names = NULL; int count = 0; - rpmHeaderGetEntry(header, RPMTAG_OLDFILENAMES, NULL, &names, &count); + headerGetEntry(header, RPMTAG_OLDFILENAMES, NULL, &names, &count); while (count--) { --- apt-0.5.15cnc6/apt-pkg/rpm/rpmpm.cc.rpm446 2004-03-15 23:10:41.000000000 +0100 +++ apt-0.5.15cnc6/apt-pkg/rpm/rpmpm.cc 2006-06-15 20:37:39.766821983 +0200 @@ -806,7 +806,7 @@ if (_config->FindB("RPM::NoDeps", false) == false) { rc = rpmtsCheck(TS); probs = rpmtsProblems(TS); - if (rc || probs->numProblems > 0) { + if (rc || rpmpsNumProblems(probs) > 0) { rpmpsPrint(NULL, probs); rpmpsFree(probs); _error->Error(_("Transaction set check failed")); @@ -863,7 +863,7 @@ if (rc > 0) { _error->Error(_("Error while running transaction")); - if (probs->numProblems > 0) + if (rpmpsNumProblems(probs) > 0) rpmpsPrint(stderr, probs); } else { Success = true; @@ -911,8 +911,13 @@ else if (Opts->Value == "--test") *tsFlags |= RPMTRANS_FLAG_TEST; #if RPM_VERSION >= 0x040000 +#if RPM_VERSION >= 0x040406 + else if (Opts->Value == "--nofdigests") + *tsFlags |= RPMTRANS_FLAG_NOFDIGESTS; +#else else if (Opts->Value == "--nomd5") *tsFlags |= RPMTRANS_FLAG_NOMD5; +#endif else if (Opts->Value == "--repackage") *tsFlags |= RPMTRANS_FLAG_REPACKAGE; #endif --- apt-0.5.15lorg3.2/apt-pkg/rpm/rpmhandler.cc.bak 2006-06-22 00:16:14.000000000 +0200 +++ apt-0.5.15lorg3.2/apt-pkg/rpm/rpmhandler.cc 2007-03-23 01:45:51.138492892 +0100 @@ -103,25 +103,38 @@ bool RPMHandler::HasFile(const char *File) { + bool result = false; if (*File == '\0') - return false; - char **names = NULL; - void *val; + return result; + const char **basenames = NULL; + const char **dirnames = NULL; + int_32 *dirindexes = NULL; + int_32 count = 0; - rpmHeaderGetEntry(HeaderP, RPMTAG_OLDFILENAMES, - NULL, (void **) &val, &count); + int_32 dircount = 0; + int_32 indexcount = 0; + bool ret = true; + headerGetEntry(HeaderP, RPMTAG_BASENAMES, + NULL, (void **) &basenames, &count); + headerGetEntry(HeaderP, RPMTAG_DIRNAMES, + NULL, (void **) &dirnames, &dircount); + headerGetEntry(HeaderP, RPMTAG_DIRINDEXES, + NULL, (void **) &dirindexes, &indexcount); if (count < 1) return false; - names = (char **)val; while (count--) { - char *name = names[count]; + const char *name = (string(dirnames[dirindexes[count]]) + string(basenames[count])).c_str(); if (strcmp(name, File) == 0) - return true; + { + result = true; + break; + } } - free(names); - return false; + free(basenames); + free(dirnames); + return result; } bool RPMHandler::InternalDep(const char *name, const char *ver, int_32 flag) @@ -401,17 +414,24 @@ bool RPMHandler::FileProvides(vector<string> &FileProvs) { - const char **names = NULL; - void *val = NULL; + const char **basenames = NULL; + const char **dirnames = NULL; + int_32 *dirindexes = NULL; + int_32 dircount = 0; + int_32 indexcount = 0; int_32 count = 0; bool ret = true; - rpmHeaderGetEntry(HeaderP, RPMTAG_OLDFILENAMES, - NULL, (void **) &val, &count); - names = (const char **)val; + headerGetEntry(HeaderP, RPMTAG_BASENAMES, + NULL, (void **) &basenames, &count); + headerGetEntry(HeaderP, RPMTAG_DIRNAMES, + NULL, (void **) &dirnames, &dircount); + headerGetEntry(HeaderP, RPMTAG_DIRINDEXES, + NULL, (void **) &dirindexes, &indexcount); while (count--) { - FileProvs.push_back(names[count]); + FileProvs.push_back((string(dirnames[dirindexes[count]]) + string(basenames[count])).c_str()); } - free(names); + free(basenames); + free(dirnames); return ret; }