pkg-descr processing has been fixed

John Marino wrote in August to tell me about a problem with pkg-descr. He pointed out that new ports were not showing the contents of that file. He provided examples:

  • devel/commit-patch
  • devel/florist-gpl
  • archivers/zip-ada

On beta, the results were correct for devel/commit-patch, but devel/florist-gpl and archivers/zip-ada were wrong.

I fixed the problem on dev, but then never took it farther. I was in the midst of moving from cvs to svn and I forgot to move this into production.

Thus, the problem lingered for anther 4 months.

Fortunately, John persisted, and today he wrote in again. This prompted me to look the bug again. The fix was easy:

Index: port.pm
===================================================================
--- port.pm	(revision 4551)
+++ port.pm	(working copy)
@@ -664,7 +664,7 @@
 		# if it's defined, and it exists....
 		my $longdescription = '';
 		my $homepage        = '';
-		if (defined($RealDescrPath) && -f $RealDescrPath) {
+		if (defined($RealDescrPath)) {
 			print "invoking _GetDescrAndHomePage() with '$RealDescrPath'\n";
 			($longdescription, $homepage) = _GetDescrAndHomePage($RealDescrPath);
 		}

Why do we no longer test that it’s a file? The script is running outside the chroot where the file is located. This test has existed since the early days. Getting rid of it allows the _GetDescrAndHomePage function to do the right thing.

Pushing the code to production took a few hours. The server was running off code from cvs. It took me an hour or so to configure things and get it running properly.

Then I ran a couple of scripts to refresh any missing data. These are the two queries I used to identify the ports which needed to be refreshed:

SELECT ports_active.id,
         ports_active.category,
         ports_active.name
    FROM ports_active
   WHERE homepage = ''
      OR homepage is null
ORDER BY category, name;

SELECT ports_active.id,
         ports_active.category,
         ports_active.name
    FROM ports_active
   WHERE long_description = ''
      OR long_description is null
ORDER BY category, name "

There were 411 ports with an empty long_description, and 403 ports with an empty homepage.

Thanks John.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top