Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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)

patch-portlivecheck.tcl.diff (3.0 KB) - added by lperry (Perry Lee) 12 years ago.
defaults.tcl (2.2 KB) - added by lperry (Perry Lee) 12 years ago.
patch-portlivecheck.tcl.2.diff (5.8 KB) - added by lperry (Perry Lee) 12 years ago.
a new version of portlivecheck.tcl that has no site-specific references
patch-_resources-port1.0-livecheck.diff (3.4 KB) - added by lperry (Perry Lee) 12 years ago.
a svn diff of dports/_resources
patch-portlivecheck.tcl.3.diff (5.9 KB) - added by lperry (Perry Lee) 12 years ago.
You should use this version; I noticed a problem with patch-portlivecheck.tcl.2.diff.
gnome.tcl (299 bytes) - added by lperry (Perry Lee) 12 years ago.
an example for gnome (_resources/port1.0/livecheck/gnome.tcl)

Download all attachments as: .zip

Change History (18)

comment:1 Changed 12 years ago by lperry (Perry Lee)

I've attached a patch for portlivecheck.tcl that sources _resource/port1.0/livecheck/defaults.tcl to load the default values.

Changed 12 years ago by lperry (Perry Lee)

Changed 12 years ago by lperry (Perry Lee)

Attachment: defaults.tcl added

comment:2 Changed 12 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 12 years ago by lperry (Perry Lee)

a new version of portlivecheck.tcl that has no site-specific references

Changed 12 years ago by lperry (Perry Lee)

a svn diff of dports/_resources

comment:3 Changed 12 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 12 years ago by lperry (Perry Lee)

You should use this version; I noticed a problem with patch-portlivecheck.tcl.2.diff.

comment:4 in reply to:  3 Changed 12 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 12 years ago by lperry (Perry Lee)

Attachment: gnome.tcl added

an example for gnome (_resources/port1.0/livecheck/gnome.tcl)

comment:5 Changed 12 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 12 years ago by lperry (Perry Lee)

Resolution: fixed
Status: newclosed

Committed in r51069.

comment:7 Changed 12 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 Changed 12 years ago by blb@…

Hmm, that's weird. Perhaps fallback.tcl should just be source freshmeat.tcl?

comment:9 in reply to:  8 ; Changed 12 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 in reply to:  9 ; Changed 12 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 in reply to:  10 Changed 12 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

comment:12 Changed 12 years ago by lperry (Perry Lee)

Replaced the symlink with a regular file that sources a default in r51434 and r51435.

Note: See TracTickets for help on using tickets.