hostname change causes missing links and pathnames

FreshPorts is a tender beast. It is both massive and sensitive. One example of that sensitivity came to light today.

Jeffrey Bouquet wrote in to tell me of a problem with paths on FreshSource (our sister website, which displays more, but less). The problem has been corrected, but I took screen shots to illustrate this post.


Looking at FreshSource and scrolling down, I saw this:

Screen Shot 2015-07-02 at 11.49.27 AM

The top commit does not list the files. The second commit does. Oh.

I started looking at those two commits in FreshPorts and I found:

Screen Shot 2015-07-02 at 11.52.40 AM

URL for above commit

The path name is listed, but that’s just text. Notice that the Links column is empty.

Compare that with the previous commit:

Screen Shot 2015-07-02 at 11.46.08 AM

URL to above commit

As you see, the Links column is populated.


Digging around in the code for this output, I noticed a call to freshports_MessageIdToRepoName($message_id) and that is what clued me in.


If you examine the two URLs to commits above, you will notice a difference in the message_id parameter:


Ahh, they changed the hostname for outgoing commit emails.

The fix

A few minutes later and some quick tests, we had a fix:

 $ svn di freshports.php 
Index: freshports.php
--- freshports.php	(revision 4718)
+++ freshports.php	(working copy)
@@ -35,7 +35,7 @@
 DEFINE('SPONSORS', 'Servers and bandwidth provided by<br><a href="" TARGET="_new">New York Internet</a>, <a href=""  TARGET="_new">SuperNews</a>, and <a href="" TARGET="_new">RootBSD</a>');
 if ($Debug) echo "'" . $_SERVER['DOCUMENT_ROOT'] . '/../classes/watchnotice.php<br>';
@@ -2093,7 +2093,9 @@
   $repo = array(
             '/\$/i'     => FREEBSD_REPO_SVN,
-            '/\$/i' => FREEBSD_REPO_CVS);
+            '/\$/i' => FREEBSD_REPO_CVS,
+            '/\$/i'    => FREEBSD_REPO_SVN,
   # given a message id, figure out what repo it came from
   $RepoName = '';

Why bother?

FreshPorts predates the change from cvs to svn. The data in FreshPorts does not care what type of revision management tool you use, it does link back to the repo for your browsing pleasure. If FreshPorts knows the repo related to a given commit, it can link. If not, it can’t.

Website Pin Facebook Twitter Myspace Friendfeed Technorati Digg Google StumbleUpon Premium Responsive

1 thought on “hostname change causes missing links and pathnames”

Leave a Comment

Scroll to Top