[pacman-dev] [PATCH v3] Treat packages to be printed as non-ignored
Xyne
xyne at archlinux.ca
Thu Mar 14 03:55:48 EDT 2013
Allan McRae wrote:
>On 14/03/13 16:37, Connor Behan wrote:
>> Calling pacman -Sp and pacman -Sup are guaranteed not to install a
>> package. So the user's IgnorePkg pref is respected regardless of whether
>> or not we print the mirror location. Therefore we do so in the case of
>> -Sp as this gives the full information requested by the user. We avoid
>> doing so in the case of -Sup as this would mislead the user into
>> thinking that the upgrade is bigger than it really is. This fixes an
>> edge case with devtools.
>>
>> Signed-off-by: Connor Behan <connor.behan at gmail.com>
>> ---
>> src/pacman/conf.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/src/pacman/conf.c b/src/pacman/conf.c
>> index 3f1b1c3..99e6af1 100644
>> --- a/src/pacman/conf.c
>> +++ b/src/pacman/conf.c
>> @@ -1010,6 +1010,13 @@ int parseconfig(const char *file)
>> if((ret = _parseconfig(file, §ion, 1, 0))) {
>> return ret;
>> }
>> +
>> + /* #FS#34066 - Querying URLs for packages specified on the command line (even ignored ones) should succeed */
>
>Fine apart from the comment. I do not like referring to bug reports.
>The comment should stand alone in the code and not require referring
>elsewhere.
>
>Also, the comment is not quite right as "pacman -Sup foo" will still
>exclude "foo" if that is in IgnorePkg.
>
>How about:
>
>"Print URLs for all given packages on non-upgrade operations"?
>
>If that is OK, I can make the adjustment when I pull it.
>
>
>> + if(config->print && !config->op_s_upgrade) {
>> + config->ignorepkg = NULL;
>> + config->ignoregrp = NULL;
>> + }
>> +
>> if((ret = setup_libalpm())) {
>> return ret;
>> }
>>
This may break simple scripts that naively parse the output (updaters,
notifiers, downloaders, ...). While that is not officially supported there is
really no reason to change expected behavior for this. I think a better
approach would be to omit ignored packages unless they are explicitly included
on the command line. Otherwise perhaps you could use a special argument to
'--ignore' (or a custom option) to stop ignoring packages for a given operation
(e.g. --ignore -).
Both cases remain backwards compatible with past behavior and avoid surprises.
Regards,
Xyne
More information about the pacman-dev
mailing list