Disabling livecheck in subports

Ryan Schmidt ryandesign at macports.org
Sat Jan 14 15:01:38 PST 2012


On Jan 14, 2012, at 04:19, Dan Ports wrote:
> On Fri, Jan 13, 2012 at 07:30:12PM -0600, Ryan Schmidt wrote:
>> It seems to me that livecheck should be disabled in subports. I use "port livecheck maintainer:ryandesign" to check all my ports for updates, and I imagine other maintainers do similarly, and it is of no benefit to check the same software multiple times; it just wastes time and network bandwidth.
> 
> That makes sense, but I sometimes do things like `port livecheck
> installed` or `port livecheck rdepof:someport` to check for any ports
> that might need updating, especially nomaintainer ones. That wouldn't
> work if subports don't have livechecks.
> 
> I'm not sure that's an important case to support, but I thought I'd
> mention it.

That's a point...

Maybe livecheck itself could be made smarter. There are two problems I want to solve. One is wasting time and network bandwidth downloading the same information multiple times. The other is displaying redundant information to the user.

Wasted time and bandwidth could be mitigated by having livecheck cache the URLs it downloads, until all livechecks are done. That would help if you run "port livecheck <somesetofports>" and multiple ports or subports in that set use the same livecheck URL. It would even help ports that aren't currently implemented as subports.

Redundant livecheck runs could also perhaps be addressed like this: MacPorts could keep track of each livecheck object/command it runs, and not run the same command twice. For example if I run "port livecheck php5 php5-mysql" MacPorts would run the livecheck for php5, then record in a list all the properties of the livecheck object/command -- livecheck.name, livecheck.version, livecheck.type, livecheck.url, livecheck.regex, etc. Or, for speed, a hash of all of those combined. Then when it got to looking at php5-mysql, it could check the list of prior livechecks, realize that all the values for php5-mysql are the same as those for php5, and not run the livecheck again.


These changes wouldn't help me the way I run livecheck... I don't actually run "port livecheck" directly; I use a more complicated script that invokes "port livecheck" multiple times in parallel, in order to speed things up:

https://trac.macports.org/browser/users/ryandesign/scripts/portmylivecheck

Modifying MacPorts base to natively run multiple livechecks in parallel would probably be more difficult. I don't think anything in MacPorts is parallel or threaded right now.




More information about the macports-dev mailing list