[154110] trunk/base/portmgr/dmg/postflight.in
cal at macports.org
cal at macports.org
Sat Oct 22 03:01:24 CEST 2016
Revision: 154110
https://trac.macports.org/changeset/154110
Author: cal at macports.org
Date: 2016-10-22 03:01:24 +0200 (Sat, 22 Oct 2016)
Log 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.
Modified Paths:
--------------
trunk/base/portmgr/dmg/postflight.in
Modified: trunk/base/portmgr/dmg/postflight.in
===================================================================
--- trunk/base/portmgr/dmg/postflight.in 2016-10-20 04:31:17 UTC (rev 154109)
+++ trunk/base/portmgr/dmg/postflight.in 2016-10-22 01:01:24 UTC (rev 154110)
@@ -50,7 +50,8 @@
TCL_PACKAGE_PATH="@TCL_PACKAGE_PATH@"
TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S")
BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
-OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
+OUR_BASESTRING="MacPorts Installer addition"
+OUR_STRING="${OUR_BASESTRING} on ${TIMESTAMP}"
OLD_MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl
OLD_TCL_PACKAGE_DIR=/Library/Tcl
@@ -90,7 +91,7 @@
# backing up the original only if it exists and if it doesn't contain the ${OUR_STRING} identification string,
# which hints that we've already tweaked it and therefore already backed it up.
function write_setting () {
- if [[ -f "${HOME}/.${CONF_FILE}" ]] && ! grep "${OUR_STRING}" "${HOME}/.${CONF_FILE}" > /dev/null; then
+ if [[ -f "${HOME}/.${CONF_FILE}" ]] && ! grep "${OUR_BASESTRING}" "${HOME}/.${CONF_FILE}" > /dev/null; then
echo "Backing up your ${HOME}/.${CONF_FILE} shell confguration file as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX} before adapting it for MacPorts."
/bin/cp -fp "${HOME}/.${CONF_FILE}" "${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}" || {
echo "An attempt to backup your original configuration file failed! Please set your MacPorts compatible environment manually."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161022/3ffabf87/attachment-0002.html>
More information about the macports-changes
mailing list