Bug 253876 - ports-mgmt/portlint: portlint doesn't warn when new version goes backwards
Summary: ports-mgmt/portlint: portlint doesn't warn when new version goes backwards
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-26 16:38 UTC by Yuri Victorovich
Modified: 2021-02-27 04:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (marcus)


Attachments
run.sh (170 bytes, application/x-shellscript)
2021-02-26 16:38 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2021-02-26 16:38:34 UTC
Created attachment 222849 [details]
run.sh

Testcase: math/py-osqp update between r566579 and r566580.

Please run the attached run.sh:
> $ sh run.sh 
> Updating '.':
> U    Makefile
> U    distinfo
> Updated to revision 566580.
> Updating '.':
> U    Makefile
> U    distinfo
> Updated to revision 566579.
> ===>  License APACHE20 accepted by the user
> ===>  License APACHE20 accepted by the user
> ===>   py37-osqp-0.6.2.p0 depends on file: /usr/local/sbin/pkg - found
> ===> Fetching all distfiles required by py37-osqp-0.6.2.p0 for building
> looks fine.

portlint says "looks fine." when the version goes backwards:
> $ pkg version -t 0.6.2 0.6.2.post0
> >
Comment 1 Tatsuki Makino 2021-02-26 23:13:28 UTC
(In reply to Yuri Victorovich from comment #0)

If we need it, we need a code the size of poudriere, I think :)
Comment 2 Yuri Victorovich freebsd_committer 2021-02-26 23:29:13 UTC
(In reply to Tatsuki Makino from comment #1)

> If we need it, we need a code the size of poudriere, I think :)

I have a vague memory that portlint used to warn about version going backwards. 

It's just one pkg command invocation.
Comment 3 Tatsuki Makino 2021-02-27 00:18:43 UTC
(In reply to Yuri Victorovich from comment #2)

I didn't know that such a function existed :)

< > symbols are hard to understand, so I ran it as root :)

# pkg version -t 0.6.1 0.6.2.p0
<
# pkg version -t 0.6.2 0.6.2.p0
>
# pkg version -t 0.6.3 0.6.2.p0
>

Isn't pkg version returning wrong result?
Comment 4 Yuri Victorovich freebsd_committer 2021-02-27 00:59:27 UTC
(In reply to Tatsuki Makino from comment #3)

It could be. I don't know how is this comparison defined.
Comment 5 Tatsuki Makino 2021-02-27 01:21:16 UTC
(In reply to Yuri Victorovich from comment #4)

Example 5.1 of Porter's Handbook says a bit about it.
pkg-1.16.3/libpkg/pkg_version.c takes care of that.

Doesn't this mean that DISTVERSION=0.6.2.post0 is being rewritten as 0.6.2.p0 and treated as a 0.6.2 pre-release 0?

0.6.2 pre-release 0 < 0.6.2 is correct.
Comment 6 Tatsuki Makino 2021-02-27 04:52:41 UTC
Would you like to have the following in portlint?

print qq(some information to explain the inclusion of characters that lower the priority\n) if $newversion =~ m/(^|\.)[A-Za-z]/;