Changeset 118569


Ignore:
Timestamp:
Apr 4, 2014, 11:42:16 PM (5 years ago)
Author:
cal@…
Message:

base dmg postflight: clean up after installing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/portmgr/dmg/postflight.in

    r118017 r118569  
    4545CONFIGPATH=${PREFIX}/etc/macports
    4646MANPAGES=${PREFIX}/share/man
    47 MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
    48 REG1DIR=${MACPORTS_TCL_DIR}/registry1.0
    4947DSCL=/usr/bin/dscl
    5048RUNUSR=macports
    5149TCLSH=@TCLSH@
    52 TCL_PACKAGE_DIR=/Library/Tcl
     50TCL_PACKAGE_PATH=@TCL_PACKAGE_PATH@
    5351TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S")
    5452BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
    5553OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
     54
     55OLD_MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
     56OLD_TCL_PACKAGE_DIR=/Library/Tcl
    5657
    5758# Create config files from defaults if not present
     
    7475    # Convert image directories (and direct mode installs) to image archives
    7576    echo "Updating port image format..."
    76     ${TCLSH} ${SCRIPT_DIR}/images_to_archives.tcl ${MACPORTS_TCL_DIR}
    77     ${TCLSH} ${SCRIPT_DIR}/dedup_portfiles.tcl ${MACPORTS_TCL_DIR}
     77    ${TCLSH} ${SCRIPT_DIR}/images_to_archives.tcl
     78    ${TCLSH} ${SCRIPT_DIR}/dedup_portfiles.tcl
    7879
    7980    echo "Synchronizing the MacPorts installation with the project's rsync server..."
     
    118119}
    119120
    120 # Delete the old registry1.0 directory
    121 function delete_reg1 {
    122     if [[ -d ${REG1DIR} ]]; then
    123         rm -vrf ${REG1DIR}
    124     fi
    125 }
    126 
    127 # link macports1.0 into tcl package dir if possible
    128 function link_tcl_package {
    129     # delete old directory if present
    130     if [[ ! -L "${TCL_PACKAGE_DIR}/macports1.0" ]]; then
    131         if [[ ! -e "${TCL_PACKAGE_DIR}" ]]; then
    132             /usr/bin/install -d "${TCL_PACKAGE_DIR}" || true
    133         fi
    134         if [[ -d "${TCL_PACKAGE_DIR}/macports1.0" ]]; then
    135             rm -vrf "${TCL_PACKAGE_DIR}/macports1.0" || true
    136         fi
    137         if [[ ! -e "${TCL_PACKAGE_DIR}/macports1.0" && -d "${TCL_PACKAGE_DIR}" ]]; then
    138             ln -vs "${MACPORTS_TCL_DIR}/macports1.0" "${TCL_PACKAGE_DIR}/macports1.0" || true
    139         fi
     121# delete macports1.0 link from old tcl package dir
     122function delete_old_tcl_package_link {
     123    # delete old link if present
     124    if [[ -e "${OLD_TCL_PACKAGE_DIR}/macports1.0" ]]; then
     125        rm -vrf "${OLD_TCL_PACKAGE_DIR}/macports1.0"
    140126        fi
     127
     128    # delete old macports1.0 link from new tcl package dir if present
     129    if [[ -L "${TCL_PACKAGE_PATH}/macports1.0" ]]; then
     130        rm -vrf "${TCL_PACKAGE_PATH}/macports1.0"
     131    fi
     132}
     133
     134# delete the old tcl package location in share/macports/Tcl
     135function delete_old_tcl_packages {
     136    if [[ -d "${OLD_MACPORTS_TCL_DIR}" ]]; then
     137        rm -vrf "${OLD_MACPORTS_TCL_DIR}"
     138    fi
    141139}
    142140
     
    191189# Set up config files
    192190setup_configs
    193 # link macports1.0 pkg
    194 link_tcl_package
    195191
    196192# Remove old stuff
    197193cleanup_man
    198 delete_reg1
     194delete_old_tcl_package_link
     195delete_old_tcl_packages
    199196
    200197# Determine the user's shell, in order to choose an appropriate configuration file we'll be tweaking.
Note: See TracChangeset for help on using the changeset viewer.