OSDN Git Service

Don't suppress implied downloads for top-level actions.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 5 Mar 2012 16:23:44 +0000 (16:23 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 5 Mar 2012 16:23:44 +0000 (16:23 +0000)
ChangeLog
src/pkgdeps.cpp

index 1f60bbb..c3826b5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-03-05  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Don't suppress implied downloads for top-level actions.
+
+       * src/pkgdeps.cpp: Update copyright notice for new year.
+       (pkgXmlDocument::Schedule) [!OPTION_PRINT_URIS]: Ensure that...
+       [ACTION_DOWNLOAD]: ...this is enabled, when scheduling an install or
+       an upgrade action for a package specified as a command line argument;
+       this corrects a regression introduced on 2011-11-09, which resulted in
+       ACTION_DOWNLOAD being enabled only for second tier dependent actions.
+
 2012-02-20  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Copyright notice updates.
index e3f669e..58b435c 100644 (file)
@@ -4,7 +4,7 @@
  * $Id$
  *
  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
- * Copyright (C) 2009, 2010, 2011, MinGW Project
+ * Copyright (C) 2009, 2010, 2011, 2012, MinGW Project
  *
  *
  * Implementation of the package dependency resolver method, of the
@@ -196,7 +196,7 @@ bool is_abi_compatible( pkgSpecs *refdata, const char *version )
   return ((version != NULL) && (strcmp( version, ref_version ) == 0));
 }
 
-#define with_flags( request )       ((request) & ~(ACTION_MASK))
+#define with_flags( request )       ((request) & ~(ACTION_MASK | ACTION_DOWNLOAD))
 #define promote( request, action )  (with_flags( request ) | with_download( action ))
 #define with_download( action )     ((action) | (ACTION_DOWNLOAD))
 
@@ -597,6 +597,14 @@ void pkgXmlDocument::Schedule( unsigned long action, const char* name )
         */
        action |= ACTION_PRIMARY;
 
+       /* Furthermore, any primary action must be supported by
+        * an implied download activity, unless the '--print-uris'
+        * option is in effect.
+        */
+       if(  ((action & ACTION_UPGRADE) == ACTION_UPGRADE)
+       &&  (pkgOptions()->Test( OPTION_PRINT_URIS ) != OPTION_PRINT_URIS)  )
+         action |= ACTION_DOWNLOAD;
+
        /* For each candidate release in turn...
         */
        while( release != NULL )