[31928] branches/release_1_6/base/portmgr/dmg/postflight

jmpp at macports.org jmpp at macports.org
Tue Dec 11 23:14:09 PST 2007


Revision: 31928
          http://trac.macosforge.org/projects/macports/changeset/31928
Author:   jmpp at macports.org
Date:     2007-12-11 23:14:07 -0800 (Tue, 11 Dec 2007)

Log Message:
-----------

Add a display variable only if:

 1. We're running on tiger or less;
 2. One is not already set.

Modified Paths:
--------------
    branches/release_1_6/base/portmgr/dmg/postflight

Modified: branches/release_1_6/base/portmgr/dmg/postflight
===================================================================
--- branches/release_1_6/base/portmgr/dmg/postflight	2007-12-12 06:57:45 UTC (rev 31927)
+++ branches/release_1_6/base/portmgr/dmg/postflight	2007-12-12 07:14:07 UTC (rev 31928)
@@ -84,7 +84,14 @@
             elif [ "$CONF_FILE" == "tcshrc" ]; then
                 echo "setenv MANPATH $MANPAGES:\$MANPATH" >> $HOME/.$CONF_FILE
             fi
-        ;;
+            ;;
+        DISPLAY)
+            if [ "$CONF_FILE" == "profile" ]; then
+                echo "export DISPLAY=:0" >> $HOME/.$CONF_FILE
+            elif [ "$CONF_FILE" == "tcshrc" ]; then
+                echo "setenv DISPLAY :0" >> $HOME/.$CONF_FILE
+            fi
+            ;;
     esac
     chown $USER $HOME/.$CONF_FILE
     echo -e "# Finished adapting your $1 environment variable for use with MacPorts.\n" >> $HOME/.$CONF_FILE
@@ -119,7 +126,14 @@
     write_setting MANPATH
 fi
 
+# Adding a DISPLAY variable only if we're running on Tiger or less and if it doesn't already exist:
+if (($(sw_vers -productVersion | awk -F . '{print $2}') >= 5)) || $SHELL $LOGIN_FLAG -c "/usr/bin/env | grep DISPLAY" > /dev/null 2>&1; then
+    echo "Your shell already has the right DISPLAY environment variable for use with MacPorts!"
+else
+    write_setting DISPLAY
+fi
 
+
 # Update the MacPorts installation through "selfupdate":
 echo -e "\nSynchronizing the MacPorts installation with the project's rsync server...\n"
 export PATH=$BINPATH:$PATH

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071211/6586ac6a/attachment-0001.html


More information about the macports-changes mailing list