blob: 53679bf1d91347730784e0cc5d3f0ebbdb2bee52 [file] [log] [blame]
From 766d37fe9acd9fdaaff9c094635e06b50c5902d7 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@intel.com>
Date: Wed, 19 Sep 2018 14:44:40 +0100
Subject: [PATCH] Allow the environment to override where gnupg looks for its
own files. Useful in native builds.
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
common/homedir.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/common/homedir.c b/common/homedir.c
index 455c188..55049db 100644
--- a/common/homedir.c
+++ b/common/homedir.c
@@ -1155,7 +1155,7 @@ gnupg_socketdir (void)
if (!name)
{
unsigned int dummy;
- name = _gnupg_socketdir_internal (0, &dummy);
+ name = getenv("GNUPG_SOCKETDIR") ?: _gnupg_socketdir_internal (0, &dummy);
gpgrt_annotate_leaked_object (name);
}
@@ -1187,7 +1187,7 @@ gnupg_sysconfdir (void)
if (dir)
return dir;
else
- return GNUPG_SYSCONFDIR;
+ return getenv("GNUPG_SYSCONFDIR") ?: GNUPG_SYSCONFDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
@@ -1223,7 +1223,7 @@ gnupg_bindir (void)
return name;
}
else
- return GNUPG_BINDIR;
+ return getenv("GNUPG_BINDIR") ?: GNUPG_BINDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
@@ -1250,7 +1250,7 @@ gnupg_libexecdir (void)
return name;
}
else
- return GNUPG_LIBEXECDIR;
+ return getenv("GNUPG_LIBEXECDIR") ?: GNUPG_LIBEXECDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
@@ -1280,7 +1280,7 @@ gnupg_libdir (void)
return name;
}
else
- return GNUPG_LIBDIR;
+ return getenv("GNUPG_LIBDIR") ?: GNUPG_LIBDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
@@ -1311,7 +1311,7 @@ gnupg_datadir (void)
return name;
}
else
- return GNUPG_DATADIR;
+ return getenv("GNUPG_DATADIR") ?: GNUPG_DATADIR;
#endif /*!HAVE_W32_SYSTEM*/
}
@@ -1343,7 +1343,7 @@ gnupg_localedir (void)
return name;
}
else
- return LOCALEDIR;
+ return getenv("LOCALEDIR") ?: LOCALEDIR;
#endif /*!HAVE_W32_SYSTEM*/
}
--
2.20.1