Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2018-01-24 Thread Ghislain Vaillant
On Sat, 16 Dec 2017 08:36:03 +0100 Guido =?iso-8859-1?Q?G=FCnther?=  wrote:
> 
> Another issue is that once we do this writing config files (which
will
will
> need to happen too) has to decide what to do if both ~/.gbp.conf and
> ~/.git-buildpackage/gbp.conf are there. With the current order we'd
need
> to still favour ~/.gbp.conf so IMHO the XDG_CONFIG_HOME version needs
> to have higher priority than ~/.gbp.conf.

I second that $XDG_CONFIG_HOME/git-buildpackage/gbp.conf should be
given priority over $HOME/.gbp.conf, which should facilitate the
transition whilst keeping old configurations working.

Ghis



Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2017-12-15 Thread Guido Günther
Hi,
On Tue, Dec 12, 2017 at 09:31:42PM +0100, Félix Sipma wrote:
> Package: git-buildpackage
> Version: 0.9.4
> Followup-For: Bug #787519
> 
> Would you accept the patch if it used 
> XDG_CONFIG_HOME/git-buildpackage/gbp.conf
> instead?

We should do at least that (.config/debian/ is still unpopulated on my
system). Given that gbp users went through several configuration file
renames and changes I'm reluctant to do this with gbp at the moment,
given that it's only a single file. Is not having it in XDG_CONFIG_HOME
more an issue for you?

Another issue is that once we do this writing config files (which will
need to happen too) has to decide what to do if both ~/.gbp.conf and
~/.git-buildpackage/gbp.conf are there. With the current order we'd need
to still favour ~/.gbp.conf so IMHO the XDG_CONFIG_HOME version needs
to have higher priority than ~/.gbp.conf.

Cheers,
 -- Guido


