#18889 closed enhancement (fixed)
Push livecheck default settings into dports/_resources/port1.0
Reported by: | blb@… | Owned by: | macports-tickets@… |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 1.8.0 |
Component: | base | Version: | 1.8.0 |
Keywords: | livecheck | Cc: | lperry (Perry Lee) |
Port: |
Description
Currently default values for various check types within livecheck are defined in trunk/base/src/port1.0/portlivecheck.tcl and hence require updates to the base MacPorts release in order to update.
The default values (eg, livecheck.url and livecheck.regex) for various built-in types (freshmeat, sourceforge, etc) should instead be set by a file in dports/_resources/port1.0 (like port groups and mirror sites). This would allow much easier and faster updates when things change (see ticket #18887).
Attachments (6)
Change History (18)
comment:1 Changed 16 years ago by lperry (Perry Lee)
Changed 16 years ago by lperry (Perry Lee)
Attachment: | patch-portlivecheck.tcl.diff added |
---|
Changed 16 years ago by lperry (Perry Lee)
Attachment: | defaults.tcl added |
---|
comment:2 Changed 16 years ago by blb@…
Looks like a good start; what I'd really like to see (not sure how others feel) is the removal of anything site-specific (eg any reference to freshmeat, googlecode, etc) moved out of base and into the _resources path. Also, be done in such a way that new ones can be added only but updating that file in _resources.
Changed 16 years ago by lperry (Perry Lee)
Attachment: | patch-portlivecheck.tcl.2.diff added |
---|
a new version of portlivecheck.tcl that has no site-specific references
Changed 16 years ago by lperry (Perry Lee)
Attachment: | patch-_resources-port1.0-livecheck.diff added |
---|
a svn diff of dports/_resources
comment:3 follow-up: 4 Changed 16 years ago by lperry (Perry Lee)
I've attached a new patch that removes site-specific references in portlivecheck.tcl (attachment:patch-portlivecheck.tcl.2.diff).
Each type (freshmeat, gnu, googlecode and sourceforge) has a corresponding .tcl file in dports/_resources/port1.0/livecheck (attachment:patch-_resources-port1.0-livecheck.diff ). In ports where no livecheck is specified (e.g., libsndfile), defaults are loaded from fallback.tcl, which is a symlink to one of the types (currently freshmeat).
I've tested the patch with the following ports:
- libsndfile: freshmeat (fallback)
- ccaudio: gnu
- mongoose: googlecode
- lingon: sourceforge
$ port -v livecheck libsndfile ccaudio mongoose lingon libsndfile seems to have been updated (port version: 1.0.19, new version: 0.9.48) ccaudio seems to have been updated (port version: 1.1.1, new version: 1.2.0) mongoose seems to be up to date Lingon seems to have been updated (port version: 2.1, new version: 2.1.1)
Changed 16 years ago by lperry (Perry Lee)
Attachment: | patch-portlivecheck.tcl.3.diff added |
---|
You should use this version; I noticed a problem with patch-portlivecheck.tcl.2.diff.
comment:4 Changed 16 years ago by lperry (Perry Lee)
I should probably add that portlivecheck pattern matches filenames against mirrors (as defined in port1.0/fetch/mirror_sites.tcl) to determine which defaults file to load.
Changed 16 years ago by lperry (Perry Lee)
an example for gnome (_resources/port1.0/livecheck/gnome.tcl)
comment:5 Changed 16 years ago by lperry (Perry Lee)
I've attached an example defaults file for gnome (attachment:gnome.tcl). I tested it with the ports esound and totem (note that I removed the livecheck portions of their Portfile before running livecheck).
DEBUG: Loading the defaults from '/Users/perry/src/macports-trunk/dports/_resources/port1.0/livecheck/gnome.tcl' DEBUG: Fetching http://ftp.gnome.org/pub/gnome/sources/esound/0.2/ DEBUG: The regex is "LATEST-IS-(.*)"" DEBUG: The regex matched "LATEST-IS-0.2.41"", extracted "0.2.41" esound seems to be up to date
comment:6 Changed 16 years ago by lperry (Perry Lee)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Committed in r51069.
comment:7 Changed 15 years ago by jmroot (Joshua Root)
Cc: | perry@… added |
---|
I notice that rsync doesn't seem to want to download the fallback.tcl symlink.
comment:8 follow-up: 9 Changed 15 years ago by blb@…
Hmm, that's weird. Perhaps fallback.tcl should just be source freshmeat.tcl
?
comment:9 follow-up: 10 Changed 15 years ago by lperry (Perry Lee)
Replying to blb@…:
Hmm, that's weird. Perhaps fallback.tcl should just be
source freshmeat.tcl
?
That's fine, though we'd be leaving a hard-coded value in portlivecheck.tcl (then again, I doubt that value will be changed anytime soon, if ever).
comment:10 follow-up: 11 Changed 15 years ago by raimue (Rainer Müller)
Replying to perry@…:
That's fine, though we'd be leaving a hard-coded value in portlivecheck.tcl (then again, I doubt that value will be changed anytime soon, if ever).
Actually I intended to change it, because not many projects have a freshmeat page which is always up to date. Therefore it would probably be better to check the (first?) master_sites URL for files with a higher version number, as it is often a webserver directory listing.
Could fallback.tcl be a one-liner sourcing the default?
comment:11 Changed 15 years ago by lperry (Perry Lee)
Replying to raimue@…:
Could fallback.tcl be a one-liner sourcing the default?
Yeah, that'd work. I added the following to fallback.tcl.
source [getdefaultportresourcepath "port1.0/livecheck"]/freshmeat.tcl
I've attached a patch for portlivecheck.tcl that sources _resource/port1.0/livecheck/defaults.tcl to load the default values.