Changeset 154110


Ignore:
Timestamp:
Oct 22, 2016, 1:01:24 AM (8 years ago)
Author:
cal@…
Message:

Installer postflight: Fix useless test

$OUR_STRING used to contain a timestamp down to second precision, which makes
it very unlikely to hit a match. grep for something more likely to match
instead.

File:
1 edited

Legend:

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

    r154073 r154110  
    5151TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S")
    5252BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
    53 OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
     53OUR_BASESTRING="MacPorts Installer addition"
     54OUR_STRING="${OUR_BASESTRING} on ${TIMESTAMP}"
    5455
    5556OLD_MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
     
    9192# which hints that we've already tweaked it and therefore already backed it up.
    9293function write_setting () {
    93     if [[ -f "${HOME}/.${CONF_FILE}" ]] && ! grep "${OUR_STRING}" "${HOME}/.${CONF_FILE}" > /dev/null; then
     94    if [[ -f "${HOME}/.${CONF_FILE}" ]] && ! grep "${OUR_BASESTRING}" "${HOME}/.${CONF_FILE}" > /dev/null; then
    9495        echo "Backing up your ${HOME}/.${CONF_FILE} shell confguration file as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX} before adapting it for MacPorts."
    9596        /bin/cp -fp "${HOME}/.${CONF_FILE}" "${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}" || {
Note: See TracChangeset for help on using the changeset viewer.