Small bug in ports.php

Ryan Schmidt ryandesign at macports.org
Sat Nov 24 16:33:08 PST 2007


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?

>> It tickles my hard drive for awhile, then ends with no output.
>>
>> $ echo $?
>> 1
>> $
>>
>> So it's failing but I don't know why. I see there should be  
>> ui_error output on failures. How can I see it?
>
> 	The script creates a /tmp/portsdb.log file where all runtime  
> activity is logged and then piped to the /usr/sbin/sendmail program  
> to get it through to $SPAM_LOVERS, so you might want to try to find  
> that file.
>
> 	In any case, you should first run the script from the shell before  
> installing it for launchd. Assuming I didn't introduce any bugs in  
> my recent edits, all possible runtime failures should be in the  
> contents of that log file and then in your mailbox (in the case of  
> these "accounted for failures" --like a failure to connect to the  
> mysqld server or no password file found--, the script cleans up  
> after itself upon exit and removes everything it creates, including  
> the log file); if I did introduce, say, a Tcl syntactic bug, then  
> you should get a backtrace spill on your shell. Please let me know  
> how it goes so that I can correct potential bugs.

/tmp/portsdb.log was not present; it must've gotten cleaned up  
automatically. I caught it with tail -f while the script was running  
and it said:

[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. :)

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, and now I have the  
data in my MySQL database and will turn my attention to the PHP  
files. ("localhost" and "127.0.0.1" are not equivalent to MySQL. The  
former means "use the socket file and bypass the network stack" and  
is supposed to be faster, while the latter accesses the network stack  
as it would for any other IP address.)




More information about the macports-dev mailing list