On Nov 24, 2007, at 19:26, Juan Manuel Palacios wrote:
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:
$ 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,@TCL_PACKAGE_DIR@,$(TCL_PACKAGE_DIR),g'
(...)
PortIndex2MySQL: PortIndex2MySQL.tcl ${edit} $< > $@
Adding chmod 755 $@ after that line seems to work.
/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?
I don't seem to have gotten any mail, no...
[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).
My feeling is that this is "PortIndex2MySQL". It's not "SelfUpdateThenPortIndex2MySQL". Especially on my local machine, where I just want any information about the ports in MySQL and don't care if it's up to date because I'm just testing the web site code, I don't want to be forced to sync or selfupdate every time, especially because that requires root (on my setup and I expect on most others), and a MySQL import script should not require root. I'll comment out the selfupdate step locally for now.
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.
Gah! I was on the release_1_6 branch. :)