[25925] branches/dp2mp-move/base/Makefile.in

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 6 11:44:12 PDT 2007


Revision: 25925
          http://trac.macosforge.org/projects/macports/changeset/25925
Author:   jmpp at macports.org
Date:     2007-06-06 11:44:12 -0700 (Wed, 06 Jun 2007)

Log Message:
-----------

Once again, losts of changes to the upgrade target (but this time round, changing much to not change much, really Leopard like ;-)

 * Move all deletes to the top of the target;
 * Rework the sed rules block on the main conf file to exec only if a backup file is not found (meaning the rules wont exec a second time this target is run);
 * Rename the ports.conf file to its new macports.conf name in the above reworked block;
 * Remove now useless ports.conf --> macports.conf rule;
 * Similarly, rework the sed rules block on the sources.conf file to exec only if no backup file is found;
 * Intrudoce upgrade block for the conf file in the user speficif ~/.macports/ dir, following the guidelines in both previous blocks;
 * Fix our goodbye line from the upgrade target.

Modified Paths:
--------------
    branches/dp2mp-move/base/Makefile.in

Modified: branches/dp2mp-move/base/Makefile.in
===================================================================
--- branches/dp2mp-move/base/Makefile.in	2007-06-06 17:25:36 UTC (rev 25924)
+++ branches/dp2mp-move/base/Makefile.in	2007-06-06 18:44:12 UTC (rev 25925)
@@ -36,6 +36,15 @@
 # MacPorts base files in ${datadir} are also safely removed as new ones are always installed, and onto a their new location in this case too:
 	[ ! -d ${datadir}/darwinports ] || rm -rf ${datadir}/darwinports
 
+# 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
+
+# Old ports.conf(5) man page is removed:
+	[ ! -f ${prefix}/share/man/man5/ports.conf.5 ] || rm -vf ${prefix}/share/man/man5/ports.conf.5
+
+# Conf files directory is renamed:
+	[ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
+
 # Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first:
 	mkdir -p ${localstatedir}/macports
 	for dir in distfiles packages receipts software; do \
@@ -47,18 +56,6 @@
 	${localstatedir}/macports/sources/rsync.macports.org/release && mv -v \
 	${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ${localstatedir}/macports/sources/rsync.macports.org/release/ports ; }
 
-# 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
-
-# Old ports.conf(5) man page is removed:
-	[ ! -f ${prefix}/share/man/man5/ports.conf.5 ] || rm -f ${prefix}/share/man/man5/ports.conf.5
-
 # Open up receipts and upgrade any paths in them containing old conventions to the new namespace:
 	for receipt in ${localstatedir}/macports/receipts/*/*/receipt.bz2 ; do [ ! \( -f $${receipt} -a ! -f $${receipt}.mpsaved \) ] || { \
 		cp -v $${receipt} $${receipt}.mpsaved && { \
@@ -66,7 +63,7 @@
 		} && mv -v $${receipt}.new $${receipt} ; \
 	}; done
 
-# Check the existance of the main configuration file and perform a couple of replacements on it, backing it up first:
+# Check for existance of the main configuration file and perform a couple of replacements on it, backing it up first:
 ## 1) new default path up to our configuration files (referenced through other variables);
 ## 2) new default value for the portdbpath variable;
 ## 3) new MacPorts rsync server;
@@ -75,9 +72,9 @@
 ## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
 ## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
 ## 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.
-	[ ! -f ${sysconfdir}/macports/macports.conf ] || { \
-		[ -f ${sysconfdir}/macports/macports.conf.mpsaved ] || cp -v ${sysconfdir}/macports/macports.conf ${sysconfdir}/macports/macports.conf.mpsaved; \
-		sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+	[ ! \( -f ${sysconfdir}/macports/ports.conf -a ! -f ${sysconfdir}/macports/macports.conf.mpsaved \) ] || { \
+		mv -v ${sysconfdir}/macports/ports.conf ${sysconfdir}/macports/macports.conf.mpsaved; \
+		sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf.mpsaved > ${sysconfdir}/macports/macports.conf.tmp && \
 			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
 		sed 's/db\/dports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
 			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
@@ -95,22 +92,51 @@
 			mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf; \
 	}
 
-# Check the existance of the main sources file and perform a couple of replacements on it, backing it up first:
+# Check for existance of the main sources file and perform a couple of replacements on it, backing it up first:
 ## 1) new MacPorts rsync server;
 ## 2) new default value for the ports tree.
-	[ ! -f ${sysconfdir}/macports/sources.conf ] || { \
-		[ -f ${sysconfdir}/macports/sources.conf.mpsaved ] || cp -v ${sysconfdir}/macports/sources.conf ${sysconfdir}/macports/sources.conf.mpsaved; \
+	[ ! \( -f ${sysconfdir}/macports/sources.conf -a ! -f ${sysconfdir}/macports/sources.conf.mpsaved \) ] || { \
+		cp -v ${sysconfdir}/macports/sources.conf ${sysconfdir}/macports/sources.conf.mpsaved; \
 		sed 's/darwinports/macports/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
 			mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
 		sed 's/dpupdate\/dports/release\/ports\//g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
 			mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf; \
 	}
 
+# Check for existance of a personal configuration file and perform a couple of replacements on it, backing it up first:
+## 1) new default path up to our configuration files (referenced through other variables);
+## 2) new default value for the portdbpath variable;
+## 3) new MacPorts rsync server;
+## 4) new default value for the base tree;
+## 5) new default value for trunk's base sources for users who have it (some do);
+## 6) stray quotes are removed from the value of the rsync_options key in old conf files;
+## 7) references to the old ports.conf(5) man page are updated to the new macports.conf(5) page;
+## 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.
+	[ ! \( -f $${HOME}/.macports/ports.conf -a ! -f $${HOME}/.macports/macports.conf.mpsaved \) ] || { \
+		mv -v $${HOME}/.macports/ports.conf $${HOME}/.macports/macports.conf.mpsaved; \
+		sed 's/etc\/ports/etc\/macports/g' $${HOME}/.macports/macports.conf.mpsaved > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/db\/dports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/darwinports/macports/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/dpupdate1\/base/release\/base/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/dpupdate\/base\/\{0,1\}/trunk\/base\//g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed '/^rsync_options/s/"\(.*\)"/\1/' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/ ports.conf(5)/ macports.conf(5)/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+		sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' $${HOME}/.macports/macports.conf > $${HOME}/.macports/macports.conf.tmp && \
+			mv -v $${HOME}/.macports/macports.conf.tmp $${HOME}/.macports/macports.conf; \
+	}
 
+
 #something more?
 
-# Trailing new line to signal the uprade procedure is done!
-	echo -e \n
+# Upgrade success announcement (meaning we're done ;):
+	@echo -e "\nMacPorts installation successfully upgraded from the old DarwinPorts namespace!\n"
 
 ####
 # NOTES:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070606/296f1cfd/attachment.html


More information about the macports-changes mailing list