Mon Oct 16 22:21:55 2023 UTC ()
lintpkgsrc, regress: update references to pkglint files

The source code of pkglint is no longer stored in pkgsrc itself.


(rillig)
diff -r1.12 -r1.13 pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t
diff -r1.3 -r1.4 pkgsrc/regress/plus_build_version/spec

cvs diff -r1.12 -r1.13 pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t (expand / switch to unified diff)

--- pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t 2022/08/13 12:22:20 1.12
+++ pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t 2023/10/16 22:21:55 1.13
@@ -1,30 +1,30 @@ @@ -1,30 +1,30 @@
1# $NetBSD: pkgversion.t,v 1.12 2022/08/13 12:22:20 rillig Exp $ 1# $NetBSD: pkgversion.t,v 1.13 2023/10/16 22:21:55 rillig Exp $
2# 2#
3# Tests for parsing and comparing package versions, such as 1.0nb4. 3# Tests for parsing and comparing package versions, such as 1.0nb4.
4 4
5use strict; 5use strict;
6use warnings; 6use warnings;
7use IO::Null; 7use IO::Null;
8use Test; 8use Test;
9 9
10BEGIN { plan tests => 1781, onfail => sub { die } } 10BEGIN { plan tests => 1781, onfail => sub { die } }
11 11
12require('../lintpkgsrc.pl'); 12require('../lintpkgsrc.pl');
13 13
14ok(pkgversion_cmp('3.4', '<', '3.4'), ''); 14ok(pkgversion_cmp('3.4', '<', '3.4'), '');
15ok(pkgversion_cmp('3.4', '<=', '3.4'), 1); 15ok(pkgversion_cmp('3.4', '<=', '3.4'), 1);
16 16
17# See pkgtools/pkglint/files/pkgver/vercmp_test.go. 17# See pkgtools/pkglint, file pkgver/vercmp_test.go.
18my @split_version_tests = ( 18my @split_version_tests = (
19 [ '5.0', [ [ 5, 0, 0 ], 0 ] ], 19 [ '5.0', [ [ 5, 0, 0 ], 0 ] ],
20 [ '5.0nb5', [ [ 5, 0, 0 ], 5 ] ], 20 [ '5.0nb5', [ [ 5, 0, 0 ], 5 ] ],
21 [ '0.0.1-SNAP', [ [ 0, 0, 0, 0, 1, 0, 19, 0, 14, 0, 1, 0, 16 ], 0 ] ], 21 [ '0.0.1-SNAP', [ [ 0, 0, 0, 0, 1, 0, 19, 0, 14, 0, 1, 0, 16 ], 0 ] ],
22 [ '1.0alpha3', [ [ 1, 0, 0, -3, 3 ], 0 ] ], 22 [ '1.0alpha3', [ [ 1, 0, 0, -3, 3 ], 0 ] ],
23 [ '1_0alpha3', [ [ 1, 0, 0, -3, 3 ], 0 ] ], 23 [ '1_0alpha3', [ [ 1, 0, 0, -3, 3 ], 0 ] ],
24 [ '2.5beta', [ [ 2, 0, 5, -2 ], 0 ] ], 24 [ '2.5beta', [ [ 2, 0, 5, -2 ], 0 ] ],
25 [ '20151110', [ [ 20151110 ], 0 ] ], 25 [ '20151110', [ [ 20151110 ], 0 ] ],
26 [ '0', [ [ 0 ], 0 ] ], 26 [ '0', [ [ 0 ], 0 ] ],
27 [ 'nb1', [ [], 1 ] ], 27 [ 'nb1', [ [], 1 ] ],
28 [ '1.0.1a', [ [ 1, 0, 0, 0, 1, 0, 1 ], 0 ] ], 28 [ '1.0.1a', [ [ 1, 0, 0, 0, 1, 0, 1 ], 0 ] ],
29 [ '1.1.1dnb2', [ [ 1, 0, 1, 0, 1, 0, 4 ], 2 ] ], 29 [ '1.1.1dnb2', [ [ 1, 0, 1, 0, 1, 0, 4 ], 2 ] ],
30 [ '1.0.1z', [ [ 1, 0, 0, 0, 1, 0, 26 ], 0 ] ], 30 [ '1.0.1z', [ [ 1, 0, 0, 0, 1, 0, 26 ], 0 ] ],
@@ -34,27 +34,27 @@ my @split_version_tests = ( @@ -34,27 +34,27 @@ my @split_version_tests = (
34 34
35foreach my $test (@split_version_tests) { 35foreach my $test (@split_version_tests) {
36 my ($version, $expected) = @$test; 36 my ($version, $expected) = @$test;
37 37
38 my @actual = split_pkgversion($version); 38 my @actual = split_pkgversion($version);
39 39
40 my @expected = ($expected->[1]); 40 my @expected = ($expected->[1]);
41 push(@expected, @{$expected->[0]}); 41 push(@expected, @{$expected->[0]});
42 my $actual_str = "$version: " . join(',', @actual); 42 my $actual_str = "$version: " . join(',', @actual);
43 my $expected_str = "$version: " . join(',', @expected); 43 my $expected_str = "$version: " . join(',', @expected);
44 ok($actual_str, $expected_str); 44 ok($actual_str, $expected_str);
45} 45}
46 46
47# See pkgtools/pkglint/files/pkgver/vercmp_test.go. 47# See pkgtools/pkglint, file pkgver/vercmp_test.go.
48my @versions = ( 48my @versions = (
49 [ '0pre20160620' ], 49 [ '0pre20160620' ],
50 [ '0' ], 50 [ '0' ],
51 [ '0nb1', '0NB1', '0Nb1', '0nb00001' ], 51 [ '0nb1', '0NB1', '0Nb1', '0nb00001' ],
52 [ '0.0.1-SNAPSHOT' ], 52 [ '0.0.1-SNAPSHOT' ],
53 [ '1.0alpha' ], 53 [ '1.0alpha' ],
54 [ '1.0alpha3' ], 54 [ '1.0alpha3' ],
55 [ '1', '1.0', '1.0.0' ], 55 [ '1', '1.0', '1.0.0' ],
56 [ '1.0nb1', '1nb1' ], 56 [ '1.0nb1', '1nb1' ],
57 [ '1.0nb2', '1_0nb2' ], 57 [ '1.0nb2', '1_0nb2' ],
58 [ '1.0.0.0.0.0.0.1' ], 58 [ '1.0.0.0.0.0.0.1' ],
59 [ '1.0.aa' ], 59 [ '1.0.aa' ],
60 [ '1.0.a1' ], 60 [ '1.0.a1' ],

cvs diff -r1.3 -r1.4 pkgsrc/regress/plus_build_version/spec (expand / switch to unified diff)

--- pkgsrc/regress/plus_build_version/spec 2020/05/19 05:02:42 1.3
+++ pkgsrc/regress/plus_build_version/spec 2023/10/16 22:21:55 1.4
@@ -1,38 +1,38 @@ @@ -1,38 +1,38 @@
1#! /bin/sh 1#! /bin/sh
2# $NetBSD: spec,v 1.3 2020/05/19 05:02:42 rillig Exp $ 2# $NetBSD: spec,v 1.4 2023/10/16 22:21:55 rillig Exp $
3 3
4# This test demonstrates how the RCS Ids from the package files end up in 4# This test demonstrates how the RCS Ids from the package files end up in
5# the +BUILD_VERSION file of the binary package. 5# the +BUILD_VERSION file of the binary package.
6# 6#
7# There are several places in pkgsrc that make use of these RCS Ids: 7# There are several places in pkgsrc that make use of these RCS Ids:
8# 8#
9# mk/checksum/checksum, search for "NetBSD": 9# mk/checksum/checksum, search for "NetBSD":
10# When computing the SHA1 hash for a patch file (before it is applied 10# When computing the SHA1 hash for a patch file (before it is applied
11# to the extracted distfile), the RCS Id lines are ignored. 11# to the extracted distfile), the RCS Id lines are ignored.
12# 12#
13# mk/checksum/distinfo.awk, function patchsum: 13# mk/checksum/distinfo.awk, function patchsum:
14# When generating the patches part of the distinfo file. 14# When generating the patches part of the distinfo file.
15# Same as in mk/checksum/checksum. 15# Same as in mk/checksum/checksum.
16# 16#
17# mk/pkgformat/pkg/metadata.mk, search for "NetBSD": 17# mk/pkgformat/pkg/metadata.mk, search for "NetBSD":
18# The RCS Ids end up in the +BUILD_VERSION of the binary package. 18# The RCS Ids end up in the +BUILD_VERSION of the binary package.
19# 19#
20# pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date, search for "NetBSD": 20# pkgtools/pbulk/files/pbulk/scripts/pkg-up-to-date, search for "NetBSD":
21# RCS Ids from the source package are extracted and then compared 21# RCS Ids from the source package are extracted and then compared
22# to the RCS Ids from the binary package, to see whether the package 22# to the RCS Ids from the binary package, to see whether the package
23# needs to be built again. 23# needs to be built again.
24# 24#
25# pkgtools/pkglint/files/distinfo.go, function computePatchSha1Hex: 25# pkgtools/pkglint, file distinfo.go, function computePatchSha1Hex:
26# Same as mk/checksum/checksum. 26# Same as mk/checksum/checksum.
27# 27#
28# All these places must use the same patterns for extracting the RCS Ids. 28# All these places must use the same patterns for extracting the RCS Ids.
29 29
30set -u 30set -u
31 31
32tmpdir="${TMPDIR-/tmp}/plus-build-version" 32tmpdir="${TMPDIR-/tmp}/plus-build-version"
33actual="$tmpdir/.pkgdb/+BUILD_VERSION" 33actual="$tmpdir/.pkgdb/+BUILD_VERSION"
34 34
35do_test() { 35do_test() {
36 rm -rf "$tmpdir" 36 rm -rf "$tmpdir"
37 mkdir -p "$tmpdir/.pkgdb" 37 mkdir -p "$tmpdir/.pkgdb"
38 $TEST_MAKE \ 38 $TEST_MAKE \