OSDN Git Service

Don't attempt to resolve dependencies for unidentified packages.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 18 Oct 2013 04:20:14 +0000 (05:20 +0100)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Fri, 18 Oct 2013 04:20:14 +0000 (05:20 +0100)
ChangeLog
src/pkgdeps.cpp

index 7d80264..0aa8045 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2013-10-18  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
+       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 <<<unknown>>>"
+       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  <keithmarshall@users.sourceforge.net>
+
        Implement foundation for future NLS enabled diagnostics.
 
        * src/dmhmsgs.h: New file; it declares the NLS capable DMH interface.
index f8ea9d7..678347d 100644 (file)
@@ -30,6 +30,7 @@
 #include <string.h>
 
 #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 )