wiki:MacPortsRenaming

Version 5 (modified by jmpp@…, 17 years ago) (diff)

Add rule for updating dpupdate/base/ to the new trunk module

Upon migrating away from the defunct OpenDarwin community, the MacPorts project also changed its name from the long standing "DarwinPorts", in order to reflect its aim to refocus support solely on Mac OS X.

This change brought about great mixture between the old and new names at various aspects of the project, like chosen installation paths, internal routines naming and many others, as every naming decision up to the point of migration had naturally been based on the old project name. When first moving to our new name great effort was put into updating most of the user visible stuff to the implied new namespace, but many "under the hood" things were left behind in the old namespace due to time constraints in getting MacPorts 1.4 out the door, including every single installation path.

It is the aim of the dp2mp-move branch to complete the migration to the new namespace at every single level of the MacPorts project:

  • source level layout, e.g. moving base/src/darwinports1.0 to base/src/macports1.0 in svn and adapting files therein accordingly;
  • internal routines naming, e.g. renaming dportinit to mportinit and many other examples in this category;
  • installation paths, e.g. going from a ${prefix}/share/darwinports MacPorts base installation path at the host level to ${prefix}/share/macports;
  • distribution means, e.g. by using the rsync.macports.org server for source and ports distribution and updating corresponding options in configuration files in existing installations to reflect this;
  • any other relevant aspect....

Needless to say, changes in this branch have major implications not only in the inner workings of MacPorts, but also on some user visible aspects of the project. WIth respect to installation paths, a default MacPorts installation upgraded to this branch would experience the following moves:

/Library/Tcl/darwinports1.0              ----->     /Library/Tcl/macports1.0
/opt/local/etc/ports/ports.conf          ----->     /opt/local/etc/ports/macports.conf
/opt/local/etc/ports/dp_version          ----->     /opt/local/etc/ports/mp_version
/opt/local/etc/ports                     ----->     /opt/local/etc/macports
/opt/local/share/darwinports             ----->     /opt/local/share/macports
/opt/local/share/man/man5/ports.conf     ----->     /opt/local/share/man/man5/macports.conf
/opt/local/var/db/dports                 ----->     /opt/local/var/macports

The last entry in the list above represents an important and delicate move, since MacPorts operates inside the /opt/local/var/db/dports directory for many of its internal operations, like fetching Portfiles and building ports, among many other activities. Previously, MacPorts would fetch its own sources and the ports tree through the selfupdate and/or sync routines into a /opt/local/var/db/dports/sources/rsync.<rsync_server>_<rsync_module> skeleton, replacing dots and other characters in server/module names with _ in some parts of the resulting directory name. Therefore the most common and default paths for the rsync based MacPorts sources and ports tree would look like:

/opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate1/base
/opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate_dports

selfupdate and sync routines in this branch, however, have been upgraded to work with a much more flexible and cleaner skeleton: sources are now fetched into a /opt/local/var/macports/sources/<server>/<rsync_module> hierarchy. This may not seem like much at first, but closer inspection reveals this approach allows room to grow in every custom way users might need, while also preserving a sense of order. Default paths will now look like:

/opt/local/var/macports/sources/rsync.macports.org/release/base
/opt/local/var/macports/sources/rsync.macports.org/release/ports

Here release/base and release/ports are the new default rsync modules for both MacPorts base sources and the ports tree, respectively. This allows us, for example, to distribute trunk's base sources through a much more logical and self explanatory naming:

/opt/local/var/macports/sources/rsync.macports.org/trunk/base

trunk/base being the corresponding rsync module in this case that would come to replace the old and confusing /opt/local/var/db/dports/sources/rsync.rsync.darwinports.org_dpupdate/base directory.

This new structure also allows us to distribute a new and custom ports tree under an entirely different rsync module if we so wish, while still preserving order. An example of this would look like, for a ports tree with Portfiles still in testing:

/opt/local/var/macports/sources/rsync.macports.org/testing/ports

MacPorts users catering to the varied needs of clients on large networks, who might have needs for multiple ports trees, would instantly see the benefits of this approach:

/opt/local/var/macports/sources/<your_server>/module1/ports
/opt/local/var/macports/sources/<your_server>/module2/ports
/opt/local/var/macports/sources/<your_server>/module3/ports

Furthermore, an upgrade target in the main Makefile takes care of moving everything that's "old" in an existing MacPorts installation into its new location before regular installation begins. Among these moves there are a set of sed rules that act on existing configuration files to upgrade them to the new conventions. For the new macpors.conf file:

  • new default path up to the configuration files is inserted, /opt/local/etc/ports ---> /opt/local/etc/macports;
  • new default path for the portdbpath variable is inserted, /opt/local/var/db/dports ---> /opt/local/var/macports;
  • new MacPorts rsync server is inserted, rsync.darwinports.org ---> rsync.macports.org;
  • new default value for the base tree, dpupdate1/base/ ---> release/base/;
  • new value for trunk's base sources, dpupdate/base/ ---> trunk/base/ and dpupdate/base ---> trunk/base/;
  • stray quotes are removed from the value of the rsync_options key in old conf files, "-rtzv--delete --delete-after" ---> -rtzv --delete --delete-after;
  • comment references to the old ports.conf(5) man page are upgraded to the new macports.conf(5) page, ports.conf(5) ---> macports.conf(5);
  • remaining comments in the DarwinPorts namespace are also upgraded.

And for sources.conf:

  • new MacPorts rsync server, rsync.darwinports.org ---> rsync.macports.org;
  • new default value for the ports tree, dpupdate/dports ---> release/ports/.