New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Changeset 79751


Ignore:
Timestamp:
06/24/11 14:01:07 (4 years ago)
Author:
jmr@…
Message:

merge r79750 from trunk:

use double bracket tests in postflight since it asks for bash anyway, also ask for bash in InstallationCheck, and remove useless test for empty variables

Location:
branches/release_2_0
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/release_2_0

  • branches/release_2_0/base

  • branches/release_2_0/base/portmgr/dmg/InstallationCheck

    r68593 r79751  
    1 #!/bin/sh 
     1#!/bin/bash 
    22# 
    33# $Id$ 
  • branches/release_2_0/base/portmgr/dmg/postflight

    r79597 r79751  
    5858function setup_configs { 
    5959    for f in macports.conf pubkeys.conf sources.conf variants.conf ; do 
    60         if [ ! -f ${CONFIGPATH}/${f} ]; then 
     60        if [[ ! -f ${CONFIGPATH}/${f} ]]; then 
    6161            echo "Copying ${f}.default to ${f}" 
    6262            /bin/cp ${CONFIGPATH}/${f}.default ${CONFIGPATH}/${f} 
     
    8888# which hints that we've already tweaked it and therefore already backed it up. 
    8989function write_setting () { 
    90     if [ -f ${HOME}/.${CONF_FILE} ] && ! grep "${OUR_STRING}" ${HOME}/.${CONF_FILE} > /dev/null; then 
     90    if [[ -f ${HOME}/.${CONF_FILE} ]] && ! grep "${OUR_STRING}" ${HOME}/.${CONF_FILE} > /dev/null; then 
    9191        echo "Backing up your ${HOME}/.${CONF_FILE} shell confguration file as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX} before adapting it for MacPorts." 
    9292        /bin/cp -fp ${HOME}/.${CONF_FILE} "${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}" || { 
     
    118118# Delete the old registry1.0 directory 
    119119function delete_reg1 { 
    120     if [ -d ${REG1DIR} ]; then 
     120    if [[ -d ${REG1DIR} ]]; then 
    121121        rm -vrf ${REG1DIR} 
    122122    fi 
     
    126126function link_tcl_package { 
    127127    # delete old directory if present 
    128     if ! test -L "${TCL_PACKAGE_DIR}/macports1.0" && test -d "${TCL_PACKAGE_DIR}/macports1.0"; then 
     128    if [[ ! -L "${TCL_PACKAGE_DIR}/macports1.0" ]] && [[ -d "${TCL_PACKAGE_DIR}/macports1.0" ]]; then 
    129129        rm -vrf "${TCL_PACKAGE_DIR}/macports1.0" || true 
    130130    fi 
    131     if ! test -e "${TCL_PACKAGE_DIR}/macports1.0" && test -w "${TCL_PACKAGE_DIR}"; then 
     131    if [[ ! -e "${TCL_PACKAGE_DIR}/macports1.0" ]] && [[ -w "${TCL_PACKAGE_DIR}" ]]; then 
    132132                ln -vs "${MACPORTS_TCL_DIR}/macports1.0" "${TCL_PACKAGE_DIR}/macports1.0" || true 
    133133        fi 
     
    137137function create_run_user { 
    138138    DSEDITGROUP=/usr/sbin/dseditgroup 
    139     if test -n "${DSCL}" -a -n "${DSEDITGROUP}" ; then 
    140         if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then 
    141             echo "Creating group \"${RUNUSR}\"" 
    142             ${DSEDITGROUP} -q -o create -n . ${RUNUSR} 
    143         fi 
    144         if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then 
    145             echo "Creating user \"${RUNUSR}\"" 
    146             ${DSCL} -q . -create /Users/${RUNUSR} Password * 
    147             ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $(($(${DSCL} . -list /Users UniqueID | /usr/bin/awk '{print $2}' | sort -ug | tail -1)+1)) 
    148             ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}') 
    149             ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /dev/null 
    150             ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false 
    151         fi 
    152     else 
    153         echo "Can't find ${DSCL} / ${DSEDITGROUP}, unable to create user \"${RUNUSR}\"" 
    154         exit 1 
     139    if ! ${DSEDITGROUP} -q -o read ${RUNUSR} > /dev/null 2>&1 ; then 
     140        echo "Creating group \"${RUNUSR}\"" 
     141        ${DSEDITGROUP} -q -o create -n . ${RUNUSR} 
     142    fi 
     143    if ! ${DSCL} -q . -list /Users/${RUNUSR} > /dev/null 2>&1 ; then 
     144        echo "Creating user \"${RUNUSR}\"" 
     145        ${DSCL} -q . -create /Users/${RUNUSR} Password * 
     146        ${DSCL} -q . -create /Users/${RUNUSR} UniqueID $(($(${DSCL} . -list /Users UniqueID | /usr/bin/awk '{print $2}' | sort -ug | tail -1)+1)) 
     147        ${DSCL} -q . -create /Users/${RUNUSR} PrimaryGroupID $(${DSCL} -q . -read /Groups/${RUNUSR} PrimaryGroupID | /usr/bin/awk '{print $2}') 
     148        ${DSCL} -q . -create /Users/${RUNUSR} NFSHomeDirectory /dev/null 
     149        ${DSCL} -q . -create /Users/${RUNUSR} UserShell /usr/bin/false 
    155150    fi 
    156151} 
     
    180175        ENV_COMMAND="setenv" 
    181176        ASSIGN=" " 
    182         if [ -f ${HOME}/.tcshrc ]; then 
     177        if [[ -f ${HOME}/.tcshrc ]]; then 
    183178            CONF_FILE=tcshrc 
    184         elif [ -f ${HOME}/.cshrc ]; then 
     179        elif [[ -f ${HOME}/.cshrc ]]; then 
    185180            CONF_FILE=cshrc 
    186181        else 
     
    193188        ENV_COMMAND="export" 
    194189        ASSIGN="=" 
    195         if [ -f ${HOME}/.bash_profile ]; then 
     190        if [[ -f ${HOME}/.bash_profile ]]; then 
    196191            CONF_FILE=bash_profile 
    197         elif [ -f ${HOME}/.bash_login ]; then 
     192        elif [[ -f ${HOME}/.bash_login ]]; then 
    198193            CONF_FILE=bash_login 
    199194        else 
     
    221216if ! ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/env | grep MANPATH" > /dev/null || \ 
    222217# and following that, if it's not empty: 
    223   [ -z "${ORIGINAL_MANPATH}" ] || \ 
     218  [[ -z "${ORIGINAL_MANPATH}" ]] || \ 
    224219# or if it doesn't already contain our path: 
    225220  echo "${ORIGINAL_MANPATH}" | grep ${MANPAGES} > /dev/null || \ 
     
    227222  echo "${ORIGINAL_MANPATH}" | grep :: > /dev/null || \ 
    228223# or at the start of it: 
    229   [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $1}')" ] || \ 
     224  [[ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $1}')" ]] || \ 
    230225# or at the end of it: 
    231   [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $NF}')" ]; then 
     226  [[ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $NF}')" ]]; then 
    232227    echo "Your shell already has the right MANPATH environment variable for use with MacPorts!" 
    233228else 
  • branches/release_2_0/base/portmgr/fedora/macports.spec

  • branches/release_2_0/base/src/pextlib1.0/sha2.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release_2_0/base/src/pextlib1.0/sha2.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release_2_0/base/src/pextlib1.0/sha256cmd.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release_2_0/base/src/pextlib1.0/sha256cmd.h

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/release_2_0/base/src/registry2.0/receipt_sqlite.tcl

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.