On Wed, June 1, 2011 14:25, Kai Wasserbäch wrote:
> while writing a watch file for kernel.org for my own use, I discovered,
> that uscan sets newest_dir apparently not to the latest matching
> version, but to the first match. This leads to the problem, that uscan
> checks the v1.0 directory (for kernel.org) instead of v3.0.
>
> Please see the attached watch file for a test case and the debug output
> for the results.
>
> Thank you in advance for fixing this problem.

So far as I can see, there are a few reasons that your watch file doesn't
work as you expect, and none of them is a bug in uscan.

Firstly, your directory pattern is "v(?:[\d\.]+)".  The "?:" makes the
group non-matching and thus the only part of the directory which is
actually relevant is the "v".  uscan is being asked to sort a series of
"v"s and the list as returned by the server already fulfills that
criteria.

The directory string you want to match also includes the "v", i.e.
"(v[\d\.]+)". Removing the "?:" and putting the parentheses in the correct
location gives the expected result:

-- Found the following matching hrefs (newest first):
     v3.0/
     v2.6/
     v2.5/
[...]

Secondly, there are no patch-*.bz2 files under the "3.0" directory, but
two directories - "snapshots" and "testing".  Further, even those
directories don't contain files that match "patch-([\d\.]+)\.bz2", due to
the inclusion of strings such as "-rc1-git2".

Might I suggest something along the lines of the following?

http://www.kernel.org/pub/linux/kernel/(v[\d\.]+)/snapshots/patch-(.+?)\.bz2

That gives me:

-- Found the following matching hrefs:
     patch-3.0-rc1-git1.bz2
     patch-3.0-rc1-git2.bz2
Newest version on remote site is 3.0-rc1-git2, local version is 0
 => Newer version available from
    http://www.kernel.org/pub/linux/kernel/v3.0/snapshots/patch-3.0-rc1-git2.bz2

Regards,

Adam





-- 
To unsubscribe, send mail to [email protected].

Reply via email to