[89988] trunk/base
jberry at macports.org
jberry at macports.org
Sat Feb 18 11:55:13 PST 2012
Revision: 89988
http://trac.macports.org/changeset/89988
Author: jberry at macports.org
Date: 2012-02-18 11:55:13 -0800 (Sat, 18 Feb 2012)
Log Message:
-----------
Change Home directory for MacPorts user to be /opt/local/var/macports/home,
to private a writable preferences directory.
Change Makefile to change the home directory for macports if it's set
to /var/empty.
Change base.mtree to create /opt/local/var/macports/home, writable by root,
and /opt/local/var/macports/Library/Preferences writable by macports only.
If this change seems to be working for people, we will want to also change the
dmg installer postflight script to do a similar upgrade, and perhaps also to
fix ownership of /opt/local/var/macports/Library/Preferences, as it looks like
the macports user is not created until postflight, which is presumably after
the files will have been installed.
Modified Paths:
--------------
trunk/base/Makefile.in
trunk/base/doc/base.mtree.in
Modified: trunk/base/Makefile.in
===================================================================
--- trunk/base/Makefile.in 2012-02-18 15:28:00 UTC (rev 89987)
+++ trunk/base/Makefile.in 2012-02-18 19:55:13 UTC (rev 89988)
@@ -64,12 +64,20 @@
${DSCL} -q . -create /Users/${RUNUSR} RealName MacPorts ; \
${DSCL} -q . -create /Users/${RUNUSR} Password \* ; \
${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}') ; \
- ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /var/empty ; \
+ ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory ${prefix}/var/macports/home ; \
${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
else \
echo "Not creating user \"${RUNUSR}\" (not root)" ; \
fi ; \
fi ; \
+ if test "$$(${DSCL} -q . -read /Users/${RUNUSR} NFSHomeDirectory)" = "NFSHomeDirectory: /var/empty" ; then \
+ if test `id -u` -eq 0; then \
+ echo "Updating home directory location for user \"${RUNUSR}\"" ; \
+ ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory ${prefix}/var/macports/home ; \
+ else \
+ echo "Not updating home directory location for user \"${RUNUSR}\" (not root)" ; \
+ fi ; \
+ fi ; \
if test `sw_vers -productVersion | /usr/bin/awk -F . '{print $$2}'` -eq 4 -a `id -u` -eq 0; then \
GID=`${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}'` ; \
if test "`${DSCL} -q . -read /Users/${RUNUSR} PrimaryGroupID 2>/dev/null | /usr/bin/awk '{print $$2}'`" != "$$GID"; then \
Modified: trunk/base/doc/base.mtree.in
===================================================================
--- trunk/base/doc/base.mtree.in 2012-02-18 15:28:00 UTC (rev 89987)
+++ trunk/base/doc/base.mtree.in 2012-02-18 19:55:13 UTC (rev 89988)
@@ -11,6 +11,12 @@
..
distfiles
..
+ home
+ Library
+ Preferences uname=@RUNUSR@ gname=@RUNUSR@ mode=700
+ ..
+ ..
+ ..
logs
..
registry
@@ -20,3 +26,5 @@
..
..
..
+
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120218/6cbcd721/attachment.html>
More information about the macports-changes
mailing list