scripts / make: Add Recommends support
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m32s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m48s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m6s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m41s
CI / Packaging test (push) Successful in 0s

The spec generator only supports Requires, Conflicts and Provides from
the [pkg.requires.*], [pkg.conflicts.*] and [pkg.provides.*] sections of
make/project.conf. A package that works without but is better with another
package, like jw-amavis-run without jw-clamav-run, must hard-require it, so
the dependency is pulled in on every install and cannot be removed without
dragging the depending package along.

This commit adds Recommends support to the spec generation chain:

- CmdPkgRecommends: new pkg-recommends command that reads the
  [pkg.recommends.<flavour>] sections, same base as pkg-requires
- pkg-dist.mk: compute PKG_RECOMMENDS_RUN and pass it to pkg.sh via a new
  -E option
- pkg.sh: accept -E and forward it to the mkspec wrapper
- mkspec-wrapper.sh: accept -E and export RECOMMENDS_RUN
- create-mkspec.sh: emit a Recommends: line when RECOMMENDS_<subpkg> is set
- create-mkdebian.sh: emit a Recommends: field in the debian control file

Projects without a [pkg.recommends.*] section generate unchanged specs:
every new line is guarded by a non-empty test. zypper follows Recommends by
default, so existing OpenSUSE installations are unaffected; a recommended
package can be removed without dragging the depending package along.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-09-18 12:11:00 +02:00
commit f76071815f
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
7 changed files with 81 additions and 2 deletions

View file

@ -246,6 +246,7 @@ Available subcommands of projects:
pkg-conflicts Print packages conflicting with a given package
pkg-provides Print packages and capabilities provided by a given
package
pkg-recommends Print recommended packages
pkg-requires Print packages required for a given package
proj-dir Print directory of a given package
pythonpath Generate PYTHONPATH for given modules
@ -584,6 +585,58 @@ usage: jw-pkg.py projects pkg-provides [-h] [-S [SUBSECTIONS]]
Print packages and capabilities provided by a given package
positional arguments:
flavours Dependency flavours (run, build, devel, release),
separated by comma or whitespace
modules Modules (default: None)
options:
-h, --help show this help message and exit
-S, --subsections [SUBSECTIONS]
Subsections to consider, separated by comma or
whitespace (default: None)
-d, --delimiter [DELIMITER]
Output words delimiter (default: , )
-p, --no-subpackages Cut -run and -devel from package names (default:
False)
--dont-strip-revision
Always treat VERSION macro as VERSION-REVISION
(default: False)
--expand-semver-revision-range
Always treat =VERSION macro as >= VERSION-0 and <
(VERSION+1)-0 (default: False)
--syntax {semver,debian,names-only}
Output syntax (default: semver)
--recursive Find dependencies recursively (default: False)
--dont-expand-version-macros
Don't expand VERSION and REVISION macros (default:
False)
--ignore [IGNORE] Packages that should be ignored together with their
dependencies (default: )
--skip-excluded Don't consider or output modules matching the os
cascade in their [build].exclude config (default:
False)
--hide-self Don't include projects listed in <modules> in the
output (default: False)
--hide-jw-pkg Don't include packages from requires.jw in the output
(default: False)
--quote Put double quotes around each listed dependency
(default: False)
============= Running: jw-pkg.py -t ../../../.. --log-level info projects pkg-recommends --help
usage: jw-pkg.py projects pkg-recommends [-h] [-S [SUBSECTIONS]]
[-d [DELIMITER]] [-p]
[--dont-strip-revision]
[--expand-semver-revision-range]
[--syntax {semver,debian,names-only}]
[--recursive]
[--dont-expand-version-macros]
[--ignore [IGNORE]] [--skip-excluded]
[--hide-self] [--hide-jw-pkg]
[--quote]
flavours [modules ...]
Print recommended packages
positional arguments:
flavours Dependency flavours (run, build, devel, release),
separated by comma or whitespace