Small bug in ports.php

Juan Manuel Palacios jmpp at macports.org
Sat Nov 24 17:26:44 PST 2007


On Nov 24, 2007, at 8:33 PM, Ryan Schmidt wrote:

> On Nov 24, 2007, at 18:11, Juan Manuel Palacios wrote:
>
>> On Nov 24, 2007, at 6:59 PM, Ryan Schmidt wrote:
>>
>>> Got the database created, a user created, edited the script to  
>>> point to a password file, changed the spam lovers to me, ran make.  
>>> Am now trying to run the script.
>>>
>>> $ env tclsh PortIndex2MySQL
>>
>> 	No need to do this, the script already has a "#!/usr/bin/env  
>> tclsh" shebang (you can run it as "./PortIndex2MySQL").
>
> I couldn't, because "make" does not set the execute bit on  
> PortIndex2MySQL. "make" should probably do that, shouldn't it?


	Cant exactly think of a way to do it without calling an installation  
routine (even if to the same directory, I really see no sense in  
installing this script anywhere else on a regular basis), as all I  
currently do in the Makefile is a reinplace:

edit = sed \
         -e 's, at TCL_PACKAGE_DIR@,$(TCL_PACKAGE_DIR),g'

(...)

PortIndex2MySQL: PortIndex2MySQL.tcl
         ${edit} $< > $@

> /tmp/portsdb.log was not present; it must've gotten cleaned up  
> automatically.


	Expected behavior.


> I caught it with tail -f while the script was running and it said:


	What about in your inbox? Didn't the mailing functionality work?

>
>
> [snip]
> rsync: mkstemp "/opt/local/var/macports/sources/rsync.macports.org/ 
> release/base/.ChangeLog.Uw8VSO" failed: Permission denied (13)
> rsync: mkstemp "/opt/local/var/macports/sources/rsync.macports.org/ 
> release/base/config/.RELEASE_URL.hbE1ot" failed: Permission denied  
> (13)
> rsync: mkstemp "/opt/local/var/macports/sources/rsync.macports.org/ 
> release/base/config/.dp_version.TYaMkG" failed: Permission denied (13)
> [snip]
>
> So it's trying to do a selfupdate and failing because it's not root.  
> Running it as root got me past that, though I'd rather not have to  
> run it as root. I'll selfupdate my MacPorts myself when I feel like  
> it. :)


	The script needs to refresh the ports tree in order to regen the db  
with up-to-date information, so a 'sync' operation fits the bill...  
and while at it, I thought why not go all the way and simply call out  
to "selfupdate" ;-). Depending on your setup, yes, you might need root  
powers to do that (either sync and/or selfupdate).


>
>
> Next error encountered was this:
>
> Error: CHILDSTATUS 17126 1: ERROR 2003 (HY000): Can't connect to  
> MySQL server on '127.0.0.1' (61)
>
> True: I have networking support deliberately disabled on my MySQL so  
> that only local connections are possible. Changing "set dbhost  
> 127.0.0.1" to "set dbhost localhost" fixed it,


	The most recent version of the script in svn is using localhost,  
DuBois has taught me well so I changed that a while ago ;-) You must  
be using an outdated version.


> and now I have the data in my MySQL database and will turn my  
> attention to the PHP files.


	Great, I'd love to have your PHP experienced eyes on them!

	Regards,...


-jmpp



More information about the macports-dev mailing list