Skip to main content

FreeBSD ports tree lint

Project description

PORTSTREELINT(8)

NAME

portstreelint - FreeBSD ports tree lint

SYNOPSIS

portstreelint [--show-cat|-C] [--show-mnt|-M] [--cat|-c LIST] [--mnt|-m LIST] [--port|-p LIST] [--plist NUM] [--broken NUM] [--deprecated NUM] [--forbidden NUM] [--unchanged NUM] [--check-host|-h] [--check-url|-u] [--debug] [--info] [--version] [--help|-?] [--]

DESCRIPTION

The portstreelint utility checks the FreeBSD port tree Index and some part of the port's Makefiles for errors and warnings.

By default it will scan the whole port tree, but you can select a subset of the ports with the options --cat|-c for categories, --mnt|-m for maintainers and --port|-p for ports. All these options expect a parameter which can be a single item or a comma-separated list of items. If you combine several of these operators they will perform as a logical AND.

In order to know which categories or maintainers are available for selection, you can use the --show-cat|-C and --show-mnt|-M options to view all the categories and maintainers with their number of associated ports.

The two costlier analysis are disabled by default. You can check if the port's www sites hostnames are resolvable with the --check-host|-h option (takes about 15 minutes on the whole port tree). And you can check if the port's www sites URL are available with the --check-url|-u option, which implies the previous one (takes about 6 hours on the whole port tree).

The checks list includes:

  • Nonexistent Makefile
  • Nonexistent INDEX:port-path
  • Unusual INDEX:installation-prefix (warning)
  • Too long INDEX:comments (> 70 characters) (warning)
  • Uncapitalized INDEX:comments
  • INDEX:comments ending with a dot
  • INDEX:comments different from Makefile:COMMENT
  • Nonexistent INDEX:description-file
  • URL ending INDEX:description-file
  • INDEX:description-file content same as INDEX:comment
  • INDEX:description-file content no longer than INDEX:comment
  • Nonexistent pkg-plist, Makefile:PLIST_FILES/PLIST/PLIST_SUB (info)
  • Makefile:PLIST_FILES abuse (warning)
  • INDEX:maintainer different from Makefile:MAINTAINER
  • Unofficial categories (warning)
  • INDEX:categories different from Makefile:CATEGORIES
  • Empty INDEX:www-site
  • Unresolvable INDEX:www-site (optional)
  • Unaccessible INDEX:www-site (optional)
  • INDEX:www-site different from Makefile:WWW
  • Ports marked as BROKEN, FORBIDDEN or DEPRECATED
  • Ports marked as IGNORE (warning, unreliable)
  • Ports marked as BROKEN, FORBIDDEN or DEPRECATED for too long
  • Ports unchanged for a long time (info)

It's possible to change the default values for PLIST_FILES abuse, BROKEN_since, DEPRECATED_since, FORBIDDEN_since and Unchanged_since with the --plist, --broken, --deprecated, --forbidden and --unchanged options, followed by a number of files for the first one and a number of days for the others.

OPTIONS

Options Use
--show-cat|-C Show categories with ports count
--show-mnt|-M Show maintainers with ports count
--cat|-c LIST Select only the comma-separated categories in LIST
--mnt|-m LIST Select only the comma-separated maintainers in LIST
--port|-p LIST Select only the comma-separated ports in LIST
--plist NUM Set PLIST_FILES abuse to NUM files
--broken NUM Set BROKEN since to NUM days
--deprecated NUM Set DEPRECATED since to NUM days
--forbidden NUM Set FORBIDDEN since to NUM days
--unchanged NUM Set Unchanged since to NUM days
--check-host|-h Enable checking hostname resolution (long!)
--check-url|-u Enable checking URL (very long!)
--debug Enable logging at debug level
--info Enable logging at info level
--version Print version and exit
--help|-? Print usage and this help message and exit
-- Options processing terminator

FILES

The whole port tree under /usr/ports

  • as root, get the last version with "portsnap fetch update"

/usr/ports/INDEX-xx

  • where xx is the major version of FreeBSD that you are using (as I write this xx=14). As root, get the last version with "cd /usr/ports ; make fetchindex" or rebuild it from your port tree with "cd /usr/ports ; make index"

EXIT STATUS

The portstreelint utility exits 0 on success, and >0 if an error occurs.

EXAMPLES

To analyze the full port tree in the background, do:

$ nohup portstreelint --info -hu > stdout.txt 2> stderr.txt &

Results for this example are available there:

To analyze the ports of a specific maintainer identified by id@domain, do:

$ portstreelint --info -m id@domain

SEE ALSO

lint(1), portlint(1), vuxml(3)

STANDARDS

The portstreelint utility is not a standard UNIX command.

This implementation tries to follow the PEP 8 style guide for Python code.

PORTABILITY

None. Works only on FreeBSD, but who needs anything else?

HISTORY

While working on the 4th version of the pysec2vuxml tool, I noticed there were errors in the FreeBSD port Index, so I built the portlint2 tool to analyze this more thoroughly...

After dicussions on the freebsd-ports mailing list an interest in checking port vulnerabilities arose, which led me to convert that standalone command into a Python package in order to benefit from my vuxml library.

LICENSE

It is available under the 3-clause BSD license.

AUTHORS

Hubert Tournier

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pnu-portstreelint-1.0.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

pnu_portstreelint-1.0.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file pnu-portstreelint-1.0.0.tar.gz.

File metadata

  • Download URL: pnu-portstreelint-1.0.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for pnu-portstreelint-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d74898b21bf45c0a83fa6a31289dcdde2027ef86e46e514b703ffaf329c61158
MD5 60c22b1ef0abcc0673d6e204a9fa8aea
BLAKE2b-256 f6a82dcb1b1da24cbfc441d5aa7fbf7bea60e5f2f287dc4027a0ba1084803620

See more details on using hashes here.

File details

Details for the file pnu_portstreelint-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pnu_portstreelint-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c266daebc7ac9722405adefcec0723b28ef753eade0fb12ea5e47149dca6c64b
MD5 31932e5dbc57555ff7d72f7ca6d14279
BLAKE2b-256 c8165e4d7c0d597cc8b23d58963ac0b0e9192dd6a03efe72aef23ba42203790f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page