Ignore:
Timestamp:
Feb 18, 2012, 7:55:13 PM (8 years ago)
Author:
jberry@…
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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Makefile.in

    r83391 r89988  
    6565                ${DSCL} -q . -create /Users/${RUNUSR} Password \* ; \
    6666                ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $$(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $$2}') ; \
    67                 ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /var/empty ; \
     67                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory ${prefix}/var/macports/home ; \
    6868                ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false ; \
    6969            else \
    7070                echo "Not creating user \"${RUNUSR}\" (not root)" ; \
     71            fi ; \
     72        fi ; \
     73        if test "$$(${DSCL} -q . -read /Users/${RUNUSR} NFSHomeDirectory)" = "NFSHomeDirectory: /var/empty" ; then \
     74            if test `id -u` -eq 0; then \
     75                echo "Updating home directory location for user \"${RUNUSR}\"" ; \
     76                ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory ${prefix}/var/macports/home ; \
     77            else \
     78                echo "Not updating home directory location for user \"${RUNUSR}\" (not root)" ; \
    7179            fi ; \
    7280        fi ; \
Note: See TracChangeset for help on using the changeset viewer.