pkgtools/check-portability: update to 20.1.1 Changes since 20.1.0: Fixed off-by-one error in diagnostic for test ==.diff -r1.9 -r1.10 pkgsrc/pkgtools/check-portability/Makefile
(rillig)
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | # $NetBSD: Makefile,v 1.9 2020/04/19 12:05:14 rillig Exp $ | 1 | # $NetBSD: Makefile,v 1.10 2020/05/23 22:18:10 rillig Exp $ | |
2 | 2 | |||
3 | PKGNAME= check-portability-20.1.0 | 3 | PKGNAME= check-portability-20.1.1 | |
4 | CATEGORIES= pkgtools | 4 | CATEGORIES= pkgtools | |
5 | DISTFILES= # none | 5 | DISTFILES= # none | |
6 | 6 | |||
7 | MAINTAINER= rillig@NetBSD.org | 7 | MAINTAINER= rillig@NetBSD.org | |
8 | HOMEPAGE= # none | 8 | HOMEPAGE= # none | |
9 | COMMENT= Check extracted files for typical portability issues | 9 | COMMENT= Check extracted files for typical portability issues | |
10 | LICENSE= 2-clause-bsd | 10 | LICENSE= 2-clause-bsd | |
11 | 11 | |||
12 | USE_TOOLS+= cp | 12 | USE_TOOLS+= cp | |
13 | CHECK_PORTABILITY_SKIP= * # avoid circular dependency | 13 | CHECK_PORTABILITY_SKIP= * # avoid circular dependency | |
14 | CHECK_PERMS_SKIP= * # avoid circular dependency | 14 | CHECK_PERMS_SKIP= * # avoid circular dependency | |
15 | USE_LANGUAGES= c99 | 15 | USE_LANGUAGES= c99 | |
16 | USE_BSD_MAKEFILE= yes | 16 | USE_BSD_MAKEFILE= yes |
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: check-portability.c,v 1.15 2020/05/23 22:12:31 rillig Exp $ */ | 1 | /* $NetBSD: check-portability.c,v 1.16 2020/05/23 22:18:11 rillig Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | Copyright (c) 2020 Roland Illig | 4 | Copyright (c) 2020 Roland Illig | |
5 | All rights reserved. | 5 | All rights reserved. | |
6 | 6 | |||
7 | Redistribution and use in source and binary forms, with or without | 7 | Redistribution and use in source and binary forms, with or without | |
8 | modification, are permitted provided that the following conditions | 8 | modification, are permitted provided that the following conditions | |
9 | are met: | 9 | are met: | |
10 | 10 | |||
11 | 1. Redistributions of source code must retain the above copyright | 11 | 1. Redistributions of source code must retain the above copyright | |
12 | notice, this list of conditions and the following disclaimer. | 12 | notice, this list of conditions and the following disclaimer. | |
13 | 2. Redistributions in binary form must reproduce the above copyright | 13 | 2. Redistributions in binary form must reproduce the above copyright | |
14 | notice, this list of conditions and the following disclaimer in the | 14 | notice, this list of conditions and the following disclaimer in the | |
@@ -391,27 +391,27 @@ checkline_sh_dollar_random(cstr filename | @@ -391,27 +391,27 @@ checkline_sh_dollar_random(cstr filename | |||
391 | 391 | |||
392 | struct checkline_sh_test_eqeq_actiondata { | 392 | struct checkline_sh_test_eqeq_actiondata { | |
393 | cstr filename; | 393 | cstr filename; | |
394 | size_t lineno; | 394 | size_t lineno; | |
395 | cstr line; | 395 | cstr line; | |
396 | }; | 396 | }; | |
397 | 397 | |||
398 | static void | 398 | static void | |
399 | checkline_sh_test_eqeq_error( | 399 | checkline_sh_test_eqeq_error( | |
400 | cstr filename, cstr line, size_t lineno, size_t column) | 400 | cstr filename, cstr line, size_t lineno, size_t column) | |
401 | { | 401 | { | |
402 | printf( | 402 | printf( | |
403 | "%s:%zu:%zu: found test ... == ...: %s\n", | 403 | "%s:%zu:%zu: found test ... == ...: %s\n", | |
404 | cstr_charptr(filename), lineno, column, cstr_charptr(line)); | 404 | cstr_charptr(filename), lineno, column + 1, cstr_charptr(line)); | |
405 | nerrors++; | 405 | nerrors++; | |
406 | explain( | 406 | explain( | |
407 | W_test_eqeq, | 407 | W_test_eqeq, | |
408 | "The \"test\" command, as well as the \"[\" command, are not required to know", | 408 | "The \"test\" command, as well as the \"[\" command, are not required to know", | |
409 | "the \"==\" operator. Only a few implementations like bash and some", | 409 | "the \"==\" operator. Only a few implementations like bash and some", | |
410 | "versions of ksh support it.", | 410 | "versions of ksh support it.", | |
411 | "", | 411 | "", | |
412 | "When you run \"test foo == foo\" on a platform that does not support the", | 412 | "When you run \"test foo == foo\" on a platform that does not support the", | |
413 | "\"==\" operator, the result will be \"false\" instead of \"true\". This can", | 413 | "\"==\" operator, the result will be \"false\" instead of \"true\". This can", | |
414 | "lead to unexpected behavior.", | 414 | "lead to unexpected behavior.", | |
415 | nullptr); | 415 | nullptr); | |
416 | explain_how_to_fix(); | 416 | explain_how_to_fix(); | |
417 | } | 417 | } |
@@ -13,33 +13,33 @@ files/testdata/Makefile.am:7:5: double b | @@ -13,33 +13,33 @@ files/testdata/Makefile.am:7:5: double b | |||
13 | for the package to build. Then choose any of these variants: | 13 | for the package to build. Then choose any of these variants: | |
14 | 14 | |||
15 | 1. Add a patch for the file | 15 | 1. Add a patch for the file | |
16 | (see https://www.netbsd.org/docs/pkgsrc/pkgsrc.html#components.patches) | 16 | (see https://www.netbsd.org/docs/pkgsrc/pkgsrc.html#components.patches) | |
17 | 2. Add a SUBST block for the file to the package Makefile | 17 | 2. Add a SUBST block for the file to the package Makefile | |
18 | (see mk/subst.mk) | 18 | (see mk/subst.mk) | |
19 | 3. Add CHECK_PORTABILITY_SKIP+= shell/glob to the package Makefile | 19 | 3. Add CHECK_PORTABILITY_SKIP+= shell/glob to the package Makefile | |
20 | (see mk/check/check-portability.mk) | 20 | (see mk/check/check-portability.mk) | |
21 | 21 | |||
22 | files/testdata/Makefile.am:8:5: double brackets: if [[ ${COND} ]] || [[ $(COND) ]]; then :; fi | 22 | files/testdata/Makefile.am:8:5: double brackets: if [[ ${COND} ]] || [[ $(COND) ]]; then :; fi | |
23 | files/testdata/double-brackets:8:4: double brackets: if [[ test ]]; then | 23 | files/testdata/double-brackets:8:4: double brackets: if [[ test ]]; then | |
24 | files/testdata/double-brackets:10:1: double brackets: [[ test ]] | 24 | files/testdata/double-brackets:10:1: double brackets: [[ test ]] | |
25 | files/testdata/double-brackets:12:1: double brackets: [[ test ]] || echo | 25 | files/testdata/double-brackets:12:1: double brackets: [[ test ]] || echo | |
26 | files/testdata/env-sh:8:4: found test ... == ...: [ a == b ] | 26 | files/testdata/env-sh:8:5: found test ... == ...: [ a == b ] | |
27 | 27 | |||
28 | The "test" command, as well as the "[" command, are not required to know | 28 | The "test" command, as well as the "[" command, are not required to know | |
29 | the "==" operator. Only a few implementations like bash and some | 29 | the "==" operator. Only a few implementations like bash and some | |
30 | versions of ksh support it. | 30 | versions of ksh support it. | |
31 | 31 | |||
32 | When you run "test foo == foo" on a platform that does not support the | 32 | When you run "test foo == foo" on a platform that does not support the | |
33 | "==" operator, the result will be "false" instead of "true". This can | 33 | "==" operator, the result will be "false" instead of "true". This can | |
34 | lead to unexpected behavior. | 34 | lead to unexpected behavior. | |
35 | 35 | |||
36 | files/testdata/random:7:1: $RANDOM: $RANDOM | 36 | files/testdata/random:7:1: $RANDOM: $RANDOM | |
37 | 37 | |||
38 | The variable $RANDOM is not required for a POSIX-conforming shell, and | 38 | The variable $RANDOM is not required for a POSIX-conforming shell, and | |
39 | many implementations of /bin/sh do not support it. It should therefore | 39 | many implementations of /bin/sh do not support it. It should therefore | |
40 | not be used in shell programs that are meant to be portable across a | 40 | not be used in shell programs that are meant to be portable across a | |
41 | large number of POSIX-like systems. | 41 | large number of POSIX-like systems. | |
42 | 42 | |||
43 | files/testdata/test-eqeq:7:7: found test ... == ...: test a == b # bad | 43 | files/testdata/test-eqeq:7:8: found test ... == ...: test a == b # bad | |
44 | files/testdata/test-eqeq:10:4: found test ... == ...: [ a == b ] # bad | 44 | files/testdata/test-eqeq:10:5: found test ... == ...: [ a == b ] # bad | |
45 | files/testdata/test-eqeq:14:4: found test ... == ...: [ a == b -a c == d ] | 45 | files/testdata/test-eqeq:14:5: found test ... == ...: [ a == b -a c == d ] |