summaryrefslogtreecommitdiff
path: root/pkgtools
AgeCommit message (Collapse)AuthorFilesLines
2022-08-14lintpkgsrc: remove preformatted manual pagerillig2-143/+2
Having the preformatted manual page checked in into version control doesn't make sense. Replacing the placeholders is an ugly hack and leads to ugly line breaks. If the preformatted manual page is needed, the better approach is to render it at build time, after the placeholders have been replaced.
2022-08-14lintpkgsrc: accept duplicate strings from brace expansion, for nowrillig2-6/+5
Having duplicate expanded strings is not as bad as having missed alternatives, it's only a question of performance.
2022-08-14lintpkgsrc: demonstrate another bug in brace expansionrillig1-1/+3
2022-08-14lintpkgsrc: fix brace expansion for empty alternativesrillig2-6/+4
2022-08-14lintpkgsrc: fix handling of 0 in brace expansionsrillig2-8/+5
2022-08-14lintpkgsrc: extract brace expansion, document its various bugsrillig2-16/+44
2022-08-14lintpkgsrc: properly clean up after chdirrillig1-2/+3
When running 'lintpkgsrc -I tmp/lp-85 -yro', lintpkgsrc couldn't find the cache file due to the intermediate chdir($pkgdistdir).
2022-08-14lintpkgsrc: clean up variable names and verbose/debug log messagesrillig1-27/+26
2022-08-14lintpkgsrc: clean up debug loggingrillig1-30/+29
2022-08-13lintpkgsrc: update to 2022.08.13rillig1-2/+2
Changes since 2022.08.12: In package makefiles, the ':U' modifier is evaluated more correctly than before, handling the values '' and '0' correctly. Running 'lintpkgsrc --help' produces a clean usage message. Distinfo files are checked more strictly than before. Running 'lintpkgsrc -D .' does not produce Perl warnings anymore when falling back to running bmake to determine the PKGNAME. When parsing package makefiles, the debug log for evaluating conditionals is easier to read.
2022-08-13lintpkgsrc: fix expansion of the ':U' modifierrillig5-16/+58
In Perl, 0 is falsy, but in bmake, the modifier ':U' only cares about undefined vs. defined.
2022-08-13lintpkgsrc: clean up the output of running 'lintpkgsrc --help'rillig1-2/+2
2022-08-13lintpkgsrc: make distinfo parsing stricterrillig1-31/+40
There are no distinfo files anymore in which the filename starts with './', so remove that check. Complain about invalid distinfo lines. This flags a few pkgsrc-wip packages, but none in main pkgsrc. Extract load_distinfo into a separate subroutine, improve local variable names. Document that only the first distinfo algorithm (currently BLAKE2s) is ever checked.
2022-08-13lintpkgsrc: cleanup: rename cache subroutines to be more expressiverillig2-17/+13
It was easily possible to confuse scan_pkgsrc_makefiles with load_pkgsrc_makefiles, so rename the latter to load_pkgdb_from_cache.
2022-08-13lintpkgsrc: remove extra code for determining the pkg_install versionrillig1-11/+4
There is no apparent reason for this code. Lintpkgsrc could already parse the version of pkg_install, by falling back to running bmake. When run in debug mode, 'lintpkgsrc -D .' failed because lintpkgsrc used a wrong regular expression instead of just calling dirname. While here, fix the variable name 'pkgsrcdir' to simply 'pkgdir', as the previous name was highly confusing.
2022-08-13lintpkgsrc: clean up evaluation of conditions in makefilesrillig2-58/+67
Having a variable named 'false' was confusing. Having a stack of if-states in which 0 means true and 1 means false was even more confusing. Using these magic numbers in the debug log without any explanation was misleading. The code, as well as the debug log, now uses the strings 'not_yet', 'active' and 'done' for the state of the conditionals. While it still requires a bit of thought to read the debug log, it's at least possible now.
2022-08-13lintpkgsrc: cleanup: reduce line noiserillig1-8/+8
2022-08-12lintpkgsrc: update to 2022.08.13rillig1-2/+2
Changes since 2022.08.10: Improve parsing of conditions, continuation lines, comments in makefiles. Replace hard-coded paths to /etc/mk.conf and /usr/pkg with the proper paths that correspond to the pkgsrc installation. If pkglint is run with unknown or invalid options, exit with an error status.
2022-08-12lintpkgsrc: fix parsing of modifiers in makefilesrillig2-8/+8
2022-08-12lintpkgsrc: fix parsing of comments in makefile linesrillig2-11/+12
2022-08-12lintpkgsrc: fix parsing of continuation lines in makefilesrillig2-4/+7
2022-08-12lintpkgsrc: clean up subroutine names, test conditionalsrillig3-43/+102
2022-08-12lintpkgsrc: clean up Pkgs typerillig2-26/+21
2022-08-12Revbump all Go packages after go118 security updatebsiegert1-1/+2
2022-08-11lintpkgsrc: use proper exit status when showing usagerillig1-4/+4
2022-08-11lintpkgsrc: cleanup: remove unused conf_sysconfdirrillig2-4/+2
It has been replaced with conf_makeconf.
2022-08-11lintpkgsrc: cleanup: split PkgDb::pkgver into separate subroutinesrillig2-18/+18
2022-08-11lintpkgsrc: cleanup: inline numpkgver, split pkgverrillig2-28/+19
2022-08-10lintpkgsrc: fix hardcoded pathsrillig4-51/+55
No matter whether lintpkgsrc is built in batch mode, its PREFIX must always be the actual prefix, not the hardcoded /usr/pkg, as there may also be bulk builds with --prefix=/opt/pkg. Same for mk.conf.
2022-08-10lintpkgsrc: fix evaluation of conditions in makefilesrillig3-48/+98
Previously, evaluating the conditions was a wild mixture of concepts taken from bmake's cond.c, without attention to detail. For example, in the condition 'exists(VAR:Mpattern)', the ':Mpattern' doesn't make any sense, still lintpkgsrc parsed it as a modifier. Instead of evaluating the ':M' modifier only in conditions, a better idea is to have a general subroutine that expands an arbitrary strings, taking care of all kinds of modifiers. While the previous code was conceptually wrong, the number of practical difference is small. Still, it's better to be precise and accurate, there are enough places with bad heuristics in the rest of the lintpkgsrc code.
2022-08-10lintpkgsrc: update to Perl 5.36rillig2-14/+13
Bump version.
2022-08-10lintpkgsrc: cleanuprillig2-141/+131
Mostly remove redundant punctuation around 'push' and 'defined'.
2022-08-10lintpkgsrc: cleanup: modernize subroutine signaturesrillig1-138/+55
2022-08-09lintpkgsrc: recognize comments and shell commands in makefile linesrillig1-1/+4
2022-08-09lintpkgsrc: clean up parsing of make variablesrillig2-47/+38
Unknown lines are written to the debug log.
2022-08-09lintpkgsrc: cleanup: extract expand_modifiersrillig1-48/+54
2022-08-09lintpkgsrc: cleanup: extract parse_makefile_line_varrillig1-29/+32
2022-08-09lintpkgsrc: clean up parsing of variable assignmentsrillig1-14/+17
2022-08-09lintpkgsrc: fix search path for .include directivesrillig1-19/+15
Previously, the search path was in pseudo-random order.
2022-08-09lintpkgsrc: cleanup: extract parse_makefile_line_includerillig1-63/+63
2022-08-09lintpkgsrc: clean up parse_makefile_varsrillig1-27/+20
2022-08-09lintpkgsrc: clean up glob2regexrillig1-8/+5
2022-08-09lintpksrc: fix parsing of the ':S' modifier in makefilesrillig2-42/+51
2022-08-09lintpkgsrc: fix conversion of glob pattern to regular expressionrillig3-20/+16
It is used for evaluating expression modifiers of the form ':S,from,to,'. Bump version.
2022-08-09lintpkgsrc: add more tests for converting a glob into a regexrillig1-1/+16
2022-08-04lintpkgsrc: cleanup: merge 'store' subroutinesrillig3-53/+35
With small changes, the subroutine for storing the cache can be restricted to the public API of the types PkgDb, Pkgs and PkgVer. This way, the 'store' subroutines no longer need to be part of the classes. Implementing the code in a single external subroutine saves a few lines of code. The order of the PkgVer entries in the cache file changes, everything else is as before.
2022-08-04lintpkgsrc: rename PkgList to PkgDbrillig2-68/+79
2022-08-04lintpkgsrc: test internal package databaserillig1-5/+60
2022-08-04lintpkgsrc: fix storing of package variables in the cacherillig2-3/+16
Broken since lintpkgsrc.pl 1.44 from yesterday. All package variables were stored as empty strings instead of their actual values.
2022-08-04lintpkgsrc: use single-quoted strings where possiblerillig2-64/+64