From ccee73bb5935ac3a4c6f93bcc7bacb396d997319 Mon Sep 17 00:00:00 2001 From: Alexey Tourbin Date: Wed, 18 Aug 2010 16:16:11 +0400 Subject: [PATCH] rpmpm.c: fixed rpmdepCheck() call It is not clear what rpmdepCheck() return code is supposed to mean. Logically, non-zero return code should mean that the dependency check failed. However, rpm can also return 0 (for "no error") while setting "conflicts" pointer. So, for now, it seems that we should check both the return code and the pointer. --- apt/apt-pkg/rpm/rpmpm.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apt/apt-pkg/rpm/rpmpm.cc b/apt/apt-pkg/rpm/rpmpm.cc index 33c5e83..950c5e3 100644 --- a/apt/apt-pkg/rpm/rpmpm.cc +++ b/apt/apt-pkg/rpm/rpmpm.cc @@ -852,14 +852,14 @@ bool pkgRPMLibPM::Process(vector &install, } } #else -#if RPM_VERSION < 0x040000 - rpmDependencyConflict *conflicts; -#else - rpmDependencyConflict conflicts; -#endif if (_config->FindB("RPM::NoDeps", false) == false) { +#if RPM_VERSION < 0x040000 + rpmDependencyConflict *conflicts = NULL; +#else + rpmDependencyConflict conflicts = NULL; +#endif int numConflicts; - if (rpmdepCheck(TS, &conflicts, &numConflicts)) { + if (rpmdepCheck(TS, &conflicts, &numConflicts) || conflicts) { _error->Error(_("Transaction set check failed")); if (conflicts) { printDepProblems(stderr, conflicts, numConflicts);