From 4d9c5b8f5ed8df5a57152ab8d160feb0de806fc6 Mon Sep 17 00:00:00 2001 From: Lorenz Steinert Date: Tue, 31 Jul 2018 15:36:51 +0200 Subject: [PATCH] custom pacman command in ini-file --- pkgbuilder/data/pkgbuilder.ini.skel | 1 + pkgbuilder/pbds.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgbuilder/data/pkgbuilder.ini.skel b/pkgbuilder/data/pkgbuilder.ini.skel index 2f63577..04657fe 100644 --- a/pkgbuilder/data/pkgbuilder.ini.skel +++ b/pkgbuilder/data/pkgbuilder.ini.skel @@ -23,3 +23,4 @@ verbosepkglists=true ; overrides -S, useful if /tmp is small ; (default: empty/unused) chdir= +paccommand=pacman diff --git a/pkgbuilder/pbds.py b/pkgbuilder/pbds.py index e563d0f..f5502cb 100644 --- a/pkgbuilder/pbds.py +++ b/pkgbuilder/pbds.py @@ -62,11 +62,6 @@ class PBDS(object): console = None _pyc = None - if os.getenv('PACMAN') is None: - paccommand = 'pacman' - else: - paccommand = os.getenv('PACMAN') - hassudo = os.path.exists('/usr/bin/sudo') uid = os.geteuid() @@ -100,6 +95,11 @@ class PBDS(object): 'pkgbuilder', 'data/pkgbuilder.ini.skel').decode('utf-8')) config.read([confpath], encoding='utf-8') + if os.getenv('PACMAN') is None: + paccommand = config.get('extras', 'paccommand', fallback='pacman') + else: + paccommand = os.getenv('PACMAN') + # Language changing language = config.get('PKGBUILDer', 'language') if language != 'auto': @@ -115,6 +115,8 @@ class PBDS(object): log = logging.getLogger('pkgbuilder') log.info('*** PKGBUILDer v' + __version__) + + def get_setting(self, name, config_section, config_option, positive, negative): """Get the value of a setting, based on config file and arguments.