Ignore:
Timestamp:
Jun 16, 2007, 7:08:43 AM (13 years ago)
Author:
jmpp@…
Message:

Abstract the file marking the upgrade was done into a variable and choose a single location where to
output the mark (rather than one to the syswide conf dir and another to the user dir).
Also remove the comment asking for other things to upgrade, I don't think I'm missing anything
(but feel free to knock me over the head if I'm making any glaring omission!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Makefile.in

    r26216 r26219  
    99DISTARCNAME     = ${DISTNAME}-archive
    1010SVNURL          = http://svn.macports.org/repository/macports
     11UPGRADECHECK    = ${localstatedir}/macports/.mprename
    1112
    1213include Mk/macports.autoconf.mk
     
    2829
    2930upgrade:
    30         @[ -f ${sysconfdir}/macports/.mprename_update ] || echo -e "\nUpgrading your existing MacPorts installation to the new layout:\n"
     31        @[ -f ${UPGRADECHECK} ] || echo -e "\nUpgrading your existing MacPorts installation to the new layout:\n"
    3132
    3233# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now be installed onto
     
    7374## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
    7475## 8) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
    75         [ ! \( -f ${sysconfdir}/macports/ports.conf -a ! -f ${sysconfdir}/macports/.mprename_update \) ] || { \
     76        [ ! \( -f ${sysconfdir}/macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || { \
    7677                mv -v ${sysconfdir}/macports/ports.conf ${sysconfdir}/macports/macports.conf.mpsaved; \
    7778                sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf.mpsaved > ${sysconfdir}/macports/macports.conf.tmp && \
     
    9192                sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
    9293                        mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
    93                 echo "MacPorts rename update done!" > ${sysconfdir}/macports/.mprename_update; \
    9494        }
    9595
     
    9797## 1) new MacPorts rsync server;
    9898## 2) new default value for the ports tree.
    99         [ ! \( -f ${sysconfdir}/macports/sources.conf -a ! -f ${sysconfdir}/macports/.mprename_update \) ] || { \
     99        [ ! \( -f ${sysconfdir}/macports/sources.conf -a ! -f ${UPGRADECHECK} \) ] || { \
    100100                cp -v ${sysconfdir}/macports/sources.conf ${sysconfdir}/macports/sources.conf.mpsaved; \
    101101                sed 's/darwinports/macports/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
     
    103103                sed 's/dpupdate\/dports/release\/ports\//g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
    104104                        mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
    105                 echo "MacPorts rename update done!" > ${sysconfdir}/macports/.mprename_update; \
    106105        }
    107106
     
    115114## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
    116115## 8) finally, move remaining instances of any form of our new name (which by this time should only remain in comments, if at all) to our new name.
    117         [ ! \( -f $${HOME}/.macports/ports.conf -a ! -f $${HOME}/.macports/.mprename_update \) ] || { \
     116        [ ! \( -f $${HOME}/.macports/ports.conf -a ! -f ${UPGRADECHECK} \) ] || { \
    118117                mv -v $${HOME}/.macports/ports.conf $${HOME}/.macports/macports.conf.mpsaved; \
    119118                sed 's/etc\/ports/etc\/macports/g' $${HOME}/.macports/macports.conf.mpsaved > $${HOME}/.macports/macports.conf.tmp && \
     
    133132                sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
    134133                        mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
    135                 echo "MacPorts rename update done!" > ${sysconfdir}/macports/.mprename_update; \
    136134        }
    137135
    138 
    139 #something more?
    140 
    141136# Upgrade success announcement (meaning we're done ;):
    142         @[ -f ${sysconfdir}/macports/.mprename_update ] || echo -e "\nMacPorts installation successfully upgraded from the old DarwinPorts namespace!\n"
     137        @[ -f ${UPGRADECHECK} ] || { echo -e "\nMacPorts installation successfully upgraded from the old DarwinPorts namespace!\n"; \
     138        echo "MacPorts rename update done!" > ${UPGRADECHECK} ; }
    143139
    144140####
     
    158154        @echo -e "sudo port selfupdate\n"
    159155        @echo -e "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation.\n"
    160         @[ -f ${sysconfdir}/macports/.mprename_update ] || echo -e "Stray sources might have been left in the legacy ${localstatedir}/db/dports directory after this upgrade, which moved most of what it could to ${localstatedir}/macports, so you might want to look in the former and cleanup manually.\n"
     156        @[ -f ${UPGRADECHECK} ] || echo -e "Stray sources might have been left in the legacy ${localstatedir}/db/dports directory after this upgrade, which moved most of what it could to ${localstatedir}/macports, so you might want to look in the former and cleanup manually.\n"
    161157
    162158clean::
Note: See TracChangeset for help on using the changeset viewer.