Small bug in ports.php

Ryan Schmidt ryandesign at macports.org
Sat Nov 24 02:58:52 PST 2007


On Nov 22, 2007, at 13:09, Juan Manuel Palacios wrote:

> 	Sometimes transcripts are the best:
>
> [14:40] @<jmpp> there is a bug in ports.php by which multiple  
> maintainers are listed as 'maintainer1maintainer2'
> [14:40] @<jmpp> but I'll look into it later
> [14:41] @<jmpp> I know where it originates
> [14:41] @<jmpp> I made a change to how the sql instructions are  
> created in PortIndex2MySQL
> [14:41] @<jmpp> but I didn't adapt the ports.php client in turn
> [14:41] @<jmpp> but, again, I'll look into it later ;)

I believe I fixed it in r31443. I did not test it locally because I  
haven't looked into what's required to set up a local installation of  
the web site. But it's a very simple change and I believe it's  
correct. If there's a document telling me what to do to set up a  
local installation of the site, please let me know. I already have  
apache2, php5 and mysql5 installed and have no trouble administering  
them so as long as I just have to install a database and user that's  
no trouble.

> 	That bug might also affect the categories.

Ports with multiple categories look fine.

> From PortIndex2MySQL:
>
>     set primary 1
>     foreach category $categories {
>         set category [sql_escape $category]
>         puts $sqlfile_fd "INSERT INTO categories VALUES  
> ('$portname', '$category', $primary);"
>         incr primary
>     }
>
>     set primary 1
>     foreach maintainer $maintainers {
>         set maintainer [sql_escape $maintainer]
>         puts $sqlfile_fd "INSERT INTO maintainers VALUES  
> ('$portname', '$maintainer', $primary);"
>         incr primary
>     }
>
>
> 	But it seems like I was mistaken in the assertion I made in the  
> transcript above. I reverted the behavior of the primary key for  
> categories and maintainers in r31415 and regenerated the database  
> with the new script, but the behavior persists as shown by a simple  
> query such as http://apollo.homeunix.net/macports/ports.php? 
> by=cat&substr=lang
>
> 	I'd be grateful if anyone beats me to looking into this issue...  
> Ryan? ;-)
>
> 	Regards,...
>
>
> -jmpp
>
> PS: In trunk/www/ports.php, the sections querying the db for  
> maintainer and category information are clearly labeled /*  
> MAINTAINERS */ and /* CATEGORIES */, respectively.

Thanks, those comments are good to have in the file. :) Made it  
easier to find.




More information about the macports-dev mailing list