RESTRICTED not correctly reported

The RESTRICTED value on ports has been incorrectly recorded for some time.

The code fix:

$ cvs di port.pm
Index: port.pm
===================================================================
RCS file: /home/repositories/freshports-1/scripts/port.pm,v
retrieving revision 1.54
diff -r1.54 port.pm
168c168
<               $restricted_alt      = FreshPorts::Utilities::NULLIfEmpty($dbh, $this->{restricted_alt});
---
>               $restricted_alt      = FreshPorts::Utilities::NULLIfEmpty($dbh, $this->{restricted});

This is clearly a case of insufficient testing.

I found this bug when wondering why I could not find a package for www/linux-flashplugin9. nox pointed out that it was RESTRICTED: Redistribution not allowed

Eh? That’s not what FreshPorts was telling me. I went looking, ran a few tests, and found the error.

After making the change, I ran a script which refreshes the RESTRICTED field of every port. I then enountered these warnings:

$ perl
set-restricted-no-cdrom.pl > loading.txt
WARNING:  nonstandard use of \\ in a string literal
LINE 1: update ports set restricted = '', no_cdrom = '"no commercial...
                                                     ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 1: update ports set restricted = '"License doesn\\''t allow bin...
                                      ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 1: update ports set restricted = 'Violates djb\\''s license', n...
                                      ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 1: update ports set restricted = '"djb\\''s packaging license d...
                                      ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal
LINE 1: update ports set restricted = '"Unsure of djb\\''s license"'...
                                      ^
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.

Those fix-up scripts are pretty old. They may predate the PostgreSQL E’quoting’ mechanism. I should fix them too.

count before fix: 155
count after fix: 390

FYI, this bug has been around since Fri Jun 6 19:13:41 2008 EDT (11 months, 1 week ago).

Oops.

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

Leave a Comment

Scroll to Top