Date: Fri, 31 Oct 2014 13:13:10 +0000 (UTC) From: John Marino <marino@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r371813 - in head/lang/mono: . files Message-ID: <201410311313.s9VDDAAD017741@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marino Date: Fri Oct 31 13:13:09 2014 New Revision: 371813 URL: https://svnweb.freebsd.org/changeset/ports/371813 QAT: https://qat.redports.org/buildarchive/r371813/ Log: 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) Added: head/lang/mono/files/patch-eglib_src_gmisc-unix.c (contents, props changed) Modified: head/lang/mono/Makefile Modified: head/lang/mono/Makefile ============================================================================== --- head/lang/mono/Makefile Fri Oct 31 13:11:58 2014 (r371812) +++ head/lang/mono/Makefile Fri Oct 31 13:13:09 2014 (r371813) @@ -3,6 +3,7 @@ PORTNAME= mono PORTVERSION= 3.10.0 +PORTREVISION= 1 CATEGORIES= lang MASTER_SITES= http://download.mono-project.com/sources/${PORTNAME}/ Added: head/lang/mono/files/patch-eglib_src_gmisc-unix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/mono/files/patch-eglib_src_gmisc-unix.c Fri Oct 31 13:13:09 2014 (r371813) @@ -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) + {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410311313.s9VDDAAD017741>