MASTERPORT is a tool Mark Linimon and I have used for a while. It seems to have entered into common usage now.
freshports.org=# select master_port, category, name from ports_active where master_port like '/%' order by category, name; master_port | category | name -----------------------------------------------+--------------+--------------------------- /usr/home/dan/ports/devel/ocaml-camlidl | archivers | ocaml-zip /usr/home/dan/ports/devel/ocaml-camlidl | graphics | ocaml-lablgl /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+freewnn /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+freewnn+sj3 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+sj3 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+sj3+wnn6 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+sj3+wnn7 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+wnn6 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-canna+wnn7 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-freewnn+sj3 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-sj3 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-sj3+wnn6 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-sj3+wnn7 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-wnn6 /usr/home/dan/ports/japanese/kinput2-freewnn/ | japanese | kinput2-wnn7 /usr/home/dan/ports/math/spooles/ | math | spooles-mpich /usr/home/dan/ports/science/mpqc/ | science | mpqc-mpich /usr/home/dan/ports/devel/ocaml-camlidl | security | ocaml-cryptgps /usr/home/dan/ports/x11-toolkits/fltk/ | x11-toolkits | fltk-threads /usr/home/dan/ports/devel/ocaml-camlidl | x11-toolkits | ocaml-lablgtk (21 rows) freshports.org=#
These ports appear to set MASTERPORT within themselves. This breaks some stuff in FreshPorts.
I now think this problem can be solved with a simple string match and optional removal. In which case, the problem goes away entirely.
The fix may be as simple as:
$ cvs di port.pm
Index: port.pm
===================================================================
RCS file: /home/repositories/freshports-1/scripts/port.pm,v
retrieving revision 1.43
diff -r1.43 port.pm
534a535,536
>
> $master_port =~ s|$FreshPorts::Config::path_to_ports/||;
$
I’m running the Verify/set-master-port.pl script now.
After running set-master-port.pl, the master port for each port is correctly set. Then, I ran refresh-slave-ports.pl to refresh all the slave ports based on the current master port definitions. This needed to be done because all slave ports are updated automatically after a commit to a master port. Since master/slave relationships were not correct in the database, this last step was required to get things up to date.
One relationship was missed in all this: I needed to clear the cache for each master port. Each master port lists all the slave ports. Similarly, each slave port list its master port. Rather than code a solution, I did this:
The resulting output became a shell script, which cleared out the cache.
More about this in the next article.