[git-buildpackage] could gbp.config.GbpOptionParser.get_config_files handle GBP_CONF_FILES=''

Nish Aravamudan nish.aravamudan at canonical.com
Wed Jan 10 23:21:52 CET 2018


For the reproducibility/debuggability of the git-ubuntu snap, we want to
ensure that everyone will end up running certain commands (e.g., quilt,
gbp) the same, no matter what their local configuration is. This is
especially true for the importer itself, but is also true for other
subcommands in our case.

I wonder if it might be reasonable to do:

diff --git a/gbp/config.py b/gbp/config.py
index 8acf15da..c2feb2ab 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -409,7 +409,7 @@ class GbpOptionParser(OptionParser):
         >>> if conf_backup is not None: os.environ['GBP_CONF_FILES'] = conf_backup
         """
         envvar = os.environ.get('GBP_CONF_FILES')
-        files = envvar.split(':') if envvar else [f for (f, _) in cls.def_config_files]
+        files = envvar.split(':') if envvar is not None else [f for (f, _) in cls.def_config_files]
         files = [os.path.expanduser(fname) for fname in files]
         if no_local:
             files = [fname for fname in files if fname.startswith('/')]

This would allow environments that wish to disable config file parsing
(and thus behavioral variability) to juset set GBP_CONF_FILES='' rather
than to something like '/dev/null' (which seems to be the only choice
currently)?

Thanks,
Nish

-- 
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd


More information about the git-buildpackage mailing list