Forráskód Böngészése

dpkg-buildflags: respect $XDG_CONFIG_HOME and use $XDG_CONFIG_HOME/dpkg/buildflags.conf

Raphaël Hertzog 16 éve
szülő
commit
5e716c4f17
3 módosított fájl, 12 hozzáadás és 3 törlés
  1. 7 0
      debian/changelog
  2. 3 2
      man/dpkg-buildflags.1
  3. 2 1
      scripts/Dpkg/BuildFlags.pm

+ 7 - 0
debian/changelog

@@ -1,3 +1,10 @@
+dpkg (1.15.7.2) UNRELEASED; urgency=low
+
+  * Update dpkg-buildflags to respect $XDG_CONFIG_HOME and to use
+    $XDG_CONFIG_HOME/dpkg/buildflags.conf by default.
+
+ -- Raphaël Hertzog <hertzog@debian.org>  Fri, 23 Apr 2010 18:17:14 +0200
+
 dpkg (1.15.7.1) unstable; urgency=low
 
   * Fix dpkg-source -b (without -i) for source packages 1.0. Closes: #578693

+ 3 - 2
man/dpkg-buildflags.1

@@ -15,7 +15,8 @@ extended/overriden in several ways:
 .IP 1.
 system-wide with \fB/etc/dpkg/buildflags.conf\fP;
 .IP 2.
-for the current user with \fB~/.config/dpkg-buildflags.conf\fP;
+for the current user with \fB$XDG_CONFIG_HOME/dpkg/buildflags.conf\fP
+where \fB$XDG_CONFIG_HOME\fP defaults to \fB$HOME/.config\fP;
 .IP 3.
 temporarily with environment variables (see section \fBENVIRONMENT\fP).
 .P
@@ -96,7 +97,7 @@ have to be stripped from these options). Default value: empty.
 .B /etc/dpkg/buildflags.conf
 System wide configuration file.
 .TP
-.B ~/.config/dpkg-buildflags.conf
+.BR $XDG_CONFIG_HOME/dpkg/buildflags.conf " or " $HOME/.config/dpkg/buildflags.conf
 User configuration file.
 .SH ENVIRONMENT
 .TP

+ 2 - 1
scripts/Dpkg/BuildFlags.pm

@@ -106,7 +106,8 @@ Update flags from the user configuration.
 
 sub load_user_config {
     my ($self) = @_;
-    $self->update_from_conffile($ENV{"HOME"} . "/.config/dpkg-buildflags.conf", "user");
+    my $confdir = $ENV{'XDG_CONFIG_HOME'} || $ENV{"HOME"} . "/.config";
+    $self->update_from_conffile("$confdir/dpkg/buildflags.conf", "user");
 }
 
 =item $bf->load_environment_config()