Opened 15 years ago

Closed 9 years ago

Last modified 7 years ago

#17041 closed enhancement (fixed)

meaning of livecheck results should be made clearer

Reported by: dbevans (David B. Evans) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.3.5
Component: base Version: 1.7.0
Keywords: Cc: blb@…, ryandesign (Ryan Carsten Schmidt)
Port:

Description

Using MacPorts installed from latest trunk:

port -d livecheck glibmm
DEBUG: Port (livecheck) version is 2.18.1
DEBUG: Fetching http://freshmeat.net/projects-xml/glibmm/glibmm.xml
DEBUG: The regex is "<latest_release_version>(.*)</latest_release_version>"
DEBUG: The regex matched "<latest_release_version>2.14.2</latest_release_version>", extracted "2.14.2"
glibmm seems to have been updated (port version: 2.18.1, new version: 2.14.2)

In this case, the current port version is 2.18.1 but freshmeat is not up to date and the latest version on record there is 2.14.2.

Livecheck assumes that the latest version from freshmeat is, in fact, the latest version of the port and declares it so after only checking to see that the freshmeat version is not equal to the port version.

In this case, I believe livecheck should check to see that the port version is greater than the freshmeat latest version and therefore the port seems to be up to date.

In otherwords, the highest version from the livecheck URL should be considered a new version only if it is greater than the port version.

