Opened 8 years ago

Last modified 7 years ago

#44894 new enhancement

base: improve livecheck.type moddate

Reported by: pixilla (Bradley Giesbrecht) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.1
Keywords: haspatch Cc: raimue (Rainer Müller)
Port:

Description (last modified by pixilla (Bradley Giesbrecht))

Currently livecheck.type moddate uses the Portfiles mtime for comparison to remotes mtime.

It would be useful to allow control of the comparison time. Attached is a patch to portlivecheck.tcl which enhances the livecheck.type moddate option to allow setting the comparison time, defaulting to current behavior.

There is also a new function "getmoddate" added to curl.c and a new livecheck.type option "moddate2" in portlivecheck.tcl which uses getmoddate to provide a more informative ui_msg.

The moddate2 option is added for easy comparison, not to add another option. I am proposing replacing the use of isnewer with getmoddate.

Attachments (2)

patch-base-src-port1.0-portlivecheck.tcl.diff (3.4 KB) - added by pixilla (Bradley Giesbrecht) 8 years ago.
patch-base-src-pextlib1.0-curl.c.diff (7.2 KB) - added by pixilla (Bradley Giesbrecht) 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by pixilla (Bradley Giesbrecht)

Changed 8 years ago by pixilla (Bradley Giesbrecht)

comment:1 Changed 8 years ago by pixilla (Bradley Giesbrecht)

New features in the patches can be tested like this:

#moddate2:
version             20130325
livecheck.type      moddate2
livecheck.moddate   [clock scan ${version}]
livecheck.url       [lindex ${master_sites} 0]/[lindex ${distfiles} 0]

or the little changed moddate option:

#moddate:
version             20130325
livecheck.type      moddate
livecheck.moddate   [clock scan ${version}]
livecheck.url       [lindex ${master_sites} 0]/[lindex ${distfiles} 0]

comment:2 Changed 8 years ago by pixilla (Bradley Giesbrecht)

Description: modified (diff)

comment:3 Changed 8 years ago by pixilla (Bradley Giesbrecht)

Description: modified (diff)

comment:4 Changed 8 years ago by pixilla (Bradley Giesbrecht)

Example output using the pear-install-phar port and moddate2:

$ port livecheck pear-install-phar
pear-install-phar seems to have been updated (port version: Mon Mar 25 00:00:00 PDT 2013, new version: Sun Aug 10 13:41:17 PDT 2014)

comment:5 Changed 8 years ago by mkae (Marko Käning)

Cool stuff! This can be very useful in some cases!!! :-)

comment:6 Changed 7 years ago by raimue (Rainer Müller)

Cc: raimue@… added

As far as I see, this would be compatible to the existing moddate, so replacing it would be fine. There is only a small mistake in curl.c, where the declaration of function CurlModDateCmd does not match the definiton of CurlGetModDateCmd.

Otherwise, feel free to bring this to trunk/base with a corresponding ChangeLog entry.

Note: See TracTickets for help on using tickets.