From 83ca3994a9b4be796f53ef734d5cb18df0e89b5e Mon Sep 17 00:00:00 2001 From: Keith Marshall Date: Mon, 5 Mar 2012 16:23:44 +0000 Subject: [PATCH] Don't suppress implied downloads for top-level actions. --- ChangeLog | 11 +++++++++++ src/pkgdeps.cpp | 12 ++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f60bbb..c3826b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-03-05 Keith Marshall + + 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 Copyright notice updates. diff --git a/src/pkgdeps.cpp b/src/pkgdeps.cpp index e3f669e..58b435c 100644 --- a/src/pkgdeps.cpp +++ b/src/pkgdeps.cpp @@ -4,7 +4,7 @@ * $Id$ * * Written by Keith Marshall - * 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 ) -- 2.11.0