pkgsrc/pkgtools/pkglint
rillig b3bf02bf7d - The simplification from the last commit was wrong, but those statements
that could have revealed the defect had been commented out. Now they
  can be enabled with -Wspace.
- The state traces are only shown in -dvv mode.
2006-02-19 21:28:35 +00:00
..
files - The simplification from the last commit was wrong, but those statements 2006-02-19 21:28:35 +00:00
DESCR Replaced the DESCR from the year 2001 with a current one, since pkglint has 2005-12-01 04:05:36 +00:00
Makefile Updated pkglint to 4.57. 2006-02-18 12:24:22 +00:00
PLIST 4.15.1: Fix PLIST (hi Roland!). 2005-05-18 21:06:58 +00:00
README TODO: reinvent the pkglint type system. 2006-02-15 18:12:37 +00:00
TODO * Many of the checking routines need some context to provide better 2006-02-04 03:39:40 +00:00

$NetBSD: README,v 1.2 2006/02/15 18:12:37 rillig Exp $

== Current problems ==

The current pkglint architecture will not scale much further. What is
needed next are parsers for nested, non-context-free languages (make(1),
sh(1), sed(1)). The parsers should be able to recognize partial
structures, as well as structures containing foreign parts. This is
because most of pkgsrc is heavily based on preprocessors:

- The .if and .for directives in Makefiles are preprocessed by make(1)
  before building dependencies and shell commands out of the remaining
  text.

- make(1) assembles shell commands from literal text and variables like
  ${PKGNAME}.

- Shell commands often use dynamic evaluation of variables.

All this makes enhancing pkglint non-trivial. If you know of any
academic papers that might be of help in this case, please tell me.

Additionally, the Perl programming language is not well suited to this
kind of tool. It does not provide:

- Sufficient static checking (especially for names of methods)
- A type system (you can apply almost any operator to any kind of data)
- Object orientation (needed for the future advanced parsers)
- Narrow scope for constants (it's just ugly)
- Enumeration data types
- Structured data types

The pkglint source code is much too big for a single file.

== The pkglint type system ==

The framework for defining data types in the makevars.map file is
insufficient. It does not allow ACLs that specify which variables may
be read or written by the various actors in pkgsrc. At the moment, the
data type and the permissions are intermixed (see type Readonly).

Actors:
	package	-> the package author
	system	-> the pkgsrc infrastructure
	include	-> included make files
	bl3	-> buildlink3 files
	user	-> the user via mk.conf
	cmdline	-> the user via the command line

Actions:
	default	-> provide a default value for a variable
	append	-> append to a list
	write	-> create or overwrite a variable
	readpp	-> read the value of a variable during preprocessing
	read	-> read the value of a variable during execution of the
		   shell commands