The NetBSD Project

CVS log for pkgsrc/pkgtools/pkglint/files/redundantscope_test.go

[BACK] Up to [] / pkgsrc / pkgtools / pkglint / files

Request diff between arbitrary revisions

Default branch: MAIN

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jul 22 19:26:30 2020 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, HEAD
Changes since 1.17: +19 -24 lines
Diff to previous 1.17 (colored)

pkgtools/pkglint: update to 20.2.2

Changes since 20.2.1:

Emit notes about redundant != assignments, as well as those that
overwrite each other.

For packages that set DISTINFO_FILE to their own distinfo file, don't
check that file twice.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jun 12 19:14:45 2020 UTC (12 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2
Changes since 1.16: +1 -0 lines
Diff to previous 1.16 (colored)

pkgtools/pkglint: update to 20.1.16

Changes since 20.1.15:

When a package adds an additional version requirement for another
package, it must do so using BUILDLINK_API_DEPENDS instead of
BUILDLINK_ABI_DEPENDS.  Most packages already do this.

When a values is appended to an undefined variable using the += operator,
bmake does not add a space before, and pkglint caught up to do the same.
This change has no practical consequences though.

As always, a bit of refactoring.  The method names of MkAssignChecker
contained the redundant word "varassign".

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jun 7 15:49:23 2020 UTC (12 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.15: +24 -0 lines
Diff to previous 1.15 (colored)

pkgtools/pkglint: update to 20.1.15

Changes since 20.1.14:

Fix confusing wording of diagnostic "should contain text".  It's more
precise to say "this line should consist of this text".  Otherwise it's
too easy to interpret it as "the text should occur somewhere in the

Allow BUILDLINK_PREFIX.* to be used in helper files.  Especially for
programming language packages, files like often include and therefore may refer to the BUILDLINK_PREFIX of this

Warn about redundant BUILDLINK_API_VERSION restrictions.  Previously, the
check had only been enabled if the operators from the default dependency
pattern ( and the additional dependency pattern (package)
used the same operators, which already covered most practical cases.

Determine SuSE versions from the pkgsrc tree.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Apr 13 19:46:44 2020 UTC (14 months ago) by rillig
Branch: MAIN
Changes since 1.14: +110 -0 lines
Diff to previous 1.14 (colored)

pkgtools/pkglint: update to 20.1.2

Changes since 20.1.1:

Ensure that relative paths to other packages have the canonical form

Add notes about pathname patters that mention ${WRKSRC} even though they
are already defined to be relative to WRKSRC.

Fix check for redundantly added categories. The check had previously
reported that the included file would be redundant, which was wrong.
It's always the including file that provides the redundancy.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Feb 15 13:48:40 2020 UTC (16 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2020Q1-base, pkgsrc-2020Q1
Changes since 1.13: +1 -1 lines
Diff to previous 1.13 (colored)

pkgtools/pkglint: update to 19.4.8

Changes since 19.4.7:

The diagnostic for homepages using FTP is simpler now.

When running pkglint recursively on the top-level directory, the
inter-package checks (distfile hashes, unused licenses) are enabled
implicitly. This way, the only effect of the -Cglobal option is now
whether the pkgsrc infrastructure files are checked as well.

The check for removed packages that have not been recorded in
doc/CHANGES prints the correct lines when pkglint is run with the
--source option.

Fatal technical errors are no longer treated as diagnostics since they
are none. That was an early conceptual mistake, but since these fatal
error didn't happen often, it didn't matter.

In diagnostics, when referring to other lines, the previously used words
before/after have been replaced with above/below to avoid any confusion
whether space or time is meant.

In CONF_FILES, spaces and quotes are allowed.

Fixed unintended side-effects when running pkglint --autofix --only.
Before, all fixes were applied to the file, whether or not they matched
the --only option.

Fixed resolution of relative paths of the form ../../category/package
when they appeared in an infrastructure file.

Lots of refactorings and housekeeping, as usual.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 5 04:09:00 2020 UTC (16 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.12: +1 -4 lines
Diff to previous 1.12 (colored)

pkgtools/pkglint: update to 19.4.7

Changes since 19.4.6:

HOMEPAGE definitions that use http no longer get a warning that they
should migrate to https. Those that could be migrated have been migrated,
and the remaining homepages are not yet ready, so there's no benefit in
having this warning by default. Only in --network mode and when the https
site is indeed reachable, the warning is shown.

In long continued lines, the continuation backslash should be preceded by
a single space. Pkglint had wrongly removed that space in a few cases

Revision 1.12 / (download) - annotate - [select for diffs], Mon Dec 30 16:27:13 2019 UTC (17 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.11: +13 -5 lines
Diff to previous 1.11 (colored)

pkgtools/pkglint: update to 19.4.0

Changes since 19.3.19:

Empty PLIST files now generate an error instead of a warning since there
is no reason for having these empty files.

If a follow-up line in a Makefile is completely empty, there is no note
about trailing whitespace anymore since the warning about the misleading
empty line already covers this case.

The remaining code changes are only refactorings.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Dec 13 01:39:23 2019 UTC (18 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q4-base, pkgsrc-2019Q4
Changes since 1.10: +1 -1 lines
Diff to previous 1.10 (colored)

pkgtools/pkglint: update to 19.3.17

Changes since 19.3.16:

Pkglint now handles SUBST blocks correctly, even those in which some of
the variables are defined conditionally. It correctly reports those that
are missing in at least one of the possible branches.

PKG_JVM is no longer marked as deprecated. It was once package-settable.
Since 2002 it is system-provided, and the package-settable counterpart
is PKG_JVM_DEFAULT. This does not fit into pkglint's simple model of
deprecating variables since the variable name is still valid, it should
just not be defined by packages anymore.

The alignment of variable assignments has been fixed in some edge cases.
In continuation lines where the backslash is beyond column 72, the
whitespace before the continuation backslash is fixed to a single space.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Dec 8 00:06:38 2019 UTC (18 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.9: +62 -5 lines
Diff to previous 1.9 (colored)

pkgtools/pkglint: update to 19.3.14

Changes since 19.3.13:

When pkglint suggests to replace !empty(VARNAME:Mfixed) with ${VARNAME}
== fixed, the exact suggested expression is now part of the diagnostic.
The check and the autofix have been improved. They now apply only to the
last modifier in the whole chain, everything else was a bug in pkglint.

Pkglint now knows the scope of variables better than before. It knows
the difference between variables from <> like MACHINE_ARCH, which
are always in scope, and those from mk/defaults/mk.conf, which only come
into scope later, after has been included. It warns when
variables are used too early, for example in .if conditions.

The pathnames in ALTERNATIVES files are now checked for absolute
pathnames. This mistake doesn't happen in practice, but the code for
converting the different path types internally made it necessary to add
these checks. At least this prevents typos.

The special check for obsolete licenses has been removed since their
license files have been removed and that is checked as well.

Variables named *_AWK may be appended to.

The variables _PKG_SILENT and _PKG_DEBUG are no longer deprecated, they
are obsolete now. They are not used in main pkgsrc and pkgsrc-wip

When a package sets a default value for a user-settable variable (which
is something that should not happen anyway), it should .include before, in order to not accidentally overwrite the
user-specified value.

Variable modifiers of the form :from=to are now parsed like in bmake.
They are greedy and eat up any following colons as well. This means that
${VAR:.c=.o:Q} replaces source.c with source.o:Q, instead of quoting it.
Pkglint now warns about such cases.

The handling of relative paths in diagnostics is now consistent. All
paths that are part of a diagnostic are relative to the line that issues
the diagnostic.

Fatal errors are no longer suppressed in --autofix mode.

Plus lots of refactoring, to prevent accidental mixing of incompatible
relative paths.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 2 23:32:09 2019 UTC (18 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

pkgtools/pkglint: update to 19.3.13

Changes since 19.3.12:

The command line option -Wspace has been removed. Warnings and notes
about whitespace are now generated by default and cannot be switched
off. This is to ensure a consistent visual appearance of the package

Shell programs that are indented unnecessarily deep generate a note by
default now. Before, the option -Wall was necessary to get these notes.

The check for unintended comments in multi-line shell programs is now
enabled again. It had been disabled some time ago as byproduct of a bug
fix in the shell parser.

The check for unique buildlink3 package identifiers now also works if
pkglint is run from a package directory instead of the pkgsrc root

Revision 1.8 / (download) - annotate - [select for diffs], Sat Nov 23 23:35:56 2019 UTC (18 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

pkgtools/pkglint: update to 19.3.10

Changes since 19.3.9:

In diagnostics for suggested package updates, the exact line of doc/TODO
is mentioned. If a suggested update has an additional comment, the
brackets around that comment are not output anymore.

The check for defined but not used variables has been improved for the
edge case of defining a variable in the package Makefile and using it
in the file of the same package, which just doesn't work.

Makefile fragments in patches/ directories are now completely ignored.
It was a hypothetical case anyway.

Comparing PKGSRC_COMPILER using the == or != operators is now considered
an error instead of a warning. The common cases can be autofixed.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Nov 17 01:26:25 2019 UTC (18 months, 4 weeks ago) by rillig
Branch: MAIN
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored)

pkgtools/pkglint: update to 19.3.7

Changes since 19.3.6:

Improved variable value alignment.

Fixed wrong warning about comment lines that were interpreted as shell
commands before.

Warn when the first category of a package doesn't correspond to the
path in the filesystem. This affects 603 packages.

No longer warn about deprecated BUILDLINK_TRANSFORM.${OPSYS}. The
deprecation warning was meant for BUILDLINK_TRANSFORM.${pkgbase}, but
since pkglint cannot distinguish between these, the warnings were wrong.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 14 21:25:47 2019 UTC (23 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q3-base, pkgsrc-2019Q3
Changes since 1.5: +17 -18 lines
Diff to previous 1.5 (colored)

pkgtools/pkglint: update to 5.7.16

Changes since 5.7.15:

* Completely rewrote the code for aligning multiple variable assignment
  lines. It works on the actual lines of the file now instead of the
  parsed lines. This provides more exact diagnostics and also makes the
  handling of these lines easier so that future requirements can be
  implemented more easily.

* Added support for exotic conditions in .if clauses. These conditions
  are not seen in the wild though.

* Fixed wrong diagnostics for ALTERNATIVES files that appear
  conditionally in the PLIST.

* As always: lots of refactorings and newly added tests.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jun 30 20:56:19 2019 UTC (23 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.4: +6 -6 lines
Diff to previous 1.4 (colored)

pkgtools/pkglint: update to 5.7.14

Changes since 5.7.13:

- Removed the -Cextra command line option since it didn't produce useful

- Removed unwarranted warnings about _WRAP_EXTRA_ARGS.CC being used in

- Cleaned up the canonical order of variables in package Makefiles.

- Added a few commands to those that cannot fail, to reduce the number of
  "at the left of the | operator" in shell programs.

- Fixed warnings about "-ggdb" being an unknown shell command.

- Reduced number of warnings about lists being used where a single value
  is expected.

- Replaced unreliable check for invalid CFLAGS and LDFLAGS with a more
  practical check.

- Renamed "RCS tag" to "CVS tag" to make the diagnostics more modern.

- Added warning when PKGNAME or PKGVERSION is used in MASTER_SITES.

- Reworded warning for missing or superfluous PLIST files.

- Lots of other detail changes, refactorings and automatic tests.

Revision 1.4 / (download) - annotate - [select for diffs], Mon May 6 20:27:17 2019 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q2-base, pkgsrc-2019Q2
Changes since 1.3: +110 -2 lines
Diff to previous 1.3 (colored)

pkgtools/pkglint: update to 5.7.9

Changes since 5.7.8:

* files are checked for typos in the identifier that is
  used for BUILDLINK_TREE, to detect copy-and-paste mistakes.

* Having a rationale is recommended for some variables, especially those
  that make a package fail to build or crash at runtime. This check is
  only active when -Wextra is given, since it is still actively debated
  whether such a check is actually useful.

* Files called Makefile.php can easily be mistaken to be PHP files.
  Therefore the recommended naming convention is to have auxiliary files
  called *.mk. There are already many more files called *.mk than those
  being called Makefile.*.

* The check for unquoted sed substitution commands has been made more
  detailed, but since it is completely disabled, there's nothing to see
  for now.

* The definitions for MASTER_SITE_* are loaded directly from the pkgsrc
  infrastructure instead of hard-coding them in pkglint.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Apr 20 17:43:24 2019 UTC (2 years, 1 month ago) by rillig
Branch: MAIN
Changes since 1.2: +3 -2 lines
Diff to previous 1.2 (colored)

pkgtools/pkglint: update to 5.7.5

Changes since 5.7.4:

* Warn about invalid variable uses in directives like
  .if and .for

* Do not warn when a package-settable variable is assigned using the ?=
  operator before including This warning only makes sense
  for user-settable and system-provided variables.

* The parser for variable uses like ${VAR:@v@${v:Q}} is more robust now,
  which reduces the number of parse errors and leads to more appropriate
  diagnostics, in cases like ${URL:Mftp://*}, which should really be

* The valid values for OPSYS are now determined by the files in
  mk/platform instead of allowing arbitrary identifiers. This catches a
  few instances where "Solaris" is used instead of the correct "SunOS".

* Setting USE_LANGUAGES only has an effect if mk/ has not yet
  been included. In all other cases, pkglint warns now.

* Missing entries in doc/CHANGES produce a note now. This will lead to
  more accurate statistics for the release notes.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Mar 24 13:58:38 2019 UTC (2 years, 2 months ago) by rillig
Branch: MAIN
CVS Tags: pkgsrc-2019Q1-base, pkgsrc-2019Q1
Changes since 1.1: +620 -439 lines
Diff to previous 1.1 (colored)

pkgtools/pkglint: update to 5.7.3

Changes since 5.7.2:

PLIST files are checked for non-ASCII characters. Even though pkgsrc
sets up the environment with LC_ALL=C, there are still some cases
of encoding errors. The case discussed on the tech-pkg mailing list
was lang/go112.

The checks for variable permissions ("may not be set in this file")
have been reworked completely. Many of the variable permissions had
different rules for Makefile and Makefile.common. These different
rules tried to prevent accidental overwriting of variables. Starting
in July 2018, pkglint got a check for redundant variables that is
far more accurate than the previous variable permissions. Therefore
these fine-grained permissions are no longer necessary. This removes
a few hundred wrong warnings about insufficient permissions.

The check that adds missing SHA512 hashes to distinfo files has been
fixed to work correctly in DIST_SUBDIR cases.

Improved the checks regarding tools that are used by a package but
not added to USE_TOOLS. For example, the "make" tool is always
available, as are all tools that are added to TOOLS_CREATE.

Lots of small improvements, as always.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Mar 10 19:01:50 2019 UTC (2 years, 3 months ago) by rillig
Branch: MAIN

pkgtools/pkglint: update to 5.7.2

Changes since 5.7.1:

* Fixed detection of GNU_CONFIGURE=yes combined with USE_LANGUAGES
  missing c. This combination tends to fail in the configure phase.

* When the distinfo doesn't contain all hashes for the downloaded
  distfiles (typically SHA512 is missing) and the distfiles are actually
  downloaded to ${PKGSRCDIR}/distfiles, pkglint can now add the missing
  hashes. It only does this if there is at least one existing hash
  and if all existing hashes are correct.

* The check for redundant variables has been improved considerably.
  Before there were several situations in which pkglint didn't get the
  redundant variable definitions right because its internal model only
  mimicked reality. The model has been improved and so have the

* Pkglint only warns about wrong permissions (for defining or using
  a variable) when it knows the type of the variable and the permissions
  for the current file. Before, it had also warned if the permissions
  for the current file were not explicitly defined.

* CFLAGS and LDFLAGS may be appended in files. This
  had been disallowed before, for no apparent reason. There are several
  places in pkgsrc where especially CFLAGS.${OPSYS} is appended to.

* Cleaned up internal handling of relative paths. Previously pkglint
  sometimes resolved relative paths using the wrong base directory,
  which led to all kinds of wrong warnings and strange behavior.

* Fixed lots of edge cases when parsing Makefile lines. These cases
  don't occur often but experience tells that the most fundamental code
  must be as correct as possible (see the handling of relative paths

* Lots of refactoring and housekeeping, as always.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

CVSweb <>