[55268] trunk/base/portmgr/dmg/postflight

jmr at macports.org jmr at macports.org
Fri Aug 7 17:20:23 PDT 2009


Revision: 55268
          http://trac.macports.org/changeset/55268
Author:   jmr at macports.org
Date:     2009-08-07 17:20:20 -0700 (Fri, 07 Aug 2009)
Log Message:
-----------
postflight script: avoid replacing existing config files, update version number

Modified Paths:
--------------
    trunk/base/portmgr/dmg/postflight

Modified: trunk/base/portmgr/dmg/postflight
===================================================================
--- trunk/base/portmgr/dmg/postflight	2009-08-08 00:14:32 UTC (rev 55267)
+++ trunk/base/portmgr/dmg/postflight	2009-08-08 00:20:20 UTC (rev 55268)
@@ -35,12 +35,13 @@
 #set -x
 
 # Script identification ('cause more often than not the svn Id is not expanded):
-VERSION=1.7.0
+VERSION=1.8.0
 
 # Abstraction variables:
 PREFIX=/opt/local
 BINPATH=${PREFIX}/bin
 SBINPATH=${PREFIX}/sbin
+CONFIGPATH=${PREFIX}/etc/macports
 MANPAGES=${PREFIX}/share/man
 TCLSH=/usr/bin/tclsh
 TCL_PACKAGE_DIR=/Library/Tcl
@@ -48,6 +49,14 @@
 BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
 OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
 
+# Create config files from defaults if not present
+function setup_configs {
+    for f in macports.conf sources.conf variants.conf ; do
+        if [ ! -f ${CONFIGPATH}/${f} ]; then
+            /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f}
+        fi
+    done
+}
 
 # Command to update the MacPorts installation through "selfupdate":
 function update_macports {
@@ -100,6 +109,9 @@
 
 echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
 
+# Set up config files
+setup_configs
+
 # Remove old stuff
 cleanup_man
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090807/6a540b56/attachment.html>


More information about the macports-changes mailing list