[25399] branches/dp2mp-move/base

source_changes at macosforge.org source_changes at macosforge.org
Mon May 21 00:46:36 PDT 2007


Revision: 25399
          http://trac.macosforge.org/projects/macports/changeset/25399
Author:   jmpp at macports.org
Date:     2007-05-21 00:46:36 -0700 (Mon, 21 May 2007)

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

Another round of changes to the upgrade target:

 * Somewhat improve comments (mostly spacing and punctuation);
 * Better protect $vars passed to the shell with {};
 * Move the receipts upgrading rule to the top, making it our first reinplace;
 * Re-indent continuation lines in multi-line instructions passed to the shell (solely an aesthetics change);
 * When reinplace'ing the rsync server, match just 'darwinports' rather than the fqdn, in order to also catch other strings in older sources.conf files;
 * Add a rule to upgrade a reference to ports.conf(5) to macpors.conf(5) in macports.conf;
 * Apply final reinplace (meant for dp strings in comments) only to the macports.conf file, as it messes up the sources.conf file;
 * Remove some more pending notes.

Modified Paths:
--------------
    branches/dp2mp-move/base/Makefile.in
    branches/dp2mp-move/base/Mk/macports.autoconf.mk.in

Modified: branches/dp2mp-move/base/Makefile.in
===================================================================
--- branches/dp2mp-move/base/Makefile.in	2007-05-21 07:38:22 UTC (rev 25398)
+++ branches/dp2mp-move/base/Makefile.in	2007-05-21 07:46:36 UTC (rev 25399)
@@ -25,76 +25,82 @@
 	fi
 
 upgrade:
-	@echo -e "Upgrading your existing MacPorts installation to the new layout.\n"
+	@echo -e "\nUpgrading your existing MacPorts installation to the new layout.\n"
 
-# 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.
+# 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 -rf ${TCL_PACKAGE_DIR}/darwinports1.0
 
-# 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.
+# 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
 
-# Important directories inside ${localstatedir}/db/dports are moved to their new location, creating it first
+# 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 \
-		[ ! -d ${localstatedir}/db/dports/$$dir ] || mv -v ${localstatedir}/db/dports/$$dir ${localstatedir}/macports ; \
+		[ ! -d ${localstatedir}/db/dports/$${dir} ] || mv -v ${localstatedir}/db/dports/$${dir} ${localstatedir}/macports ; \
 	done
 
-# Move the default ports tree to the new layout.
+# Move the default ports tree to the new layout:
 	[ ! -d ${localstatedir}/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports ] || { mkdir -pv \
 	${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.
+# 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.
+# 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.
+# Following that, the dir itself is renamed to its new name:
 	[ ! -d ${sysconfdir}/ports ] || mv -v ${sysconfdir}/ports ${sysconfdir}/macports
 
-# New default path up to the configuration files (referenced through other variables) is inserted into the macports.conf file.
+# 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 \
+		cp -v $${receipt} $${receipt}.old && { \
+			$(BZIP2) -q -dc $${receipt} | sed 's/db\/dports/macports/g' | $(BZIP2) -q -zf > $${receipt}.new ; \
+		} && mv -v $${receipt}.new $${receipt} ; \
+	done
+
+# New default path up to the configuration files (referenced through other variables) is inserted into the macports.conf file:
 	sed 's/etc\/ports/etc\/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
-	mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
 
-# New default value for the portdbpath variable is inserted into the macports.conf file.
+# New default value for the portdbpath variable is inserted into the macports.conf file:
 	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
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
 
-# MacPorts rsync server is replaced into the macpors.conf and sources.conf files.
-	sed 's/rsync.darwinports.org/rsync.macports.org/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
-	mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
-	sed 's/rsync.darwinports.org/rsync.macports.org/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
-	mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf
+# MacPorts rsync server is replaced into the macpors.conf and sources.conf files:
+	sed 's/darwinports/macports/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
+	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
 
-# New default values for the base and ports trees are inserted into the macports.conf and sources.conf configuration files.
+# New default values for the base and ports trees are inserted into the macports.conf and sources.conf configuration files:
 	sed 's/dpupdate1\/base/release\/base/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
-	mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.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
+		mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf
 
-# Stray quotes are removed from the value of the rsync_options key in old conf files
+# Stray quotes are removed from the value of the rsync_options key in old conf files:
 	sed '/^rsync_options/s/"\(.*\)"/\1/' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
-	mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
 
 
 #something more?
 
-# 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
+# References to the old ports.conf(5) man page are updated to the new macports.conf(5) page:
+	sed 's/ports.conf(5)/macports.conf(5)/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
+
+# 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:
 	sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' ${sysconfdir}/macports/macports.conf > ${sysconfdir}/macports/macports.conf.tmp && \
-	mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
-	sed 's/[Dd]\(arwin\)\{0,1\}[Pp]\(orts\)\{0,1\}/MacPorts/g' ${sysconfdir}/macports/sources.conf > ${sysconfdir}/macports/sources.conf.tmp && \
-	mv -v ${sysconfdir}/macports/sources.conf.tmp ${sysconfdir}/macports/sources.conf
+		mv -v ${sysconfdir}/macports/macports.conf.tmp ${sysconfdir}/macports/macports.conf
 
 
 ####
 # NOTES:
 #    -) should we use the ${DESTDIR} sandbox?
 #    -) should we force moves?
-#    -) receipts still need an updating rule!
-#    -) not sure if its safe moving the software and packages dirs...
 #    -) maybe I can regroup at least some of the sed calls?
 #    -) 
 ####

Modified: branches/dp2mp-move/base/Mk/macports.autoconf.mk.in
===================================================================
--- branches/dp2mp-move/base/Mk/macports.autoconf.mk.in	2007-05-21 07:38:22 UTC (rev 25398)
+++ branches/dp2mp-move/base/Mk/macports.autoconf.mk.in	2007-05-21 07:46:36 UTC (rev 25399)
@@ -28,6 +28,7 @@
 MTREE			= @MTREE@
 LN_S			= @LN_S@
 XCODEBUILD		= @XCODEBUILD@
+BZIP2			= @BZIP2@
 
 TCLSH			= @TCLSH@
 TCL_PACKAGE_DIR		= @TCL_PACKAGE_DIR@

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


More information about the macports-changes mailing list