From bbee6136ab5fd9cb7f6cdbc8812c54d7769fa679 Mon Sep 17 00:00:00 2001 From: GLolol Date: Tue, 18 Nov 2014 14:46:44 -0800 Subject: [PATCH] PkgInfo: make 'archs' config variable imply 'source' and 'all' --- PkgInfo/config.py | 7 +++---- PkgInfo/plugin.py | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/PkgInfo/config.py b/PkgInfo/config.py index e8161e6..e3cb56e 100644 --- a/PkgInfo/config.py +++ b/PkgInfo/config.py @@ -49,11 +49,10 @@ def configure(advanced): PkgInfo = conf.registerPlugin('PkgInfo') conf.registerGlobalValue(PkgInfo, 'archs', - registry.CommaSeparatedListOfStrings(['i386','amd64','all'], + registry.CommaSeparatedListOfStrings(['i386','amd64'], _("""Defines what architectures the bot will look for in the 'vlist' - command. It is recommended to include 'all' in this list because - some packages are architecture independent and will not otherwise be - displayed, leading to misleading "No results found" errors."""))) + command. Architectures 'all' (arch-independent packages) and 'source' + (source packages) are implied."""))) conf.registerGlobalValue(PkgInfo, 'verbose', registry.Boolean(True, _("""Determines whether verbose output will be used (show architectures, diff --git a/PkgInfo/plugin.py b/PkgInfo/plugin.py index 8ac379a..af66334 100644 --- a/PkgInfo/plugin.py +++ b/PkgInfo/plugin.py @@ -86,7 +86,10 @@ class PkgInfo(callbacks.Plugin): return distro def MadisonParse(self, pkg, dist, codenames='', suite='', useSource=False, reverse=False): - arch = ','.join(self.registryValue("archs")) + # The arch value implies 'all' (architecture-independent packages) and 'source' + # (source packages), in order to prevent misleading "Not found" errors. + arch = self.registryValue("archs") + ['all', 'source'] + arch = ','.join(set(arch)) self.arg = {'package':pkg,'table':dist,'a':arch,'c':codenames,'s':suite, } if useSource: