[25112] branches/dp2mp-move/base
source_changes at macosforge.org
source_changes at macosforge.org
Mon May 14 01:01:31 PDT 2007
Revision: 25112
http://trac.macosforge.org/projects/macports/changeset/25112
Author: jmpp at macports.org
Date: 2007-05-14 01:01:29 -0700 (Mon, 14 May 2007)
Log 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.
Modified Paths:
--------------
branches/dp2mp-move/base/Makefile.in
branches/dp2mp-move/base/doc/Makefile
Modified: branches/dp2mp-move/base/Makefile.in
===================================================================
--- branches/dp2mp-move/base/Makefile.in 2007-05-14 07:32:10 UTC (rev 25111)
+++ branches/dp2mp-move/base/Makefile.in 2007-05-14 08:01:29 UTC (rev 25112)
@@ -24,9 +24,68 @@
echo "Source tree not configured. Use ./configure" ; \
fi
-include Mk/macports.subdir.mk
+dp2mpUpgrade:
+ @echo "Upgrading your existing MacPorts installation to the new layout."
+# We can safely delete the ${TCL_PACKAGE_DIR}/darwinports1.0 dir as files in it are always overwritten and will now
+# be installed onto ${TCL_PACKAGE_DIR}/macports1.0 with new names.
+ [ ! -d ${TCL_PACKAGE_DIR}/darwinports1.0 ] || rm -vrf ${TCL_PACKAGE_DIR}/darwinports1.0
-install::
+# Old version file can be safely deleted, as it was already used to start this upgrade
+# and a new one will be installed into the new location.
+ [ ! -f ${sysconfdir}/ports/dp_version ] || rm -vf ${sysconfdir}/ports/dp_version
+
+# The main configuration file is first renamed to macports.conf while still in its old dir.
+ [ ! -f ${sysconfdir}/ports/ports.conf ] || mv -v ${sysconfdir}/ports/ports.conf ${sysconfdir}/ports/macports.conf
+
+# Following that, the dir itself is renamed to its new name.
+ [ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
+
+# MacPorts base files in ${datadir} are safely removed as new ones are always installed.
+ [ ! -d ${datadir}/darwinports ] || rm -vrf ${datadir}/darwinports
+
+# Main ${localstatedir}/db/dports directory (where installed ports live) is moved to its new location.
+#####this needs a lot of testing *WITH* installed ports!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ [ ! -d ${localstatedir}/db/dports ] || mv -v ${localstatedir}/db/dports ${localstatedir}/macports
+
+# MacPorts rsyns server is replaced into the macpors.conf and sources.conf files.
+ sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
+ mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
+ sed -e "s/rsync.darwinports.org/rsync.macports.org/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
+ mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
+
+#
+ sed -e "s/dpupdate1\/base\//release\/base\//g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
+ mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
+ sed -e "s/dpupdate\/dports/release\/ports/g" ${mpconfigdir}/sources.conf > ${mpconfigdir}/sources.conf.tmp && \
+ mv -v ${mpconfigdir}/sources.conf.tmp ${mpconfigdir}/sources.conf
+
+#
+ sed -e "s/db\/dports/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
+ mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
+
+#
+ sed -e "s/etc\/ports/etc\/macports/g" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
+ mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
+
+#
+ sed -e "s/\-\-delete //" ${mpconfigdir}/macports.conf > ${mpconfigdir}/macports.conf.tmp && \
+ mv -v ${mpconfigdir}/macports.conf.tmp ${mpconfigdir}/macports.conf
+
+#something more?
+
+####
+# NOTES:
+# -) Is it safe to delete the dp_version file while the upgrade target runs?
+# -) should we use the ${DESTDIR} sandbox?
+# -) should we force moves?
+# -) maybe I can regroup at least some of the sed calls?
+# -)
+####
+
+install:: dp2mpUpgrade
+#The order of installation targets having been reversed between this Makefile and Mk/macports.subdir.mk to
+#get the upgrade target working in the best way possible, this informational text below ends up hidden
+#among lots of output. Therefore I need to find somewhere to put it, so that it's seen as it used to be.
@echo ""
@echo "Congratulations, you have successfully installed the MacPorts system. To get the Portfiles and update the system, run:"
@echo ""
@@ -35,6 +94,8 @@
@echo "Please read port(1) and the MacPorts Wiki at http://trac.macports.org/ for full documentation."
@echo ""
+include Mk/macports.subdir.mk
+
clean::
distclean::
Modified: branches/dp2mp-move/base/doc/Makefile
===================================================================
--- branches/dp2mp-move/base/doc/Makefile 2007-05-14 07:32:10 UTC (rev 25111)
+++ branches/dp2mp-move/base/doc/Makefile 2007-05-14 08:01:29 UTC (rev 25112)
@@ -29,28 +29,19 @@
$(LN_S) share/man ${INSTALLDIR}/man; \
fi
-# Install the macports.conf file. If it's already installed, upgrade it
- if test ! -e ${DESTDIR}/${mpconfigdir}/macports.conf ; then \
+ $(SILENT)if test ! -e ${DESTDIR}/${mpconfigdir}/macports.conf ; then \
set -x; \
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 macports.conf ${DESTDIR}${mpconfigdir}; \
- else \
- sed -e s/rsync.darwinports.org/rsync.macports.org/ ${DESTDIR}${mpconfigdir}/macports.conf > ${DESTDIR}${mpconfigdir}/macports.conf.tmp && \
- mv ${DESTDIR}${mpconfigdir}/macports.conf.tmp ${DESTDIR}${mpconfigdir}/macports.conf; \
fi
-
- # Install the sources.conf file. If it's already installed, upgrade it
- if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
+ $(SILENT)if test ! -e ${DESTDIR}${mpconfigdir}/sources.conf ; then \
set -x; \
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 sources.conf ${DESTDIR}${mpconfigdir}; \
- else \
- sed -e s/rsync.darwinports.org/rsync.macports.org/ ${DESTDIR}${mpconfigdir}/sources.conf > ${DESTDIR}${mpconfigdir}/sources.conf.tmp && \
- mv ${DESTDIR}${mpconfigdir}/sources.conf.tmp ${DESTDIR}${mpconfigdir}/sources.conf; \
fi
-
$(SILENT)if test ! -e ${DESTDIR}${mpconfigdir}/variants.conf ; then \
set -x; \
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 variants.conf ${DESTDIR}${mpconfigdir}; \
fi
+
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${DESTDIR}${mpconfigdir}
$(INSTALL) -d -o ${DSTUSR} -g ${DSTGRP} -m ${DSTMODE} ${INSTALLDIR}/share/macports/resources/port1.0/install
$(INSTALL) -o ${DSTUSR} -g ${DSTGRP} -m 644 prefix.mtree ${INSTALLDIR}/share/macports/resources/port1.0/install/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070514/bade4137/attachment.html
More information about the macports-changes
mailing list