From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11518 invoked by alias); 8 Jul 2016 10:41:32 -0000 Mailing-List: contact cygwin-apps-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-apps-cvs-owner@sourceware.org Received: (qmail 11497 invoked by uid 9795); 8 Jul 2016 10:41:31 -0000 Date: Fri, 08 Jul 2016 10:41:00 -0000 Message-ID: <20160708104131.11471.qmail@sourceware.org> From: jturney@sourceware.org To: cygwin-apps-cvs@sourceware.org Subject: [setup - the official Cygwin setup program used to install Cygwin and keep it up to date] branch master, updated. release_2.874-3-gd7dcbc6 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: ef68168531c4623d5255b9d22b781b8fd034d9ef X-Git-Newrev: d7dcbc6ff492eecc51dc4ecf6181655bb030532a X-SW-Source: 2016-q3/txt/msg00006.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=d7dcbc6ff492eecc51dc4ecf6181655bb030532a commit d7dcbc6ff492eecc51dc4ecf6181655bb030532a Author: Jon Turney Date: Thu Jul 7 13:54:51 2016 +0100 Report dependencies which don't exist At the moment, dependencies which can't be found are silently ignored. Instead, record and report these dependency problems. Signed-off-by: Jon Turney Diff: --- prereq.cc | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- prereq.h | 1 + 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/prereq.cc b/prereq.cc index c766055..bdc609e 100644 --- a/prereq.cc +++ b/prereq.cc @@ -163,11 +163,16 @@ PrereqPage::OnUnattended () // instantiate the static members map , packagemeta_ltcomp> PrereqChecker::unmet; +map > PrereqChecker::notfound; trusts PrereqChecker::theTrust = TRUST_CURR; /* This function builds a list of unmet dependencies to present to the user on - the PrereqPage propsheet. The data is stored as an associative map of - unmet[missing-package] = vector of packages that depend on missing-package */ + the PrereqPage propsheet. + + The data is stored in two associative maps: + unmet[package] = vector of packages that depend on package. + notfound[package-name] = vector of packages that depend on package. +*/ bool PrereqChecker::isMet () { @@ -177,8 +182,9 @@ PrereqChecker::isMet () Progress.SetText2 (""); Progress.SetText3 (""); - // unmet is static - clear it each time this is called + // clear static data each time this is called unmet.clear (); + notfound.clear (); // packages that need to be checked for dependencies queue todo; @@ -223,20 +229,31 @@ PrereqChecker::isMet () PackageSpecification *dep_spec = (*d)->at(0); packagemeta *dep = db.findBinary (*dep_spec); - if (dep && !(dep->desired && dep_spec->satisfies (dep->desired))) + if (dep) { - // we've got an unmet dependency - if (unmet.find (dep) == unmet.end ()) + if (!(dep->desired && dep_spec->satisfies (dep->desired))) { - // newly found dependency: add to worklist - todo.push (dep); + // we've got an unmet dependency + if (unmet.find (dep) == unmet.end ()) + { + // newly found dependency: add to worklist + todo.push (dep); + } + unmet[dep].push_back (pack); } - unmet[dep].push_back (pack); + } + else + { + // dependency on a package which doesn't have any binary versions + // (i.e. it is source only or doesn't exist) + Log (LOG_PLAIN) << "package " << pack->name << " has dependency " + << dep_spec->packageName() << " we can't find" << endLog; + notfound[dep_spec->packageName()].push_back (pack); } } } - return unmet.empty (); + return unmet.empty () && notfound.empty (); } /* Formats 'unmet' as a string for display to the user. */ @@ -245,6 +262,23 @@ PrereqChecker::getUnmetString (std::string &s) { s = ""; + { + map >::iterator i; + for (i = notfound.begin(); i != notfound.end(); i++) + { + s = s + i->first + + "\t(not found)" + + "\r\n\tRequired by: "; + for (unsigned int j = 0; j < i->second.size(); j++) + { + s += i->second[j]->name; + if (j != i->second.size() - 1) + s += ", "; + } + s += "\r\n\r\n"; + } + } + map , packagemeta_ltcomp>::iterator i; for (i = unmet.begin(); i != unmet.end(); i++) { diff --git a/prereq.h b/prereq.h index 39347aa..2aed63a 100644 --- a/prereq.h +++ b/prereq.h @@ -51,6 +51,7 @@ private: // this is the actual hash_map that does all the work static map , packagemeta_ltcomp> unmet; + static map > notfound; static trusts theTrust; };