From 69410fbd83c01c585518227314ff53c7d1c96222 Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Fri, 18 Oct 2013 05:20:14 +0100 Subject: [PATCH] Don't attempt to resolve dependencies for unidentified packages. --- ChangeLog | 12 ++++++++++++ src/pkgdeps.cpp | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7d80264..0aa8045 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2013-10-18 Keith Marshall + Don't attempt to resolve dependencies for unidentified packages. + + * src/pkgdeps.cpp (pkgXmlDocument::ResolveDependencies): + [selected == NULL]: Current dependency is unresolved; do not make any + recursive call for this unidentified requirement. This avoids posting + misleading "can't get 'tarname' for non-release element <<>>" + diagnostic messages, where the subsequent "unresolved dependency" + message is sufficient; include dmhmsgs.h, and add... + (PKGMSG_SPECIFICATION_ERROR): ...this preamble instead. + +2013-10-18 Keith Marshall + Implement foundation for future NLS enabled diagnostics. * src/dmhmsgs.h: New file; it declares the NLS capable DMH interface. diff --git a/src/pkgdeps.cpp b/src/pkgdeps.cpp index f8ea9d7..678347d 100644 --- a/src/pkgdeps.cpp +++ b/src/pkgdeps.cpp @@ -30,6 +30,7 @@ #include #include "dmh.h" +#include "dmhmsgs.h" #include "debug.h" #include "pkginfo.h" @@ -501,10 +502,13 @@ pkgXmlDocument::ResolveDependencies( pkgXmlNode* package, pkgActionItem* rank ) /* Regardless of the action scheduled, we must recursively * consider further dependencies of the resolved prerequisite; + * (but note that attempting to do this would be pointless if + * the prerequisite package could not be identified). + * * FIXME: do we need to do this, when performing a removal? * Right now, I (KDM) don't think so... */ - if( (request & ACTION_INSTALL) != 0 ) + if( (selected != NULL) && ((request & ACTION_INSTALL) != 0) ) ResolveDependencies( selected, rank ); } @@ -518,6 +522,7 @@ pkgXmlDocument::ResolveDependencies( pkgXmlNode* package, pkgActionItem* rank ) const char *requestor = refpkg->GetPropVal( tarname_key, value_unknown ); dmh_control( DMH_BEGIN_DIGEST ); + dmh_notify( DMH_ERROR, PKGMSG_SPECIFICATION_ERROR ); dmh_notify( DMH_ERROR, "%s: requires...\n", requestor ); for( int i = 0; i < sizeof( key ) / sizeof( char* ); i++ ) if( (ref = dep->GetPropVal( key[i], NULL )) != NULL ) -- 2.11.0