Portfmt is a collection of tools for editing, formatting, and linting
FreeBSD Ports Collection Makefiles.
It comes with several tools:
- portfmt formats Makefiles
- portclippy is a linter that checks if variables are in the correct
order in a more comprehensive way than portlint
- portedit edits Makefiles. It comes with several commands
that can be used as a basis for your own port update scripts:
- bump-epoch: bumps PORTEPOCH or inserts it at the right place
- bump-revision: bumps PORTREVISION or inserts it at the right place
- get: lookup unevaluated variable values
- merge: Generic command to set/update variables while also
formatting the updated variables properly and inserting them
in the right places if necessary. Useful for merging output
of other tools like make cargo-crates, modules2tuple, or make
stage-qa. For example to mark a port deprecated:
printf "DEPRECATED=%s\nEXPIRATION_DATE=%s" \
Abandonware 2019-08-15 | portedit merge -i Makefile
- set-version: resets PORTREVISION, sets DISTVERSION or PORTVERSION
===> The following configuration options are available for portfmt-1.1.6:
SUBPACKAGES=off: Subpackages support (D16457)
===> Use 'make config' to modify these settings
Remove WWW entries moved into port Makefiles
Commit b7f05445c00f has added WWW entries to port Makefiles based on
WWW: lines in pkg-descr files.
This commit removes the WWW: lines of moved-over URLs from these
pkg-descr files.
Approved by: portmgr (tcberner)
Add WWW entries to port Makefiles
It has been common practice to have one or more URLs at the end of the
ports' pkg-descr files, one per line and prefixed with "WWW:". These
URLs should point at a project website or other relevant resources.
Access to these URLs required processing of the pkg-descr files, and
they have often become stale over time. If more than one such URL was
present in a pkg-descr file, only the first one was tarnsfered into
the port INDEX, but for many ports only the last line did contain the
port specific URL to further information.
There have been several proposals to make a project URL available as
a macro in the ports' Makefiles, over time.
(Only the first 15 lines of the commit message are shown above )
ports-mgmt/portfmt: Update to latest commit
Add more portedit commands:
- bump-epoch: bumps PORTEPOCH or inserts it at the right place
- get: lookup unevaluated variable values
- merge: Generic command to set/update variables while also
formatting the updated variables properly and inserting them
in the right places if necessary. Useful for merging output
of tools like make cargo-crates, make stage-qa, or
modules2tuple.
- set-version: resets PORTREVISION, sets DISTVERSION or PORTVERSION
ports-mgmt/portfmt: Update to latest commit
- Fix many crashes and hangs found by fuzzing with afl
- Portclippy ignores variables prefixed with an _ now
ports-mgmt/portfmt: Update to latest commit
- Extend data model to allow for target command formatting if turned
on with the new -t flag
- General parser improvements
- Sort USE_PYQT like USE_QT
- Add preliminary support for WIP USES=cabal options helpers/variables
- Add a portedit command which instead of formatting the entire
file only formats edited portions of it. As a proof of concept
this for now only has a 'bump-revision' command to bump PORTREVISION
of a port, and a 'get' command to return unevaluated variable
values as parsed by portfmt.
Changes: https://github.com/t6/portfmt/compare/ff04b7c3f4863f4597197878c64c3920eff30508...5f6ab52521d24bbf4bd158064339b9ed3d9d82e1
New port: ports-mgmt/portfmt
Portfmt is a tool for formatting FreeBSD Ports Collection Makefiles.
For the time being portfmt concentrates on formatting individual
variables as such it does not move variables to preferred positions.
WWW: https://github.com/t6/portfmt