Changeset 25112


Ignore:
Timestamp:
May 14, 2007, 8:01:29 AM (10 years ago)
Author:
jmpp@…
Message:

First checkin of the upgrade target that will upgrade an existing MacPorts installation
to the new layout outlined in the dp2mp-move branch. This is still a work in progress so
many more commits will surely come, including including this code block as a shell preflight
script for the dmg installer once its ready.

Detailed commentary in the upgrade target explain what's being done and issues still to resolve.

Location:
branches/dp2mp-move/base
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dp2mp-move/base/Makefile.in

    r25093 r25112  
    2525        fi
    2626
    27 include Mk/macports.subdir.mk
     27dp2mpUpgrade:
     28        @echo "Upgrading your existing MacPorts installation to the new layout."
     29# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now
     30# be installed onto ${TCL_PACKAGE_DIR}/macports1.0 with new names.
     31        [ ! -d ${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -vrf ${TCL_PACKAGE_DIR}/darwinports1.0
    2832
    29 install::
     33# Old version file can be safely deleted, as it was already used to start this upgrade
     34# and a new one will be installed into the new location.
     35        [ ! -f ${sysconfdir}/ports/dp_version ] || rm -vf ${sysconfdir}/ports/dp_version
     36
     37# The main configuration file is first renamed to macports.conf while still in its old dir.
     38        [ ! -f ${sysconfdir}/ports/ports.conf ] || mv -v ${sysconfdir}/ports/ports.conf ${sysconfdir}/ports/macports.conf
     39
     40# Following that, the dir itself is renamed to its new name.
     41        [ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
     42
     43# MacPorts base files in ${datadir} are safely removed as new ones are always installed.
     44        [ ! -d ${datadir}/darwinports ] || rm -vrf ${datadir}/darwinports
     45
     46# Main ${localstatedir}/db/dports directory (where installed ports live) is moved to its new location.
     47#####this needs a lot of testing *WITH* installed ports!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     48        [ ! -d ${localstatedir}/db/dports ] || mv -v ${localstatedir}/db/dports ${localstatedir}/macports
     49
     50# MacPorts rsyns server is replaced into the macpors.conf and sources.conf files.
     51        sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
     52        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
     53        sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
     54        mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
     55
     56#
     57        sed -e "s/dpupdate1\/base\//release\/base\//g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
     58        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
     59        sed -e "s/dpupdate\/dports/release\/ports/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
     60        mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
     61
     62#
     63        sed -e "s/db\/dports/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
     64        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
     65
     66#
     67        sed -e "s/etc\/ports/etc\/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
     68        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
     69
     70#
     71        sed -e "s/\-\-delete //" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
     72        mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
     73
     74#something more?
     75
     76####
     77# NOTES:
     78#    -) Is it safe to delete the dp_version file while the upgrade target runs?
     79#    -) should we use the ${DESTDIR} sandbox?
     80#    -) should we force moves?
     81#    -) maybe I can regroup at least some of the sed calls?
     82#    -)
     83####
     84
     85install:: dp2mpUpgrade
     86#The order of installation targets having been reversed between this Makefile and Mk/macports.subdir.mk to
     87#get the upgrade target working in the best way possible, this informational text below ends up hidden
     88#among lots of output. Therefore I need to find somewhere to put it, so that it's seen as it used to be.
    3089        @echo ""
    3190        @echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:"
     
    3594        @echo "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation."
    3695        @echo ""
     96
     97include Mk/macports.subdir.mk
    3798
    3899clean::
  • branches/dp2mp-move/base/doc/Makefile

    r24886 r25112  
    3030        fi
    3131
    32 # Install the macports.conf file. If it's already installed, upgrade it
    33         if test ! -e ${DESTDIR}/${mpconfigdir}/macports.conf ; then \
     32        $(SILENT)if test ! -e ${DESTDIR}/${mpconfigdir}/macports.conf ; then \
    3433                set -x; \
    3534                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macports.conf ${DESTDIR}${mpconfigdir}; \
    36         else \
    37                 sed -e s/rsync.darwinports.org/rsync.macports.org/ ${DESTDIR}${mpconfigdir}/macports.conf > ${DESTDIR}${mpconfigdir}/macports.conf.tmp && \
    38                         mv ${DESTDIR}${mpconfigdir}/macports.conf.tmp ${DESTDIR}${mpconfigdir}/macports.conf; \
    3935        fi
    40 
    41         # Install the sources.conf file. If it's already installed, upgrade it
    42         if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
     36        $(SILENT)if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
    4337                set -x; \
    4438                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${mpconfigdir}; \
    45         else \
    46                 sed -e s/rsync.darwinports.org/rsync.macports.org/ ${DESTDIR}${mpconfigdir}/sources.conf > ${DESTDIR}${mpconfigdir}/sources.conf.tmp && \
    47                         mv ${DESTDIR}${mpconfigdir}/sources.conf.tmp ${DESTDIR}${mpconfigdir}/sources.conf; \
    4839        fi
    49 
    5040        $(SILENT)if test ! -e ${DESTDIR}${mpconfigdir}/variants.conf ; then \
    5141                set -x; \
    5242                $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${mpconfigdir}; \
    5343        fi
     44
    5445        $(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${DESTDIR}${mpconfigdir}
    5546        $(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/macports/resources/port1.0/install
Note: See TracChangeset for help on using the changeset viewer.