>
> -- System Information:
> Debian Release: buster/sid
>   APT prefers unstable
>   APT policy: (990, 'unstable'), (500, 'stable'), (100, 'experimental')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
> 
> Kernel: Linux 4.14.0-1-amd64 (SMP w/4 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
> LANGUAGE=en_US:en (charmap=UTF-8)
> Shell: /bin/sh linked to /usr/bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages git-buildpackage depends on:
> ii  devscripts 2.17.11
> ii  git1:2.15.1-1
> ii  man-db 2.7.6.1-4
> ii  python33.6.3-2
> ii  python3-dateutil   2.6.1-1
> ii  python3-pkg-resources  38.2.4-1
> 
> Versions of packages git-buildpackage recommends:
> ii  pristine-tar  1.42
> ii  python3-requests  2.18.1-1
> ii  sbuild0.73.0-4
> 
> Versions of packages git-buildpackage suggests:
> pn  python3-notify2  
> ii  sudo 1.8.21p2-2
> ii  unzip6.0-21
> 
> -- no debconf information



Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2017-12-12 Thread Félix Sipma
Package: git-buildpackage
Version: 0.9.4
Followup-For: Bug #787519

Would you accept the patch if it used XDG_CONFIG_HOME/git-buildpackage/gbp.conf
instead?

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'stable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages git-buildpackage depends on:
ii  devscripts 2.17.11
ii  git1:2.15.1-1
ii  man-db 2.7.6.1-4
ii  python33.6.3-2
ii  python3-dateutil   2.6.1-1
ii  python3-pkg-resources  38.2.4-1

Versions of packages git-buildpackage recommends:
ii  pristine-tar  1.42
ii  python3-requests  2.18.1-1
ii  sbuild0.73.0-4

Versions of packages git-buildpackage suggests:
pn  python3-notify2  
ii  sudo 1.8.21p2-2
ii  unzip6.0-21

-- no debconf information


signature.asc
Description: PGP signature


Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2016-07-05 Thread Guido Günther
Hi Rodolphe,
On Tue, Jun 02, 2015 at 03:28:03PM +0200, Rodolphe PELLOUX-PRAYER wrote:
> Package: git-buildpackage
> Version: 0.6.30
> Severity: wishlist
> Tags: patch
> 
> Hi,
> 
> Here a patch to allow use of XDG_CONFIG_HOME/debian/gbp.conf for settings.
> Reading ~/.gbp.conf is still provided for convenience.

I doesn't seem that $XDG_HOME/debian/ is already used and I'd rather not
add even more config file locations for no good reason so could you
explain why this would be useful?
Cheers,
 -- Guido



Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2015-06-05 Thread Rodolphe PELLOUX-PRAYER
Package: git-buildpackage
Version: 0.6.31
Followup-For: Bug #787519

Dear Maintainer,

Here is second patch to update the documentation.

Regards,
Rodolphe


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages git-buildpackage depends on:
ii  devscripts2.15.4
ii  git   1:2.1.4-2.1
ii  man-db2.7.0.2-5
ii  python2.7.9-1
ii  python-dateutil   2.2-2
ii  python-pkg-resources  17.0-1
ii  python-six1.9.0-3

Versions of packages git-buildpackage recommends:
ii  cowbuilder   0.73
ii  pristine-tar 1.33
ii  python-requests  2.7.0-2

Versions of packages git-buildpackage suggests:
pn  python-notify  none
ii  unzip  6.0-17

-- no debconf information
From 52a9432d42cf8fe433a11c231276e7813b080647 Mon Sep 17 00:00:00 2001
From: Rodolphe PELLOUX-PRAYER rodol...@damsy.net
Date: Fri, 5 Jun 2015 15:29:19 +0200
Subject: [PATCH] Update docs to point out the new config file.

---
 bin/git-pbuilder| 11 ++-
 docs/chapters/cfgfile.sgml  |  2 +-
 docs/chapters/special.sgml  |  3 ++-
 docs/manpages/gbp.conf.sgml |  2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bin/git-pbuilder b/bin/git-pbuilder
index 3f0930d..5c7e8b5 100644
--- a/bin/git-pbuilder
+++ b/bin/git-pbuilder
@@ -379,11 +379,12 @@ Bgit-buildpackage to use it, add a stanza like:
 [DEFAULT]
 builder = /path/to/git-pbuilder
 
-in your Fgbp.conf file (which can be F.gbp.conf in your home directory
-or at the top level of the repository, or Fgbp.conf in the F.git
-directory).  DIST and ARCH are read as an environment variable so that you
-can set it before running Bgit-buildpackage without having to worry
-about passing parameters through Bgit-buildpackage.
+in your Fgbp.conf file (which can be F$XDG_CONFIG_HOME/debian/gbp.conf or
+F.gbp.conf in your home directory, or F.gbp.conf at the top level of the
+repository, or Fgbp.conf in the F.git directory).  DIST and ARCH are read
+as an environment variable so that you can set it before running
+Bgit-buildpackage without having to worry about passing parameters through
+Bgit-buildpackage.
 
 Alternately, Bgit-pbuilder may be called with an argument of Cupdate,
 Ccreate, or Clogin.  In this case, it calls Bcowbuilder (or the
diff --git a/docs/chapters/cfgfile.sgml b/docs/chapters/cfgfile.sgml
index 43d5430..3b600c5 100644
--- a/docs/chapters/cfgfile.sgml
+++ b/docs/chapters/cfgfile.sgml
@@ -7,7 +7,7 @@
   listitemparasystem wide configuraton/para/listitem
   /varlistentry
   varlistentry
-  term~/.gbp.conf/term
+  term$XDG_CONFIG_DIR/debian/gbp.conf or ~/.gbp.conf/term
   listitemparaper user configuration/para/listitem
   /varlistentry
   varlistentry
diff --git a/docs/chapters/special.sgml b/docs/chapters/special.sgml
index 7776330..0c0984f 100644
--- a/docs/chapters/special.sgml
+++ b/docs/chapters/special.sgml
@@ -80,7 +80,8 @@ cleanup-script.sh
 optionclean/option means something different than debuildcmd;
 optionclean/option.
 
-We can shorten this further by using filename~/.gbp.conf/filename:
+We can shorten this further by using filename$XDG_CONFIG_HOME/debian/gbp.conffilename
+or filename~/.gbp.conf/filename:
 
 programlisting
 cat lt;lt;EOF gt; filename~/.gbp.conf/filename
diff --git a/docs/manpages/gbp.conf.sgml b/docs/manpages/gbp.conf.sgml
index b48d9e1..a97cf2d 100644
--- a/docs/manpages/gbp.conf.sgml
+++ b/docs/manpages/gbp.conf.sgml
@@ -23,7 +23,7 @@
   listitemparasystem wide/para/listitem
   /varlistentry
   varlistentry
-  term~/.gbp.conf/term
+  term$XDG_CONFIG_HOME/debian/gbp.conf or ~/.gbp.conf/term
   listitemparaper user/para/listitem
   /varlistentry
   varlistentry
--
libgit2 0.22.2



Bug#787519: git-buildpackage: Read config from XDG_CONFIG_HOME/debian/gbp.conf

2015-06-02 Thread Rodolphe PELLOUX-PRAYER
Package: git-buildpackage
Version: 0.6.30
Severity: wishlist
Tags: patch

Hi,

Here a patch to allow use of XDG_CONFIG_HOME/debian/gbp.conf for settings.
Reading ~/.gbp.conf is still provided for convenience.

Regards,
Rodolphe

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.0.0-1-amd64 (SMP w/6 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages git-buildpackage depends on:
ii  devscripts2.15.4
ii  git   1:2.1.4+next.20141218-2
ii  man-db2.7.0.2-5
ii  python2.7.9-1
ii  python-dateutil   2.2-2
ii  python-pkg-resources  17.0-1
ii  python-six1.9.0-3

Versions of packages git-buildpackage recommends:
ii  cowbuilder   0.73
ii  pristine-tar 1.33
ii  python-requests  2.7.0-2

Versions of packages git-buildpackage suggests:
ii  python-notify  0.1.1-4
ii  unzip  6.0-17

-- no debconf information
From 81bec3b2bac61ac9ccfc3fb443850394e528782a Mon Sep 17 00:00:00 2001
From: Rodolphe PELLOUX-PRAYER rodol...@damsy.net
Date: Mon, 1 Jun 2015 23:26:09 +0200
Subject: [PATCH] Read gbp config from XDG_CONFIG_HOME.

---
 gbp/config.py | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gbp/config.py b/gbp/config.py
index dbe5690..854486f 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -310,6 +310,7 @@ class GbpOptionParser(OptionParser):
}
 
 def_config_files = [ '/etc/git-buildpackage/gbp.conf',
+ 'XDG_CONFIG_HOME/debian/gbp.conf',
  '~/.gbp.conf',
  '%(top_dir)s/.gbp.conf',
  '%(top_dir)s/debian/gbp.conf',
@@ -329,14 +330,15 @@ class GbpOptionParser(OptionParser):
  conf_backup = os.getenv('GBP_CONF_FILES')
  if conf_backup is not None: del os.environ['GBP_CONF_FILES']
  homedir = os.path.expanduser(~)
+ xdgconfhome = os.getenv('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')
  files = GbpOptionParser.get_config_files()
- files_mangled = [file.replace(homedir, 'HOME') for file in files]
+ files_mangled = [file.replace(xdgconfhome, 'XDG_CONFIG_HOME').replace(homedir, 'HOME') for file in files]
  files_mangled
-['/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf', '%(top_dir)s/.gbp.conf', '%(top_dir)s/debian/gbp.conf', '%(git_dir)s/gbp.conf']
+['/etc/git-buildpackage/gbp.conf', 'XDG_CONFIG_HOME/debian/gbp.conf', 'HOME/.gbp.conf', '%(top_dir)s/.gbp.conf', '%(top_dir)s/debian/gbp.conf', '%(git_dir)s/gbp.conf']
  files = GbpOptionParser.get_config_files(no_local=True)
- files_mangled = [file.replace(homedir, 'HOME') for file in files]
+ files_mangled = [file.replace(xdgconfhome, 'XDG_CONFIG_HOME').replace(homedir, 'HOME') for file in files]
  files_mangled
-['/etc/git-buildpackage/gbp.conf', 'HOME/.gbp.conf']
+['/etc/git-buildpackage/gbp.conf', 'XDG_CONFIG_HOME/debian/gbp.conf', 'HOME/.gbp.conf']
  os.environ['GBP_CONF_FILES'] = 'test1:test2'
  GbpOptionParser.get_config_files()
 ['test1', 'test2']
@@ -345,6 +347,7 @@ class GbpOptionParser(OptionParser):
 
 envvar = os.environ.get('GBP_CONF_FILES')
 files = envvar.split(':') if envvar else klass.def_config_files
+files = [fname.replace('XDG_CONFIG_HOME', os.getenv('XDG_CONFIG_HOME') or '~/.config') for fname in files]
 files = [os.path.expanduser(fname) for fname in files]
 if no_local:
 files = [fname for fname in files if fname.startswith('/')]
-- 
2.2.1.209.g41e5f3a