aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authormarino <marino@FreeBSD.org>2014-10-31 21:13:09 +0800
committermarino <marino@FreeBSD.org>2014-10-31 21:13:09 +0800
commitc1802d1921d62a18f2cf17f6e86b88382ca5ece6 (patch)
treeff87d1f9627d62f366d819273e244d92e2699e6e /lang
parent1dab6be2db2c91af5171870ea1d4403a91b12688 (diff)
downloadfreebsd-ports-gnome-c1802d1921d62a18f2cf17f6e86b88382ca5ece6.tar.gz
freebsd-ports-gnome-c1802d1921d62a18f2cf17f6e86b88382ca5ece6.tar.zst
freebsd-ports-gnome-c1802d1921d62a18f2cf17f6e86b88382ca5ece6.zip
lang/mono: allow overriding Environment.SpecialFolder.Personal
Any port that writes to Environment.SpecialFolder.Personal during build or when running tests may end up with files outside of the stage area that aren't cleaned up by the ports framework. The issue lies with Mono looking in /etc/passwd first and only if no entry found there in $HOME. This PR was an unnoticed prerequisite for the new port games/openra. Patch based on discussion in https://github.com/mono/mono/pull/371 PR: 193426 Submitted by: Jan Beich Approved by: maintainer timeout (8 weeks)
Diffstat (limited to 'lang')
-rw-r--r--lang/mono/Makefile1
-rw-r--r--lang/mono/files/patch-eglib_src_gmisc-unix.c43
2 files changed, 44 insertions, 0 deletions
diff --git a/lang/mono/Makefile b/lang/mono/Makefile
index 29a3d749c4f9..423e22940204 100644
--- a/lang/mono/Makefile
+++ b/lang/mono/Makefile
@@ -3,6 +3,7 @@
PORTNAME= mono
PORTVERSION= 3.10.0
+PORTREVISION= 1
CATEGORIES= lang
MASTER_SITES= http://download.mono-project.com/sources/${PORTNAME}/
diff --git a/lang/mono/files/patch-eglib_src_gmisc-unix.c b/lang/mono/files/patch-eglib_src_gmisc-unix.c
new file mode 100644
index 000000000000..cc59be590409
--- /dev/null
+++ b/lang/mono/files/patch-eglib_src_gmisc-unix.c
@@ -0,0 +1,43 @@
+https://github.com/mono/mono/pull/371
+
+--- eglib/src/gmisc-unix.c~
++++ eglib/src/gmisc-unix.c
+@@ -93,24 +93,27 @@ get_pw_data (void)
+ pthread_mutex_unlock (&pw_lock);
+ return;
+ }
++
++ home_dir = g_getenv ("HOME");
++ user_name = g_getenv ("USER");
++
+ #ifdef HAVE_GETPWUID_R
+- if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
+- home_dir = g_strdup (pw.pw_dir);
+- user_name = g_strdup (pw.pw_name);
++ if (home_dir == NULL || user_name == NULL) {
++ if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
++ if (home_dir == NULL)
++ home_dir = g_strdup (pw.pw_dir);
++ if (user_name == NULL)
++ user_name = g_strdup (pw.pw_name);
++ } else {
++ if (user_name == NULL)
++ user_name = "somebody";
++ }
+ }
+ #endif
+- if (home_dir == NULL)
+- home_dir = g_getenv ("HOME");
+
+- if (user_name == NULL) {
+- user_name = g_getenv ("USER");
+- if (user_name == NULL)
+- user_name = "somebody";
+- }
+ pthread_mutex_unlock (&pw_lock);
+ }
+
+-/* Give preference to /etc/passwd than HOME */
+ const gchar *
+ g_get_home_dir (void)
+ {