Macports installer endless loop
Ryan Schmidt
ryandesign at macports.org
Fri Feb 12 02:12:40 PST 2010
On Feb 12, 2010, at 04:00, dreamcat four wrote:
> Link:
> http://github.com/dreamcat4/site-cookbooks/blob/COOK-254/mac_os_x/recipes/macports.rb#L81-83
>
> AFAICT, when it works, the installer takes a very long time and loops
> around a lot. The real problems is, when it doesn't work, the
> installer may never exit and we can't really be sure what's going on
> and cannot kill it off. Wouldn't it be just common sense to but in a
> loop limit, and have the installer exit with an error if the limit if
> reached?
I know of no such behavior in the MacPorts installation scripts. I didn't even think there were any loops in the installation scripts at all.
> Can I see the code for the installer script?
Sure, it's all here:
http://trac.macports.org/browser/trunk/base/portmgr/dmg
> For the life of me I cannot find where this TCL installer is looping
> around. Attached is the full log for a successful run.
Ok, the output shows the line
installer: Running package scripts….....
repeated many times. The installer prints this message; we have no control over what messages the installer prints. I have a feeling it prints this message repeatedly of its own accord, and I don't think it means that it is running our scripts multiple times. Rather, our postflight script simply takes a long time (because we run port selfupdate), and the installer is telling you that the script is still running.
selfupdate can fail, if our rsync server is down (rare) or your network doesn't support rsync connections (relatively common).
> It suggest that
> the program will loop approximately 177 times. Doesn't that sound a
> little bit crazy?
I'm not sure why the installer is designed that way but you could request Apple change it in some way to make it clearer.
> Anyway we might set a safe loop limit as 200 for exiting the loop.
More information about the macports-dev
mailing list