Have only observed this when freshmeat is selected by default due to no explicit livecheck declarations as in glibmm but it occurs in several instances (freshmeat doesn't seem to be very good at keeping up to date). So can't say whether this faulty comparison occurs with any other livecheck URLs in similar circumstances.

Attachments (1)

patch-portlivecheck.tcl.diff (1.8 KB) - added by dbevans (David B. Evans) 15 years ago.
Patch for portlivecheck.tcl

Download all attachments as: .zip

Change History (14)

comment:1 Changed 15 years ago by jmroot (Joshua Root)

Milestone: Port BugsMacPorts base bugs

comment:2 Changed 15 years ago by dbevans (David B. Evans)

Summary: port livecheck using default freshmeat URL can make faulty version comparisonport livecheck makes faulty version comparison

It appears this happens independently of the livecheck.url (not just freshmeat).

For example

$ port -d livecheck gtkimageview
DEBUG: Executing org.macports.livecheck (gtkimageview)
DEBUG: Portfile modification date is Wed Nov 05 15:48:03 PST 2008
DEBUG: Port (livecheck) version is 1.6.2
DEBUG: Fetching http://trac.bjourne.webfactional.com/
DEBUG: The regex is "gtkimageview-(\d+(?:\.\d+)*).tar.gz"
DEBUG: The regex matched "gtkimageview-1.0.0.tar.gz", extracted "1.0.0"
gtkimageview seems to have been updated (port version: 1.6.2, new version: 1.0.0)

comment:3 Changed 15 years ago by dbevans (David B. Evans)

Although Portfile livecheck has been fixed for the two examples above the comparison problem in base remains.

The attached patch to portlivecheck.tcl fixes the problem for both the regex and regexm cases.

To illustrate using geneweb as my new example,

port -d livecheck geneweb
DEBUG: Found port in file:///opt/macports/trunk/dports/genealogy/geneweb
DEBUG: Changing to port directory: /opt/macports/trunk/dports/genealogy/geneweb
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant powerpc is not provided by port geneweb.
DEBUG: Requested variant darwin is not provided by port geneweb.
DEBUG: Requested variant no_x11 is not provided by port geneweb.
DEBUG: Requested variant macosx is not provided by port geneweb.
DEBUG: Executing org.macports.main (geneweb)
DEBUG: Executing org.macports.livecheck (geneweb)
DEBUG: Portfile modification date is Thu Oct 09 15:43:57 PDT 2008
DEBUG: Port (livecheck) version is 5.01
DEBUG: Fetching http://freshmeat.net/projects-xml/geneweb/geneweb.xml
DEBUG: The regex is "<latest_release_version>(.*)</latest_release_version>"
DEBUG: The regex matched "<latest_release_version>4.09</latest_release_version>", extracted "4.09"
geneweb seems to have been updated (port version: 5.01, new version: 4.09)

which is not correct. After the patch,

port -d livecheck geneweb
DEBUG: Found port in file:///opt/macports/trunk/dports//genealogy/geneweb
DEBUG: Changing to port directory: /opt/macports/trunk/dports/genealogy/geneweb
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant powerpc is not provided by port geneweb.
DEBUG: Requested variant darwin is not provided by port geneweb.
DEBUG: Requested variant macosx is not provided by port geneweb.
DEBUG: Executing org.macports.main (geneweb)
DEBUG: Executing org.macports.livecheck (geneweb)
DEBUG: Portfile modification date is Thu Oct 09 15:43:57 PDT 2008
DEBUG: Port (livecheck) version is 5.01
DEBUG: Fetching http://freshmeat.net/projects-xml/geneweb/geneweb.xml
DEBUG: The regex is "<latest_release_version>(.*)</latest_release_version>"
DEBUG: The regex matched "<latest_release_version>4.09</latest_release_version>", extracted "4.09"
DEBUG: Livecheck version "5.01" is newer than or equal to extracted version "4.09"
geneweb seems to be up to date

which is correct. A test case for the situation where an update is required is lifelines

port -d livecheck lifelines
DEBUG: Found port in file:///opt/macports/trunk/dports//genealogy/lifelines
DEBUG: Changing to port directory: /opt/macports/trunk/dports/genealogy/lifelines
DEBUG: setting option os.universal_supported to yes
DEBUG: org.macports.load registered provides 'load', a pre-existing procedure. Target override will not be provided
DEBUG: org.macports.distfiles registered provides 'distfiles', a pre-existing procedure. Target override will not be provided
DEBUG: adding the default universal variant
DEBUG: Requested variant powerpc is not provided by port lifelines.
DEBUG: Requested variant darwin is not provided by port lifelines.
DEBUG: Requested variant macosx is not provided by port lifelines.
DEBUG: Executing org.macports.main (lifelines)
DEBUG: Executing org.macports.livecheck (lifelines)
DEBUG: Portfile modification date is Thu Oct 09 15:43:57 PDT 2008
DEBUG: Port (livecheck) version is 3.0.46.1
DEBUG: Fetching http://sourceforge.net/export/rss2_projfiles.php?project=lifelines
DEBUG: The regex is "<title>lifelines (.*) released.*</title>"
DEBUG: The regex matched "<title>lifelines 3.0.62 released (Sat, 06 Oct 2007 22:02:33 GMT)</title>", extracted "3.0.62"
DEBUG: The regex matched "<title>lifelines 3.0.61 released (Wed, 08 Aug 2007 14:38:03 GMT)</title>", extracted "3.0.61"
DEBUG: The regex matched "<title>lifelines 3.0.60 released (Fri, 06 Jul 2007 22:23:48 GMT)</title>", extracted "3.0.60"
DEBUG: The regex matched "<title>lifelines 3.0.59 released (Fri, 11 May 2007 19:39:36 GMT)</title>", extracted "3.0.59"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.58 released (Sun, 06 May 2007 23:34:25 GMT)</title>", extracted "beta versions 3.0.58"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.57 released (Sun, 22 Apr 2007 19:47:44 GMT)</title>", extracted "beta versions 3.0.57"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.56 released (Thu, 19 Apr 2007 21:53:27 GMT)</title>", extracted "beta versions 3.0.56"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.55 released (Fri, 13 Apr 2007 22:21:46 GMT)</title>", extracted "beta versions 3.0.55"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.54 released (Tue, 10 Apr 2007 01:26:34 GMT)</title>", extracted "beta versions 3.0.54"
DEBUG: The regex matched "<title>lifelines beta versions 3.0.53 released (Wed, 04 Apr 2007 23:34:14 GMT)</title>", extracted "beta versions 3.0.53"
DEBUG: Extracted version "3.0.62" is newer than livecheck version "3.0.46.1"
lifelines seems to have been updated (port version: 3.0.46.1, new version: 3.0.62)

which is correct.

I don't think this is a risky change but since this is my first effort at mucking around with base files, I'd appreciate it if someone with more experience would review this fix prior to committing to svn.

Thanks

comment:4 Changed 15 years ago by dbevans (David B. Evans)

Cc: blb@… ryandesign@… added

Changed 15 years ago by dbevans (David B. Evans)

Patch for portlivecheck.tcl

comment:5 Changed 15 years ago by dbevans (David B. Evans)

Please review for commit to base for MacPorts 1.7.0.

comment:6 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

I don't think we want this change. If the port version is newer than the version on the livecheck page, then the livecheck page is looking at outdated information, and should be changed to point to up-to-date information. For example, don't use freshmeat for that port; use the software's distfile directory listing perhaps. If we add this patch, somebody using livecheck on this port might never realize the data source is not current, and might never learn of new versions of the software.

Another situation which occurs from time to time is that the project of a certain name on freshmeat is not the same software as the one in the port. Sometimes there are multiple unrelated software projects of the same name. In that case, if the version of the software in the port happens to be newer than the version of the other software by that name on freshmeat, then again someone using livecheck might never learn of newer versions.

comment:7 Changed 15 years ago by pguyot (Paul Guyot)

Exactly. As the original designer of the livecheck feature, I did not want to compare version at all except for equality. At some point, version ordering was introduced, but this masks other problem in the livecheck configuration (the source may be incorrect or outdated as Ryan suggests).

What could be changed is the error message so it makes more sense (glibmm seems to be updated (port version: 2.18.2; livecheck version: 2.14.2). Please note that freshmeat is just one of the sensible default values, because we need good default sources for livecheck adoption. In the case of glibmm, the solution is to use another source, e.g. the home page with a good regex.

comment:8 Changed 15 years ago by dbevans (David B. Evans)

Yes, I agree that when this happens, it is largely due to an inappropriate choice of livecheck source/parameters/whatever and in light of these comments I see that I was responding to the inappropriateness of the conclusion expressed (looks like port is updated).

My is that if the latest version from the livecheck source and current version are not equal then there are (at least) two possible causes. One is that the port needs updating but the other is that its the livecheck source/regex that is not up to date, incorrect and this should be reported appropriately. "Somethings wrong with your livecheck."

I don't know how to do this without using a version comparison rather than an equality check.

Agreed that there aren't enough good livecheck defaults built in. Particularly fresh-meat isn't very good as a last ditch effort as they are frequently not up to date.

Maybe have a default livecheck for a site that is not in a list of know sources is not a good idea. In this case, perhaps lint should complain that you don't have a valid livecheck.

The more often port has a appropriate livecheck definition included then the less often this sort of problem will occur.

comment:9 Changed 15 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:10 Changed 15 years ago by jmroot (Joshua Root)

Summary: port livecheck makes faulty version comparisonmeaning of livecheck results should be made clearer
Type: defectenhancement

comment:11 Changed 15 years ago by dbevans (David B. Evans)

OK, so just for interest what is the meaning of livecheck?

comment:12 Changed 9 years ago by jmroot (Joshua Root)

Keywords: livecheck removed
Resolution: fixed
Status: newclosed

comment:13 Changed 7 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.3.5
Note: See TracTickets for help on using tickets.