aboutsummaryrefslogtreecommitdiffstats
path: root/testing/lab/xdg.patch
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-07-25 17:15:53 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-07-25 17:23:24 -0300
commit7d6cd3741d8132ab5568538bb5d48de92a4b81fc (patch)
tree60d723a594470142b4ad31d069355db496b8abd2 /testing/lab/xdg.patch
parent9e124e2caee5b902db787510b077485aa0139ccf (diff)
downloadaports-7d6cd3741d8132ab5568538bb5d48de92a4b81fc.tar.bz2
aports-7d6cd3741d8132ab5568538bb5d48de92a4b81fc.tar.xz
testing/lab: add upstream patches for shell completion and xdg compliance
Diffstat (limited to 'testing/lab/xdg.patch')
-rw-r--r--testing/lab/xdg.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/lab/xdg.patch b/testing/lab/xdg.patch
new file mode 100644
index 0000000000..f4b74d82ad
--- /dev/null
+++ b/testing/lab/xdg.patch
@@ -0,0 +1,27 @@
+From 63bb26a320d43f8ce79626b0adeeaae73f90fd8a Mon Sep 17 00:00:00 2001
+From: Leo <thinkabit.ukim@gmail.com>
+Date: Thu, 25 Jul 2019 04:05:41 -0300
+Subject: [PATCH] try XDG_CONFIG_HOME
+
+---
+ main.go | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/main.go b/main.go
+index dddf7a3..9a836b9 100644
+--- a/main.go
++++ b/main.go
+@@ -35,7 +35,11 @@ func loadConfig() (string, string, string) {
+ home = u.HomeDir
+ }
+ }
+- confpath := path.Join(home, ".config")
++ // Try XDG_CONFIG_HOME which is declared in XDG base directory specification
++ confpath := os.Getenv("XDG_CONFIG_HOME")
++ if confpath == "" {
++ confpath = path.Join(home, ".config")
++ }
+ if _, err := os.Stat(confpath); os.IsNotExist(err) {
+ os.Mkdir(confpath, 0700)
+ }
+