Commit graph

4,462 commits

Author SHA1 Message Date
f075d3d0cf cmds.projects.BaseCmdPkgRelations: Support --quote
In a push to eventually merge class CmdRequiredOsPkg into this class,
add the --quote option required by it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 18:33:51 +01:00
d643956846 cmds.projects.BaseCmdPkgRelations: Add pkg_relations_list()
Add a function pkg_relations_list(), doing pretty much the same as
pkg_relations(), but taking individual arguments instead of an
argparse.Namespace args argument, in order to provide the
functionality to derived classes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 18:33:51 +01:00
5f81f8d4da cmds.projects.BaseCmdPkgRelations: Add type hints
Add type hints to the class's methods.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 16:42:04 +01:00
57f204ccaa cmds.projects.BaseCmdPkgRelations: Remove --no-version
Merge --no-version into the --syntax option as "--syntax names-only"
to remove redundancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 16:41:59 +01:00
cff63786e9 lib.Distro: Allow empty packages list
In commands taking lists of packages, namely install, delete and
pkg_files, don't bother asking the backend. Uniformly log a warning
and return successfully.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 16:41:46 +01:00
84f1ad66f6 topdir.mk / projects-dir.mk: Remove BASE_PKGS
Move the dependencies listed in BASE_PKGS from projcts-dir.mk and
topdir.mk into project.conf.

Due to various hen-and-egg problems on a minimal system, in some
situations these packages can't be installed from project.conf. The
same is true with BASE_PKGS, however, so remove it, at least that
does away with some redundancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 14:58:54 +01:00
e2098ec90a Release 1.0.0-186@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-15 09:48:28 +00:00
564c55497c Start version: 1.0.0-186
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-15 09:47:46 +00:00
7046983d7c cmds.projects.BaseCmdPkgRelations: --syntax debian
Add support for --syntax to BaseCmdPkgRelations.pkg_relations(), and
default to 'semver', i.e. the current state of affairs. If that's
changed to 'debian', relations declared in project.conf as

  pkg.requires.os.devel = jw-pkg-devel > 1.2.3

will be output as

  jw-pkg-devel >> 1.2.3

which is what Debian expects.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:43:08 +01:00
509fe1c5e0 cmds.projects.BaseCmdPkgRelations: --expand-semver-revision-range
Add support for --expand-semver-revision-range to
cmds.projects.BaseCmdPkgRelations.pkg_relations(). The options turns
a dependency in projects.conf

  pkg.requires.os.devel = jw-pkg-devel = VERSION

into

  jw-pkg-devel >= 1.2.3, jw-pkg-devel < 1.2.4

Note that this will break as soon as a real range is specified in
projects.conf. To be fixed later, this commit is at least less
breakage than before.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:42:51 +01:00
5bd1f3378b App.get_value(): Beautify logging
"getting value xxx for project" is a prominent debug log message but
ugly. Beautify to e.g.:

  Lookup jw-fail2ban -> jw-pkg / version

Meaning project "jw-fail2ban" looks up the value for key "version" in
project "jw-pkg".

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:42:35 +01:00
b2847809c1 lib.Types: Make debug logging optional
lib.Types class detection is too chatty. Make that a ctor option.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:42:24 +01:00
e56befb1c3 projects-dir.mk: No time -p on JW_PKG_PY_PROJECTS
Don't prefix JW_PKG_PY_PROJECTS with time -p. A timing summary shows
up in too many places unexpectedly, e.g. in the context of the target
update-text-files. Add back later as more concrete demand comes up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:30 +01:00
d652731624 projects-dir.mk: Fix list-files' recipe
Remove echo realpath PROJECTS_MAKEFILE_NAME from the list-files
recipe. Misguided on more than one level.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:05 +01:00
425641f213 Release 1.0.0-185@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-14 16:43:06 +00:00
f77db2be37 Release 1.0.0-185@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-14 16:29:46 +00:00
bc247bd4cd Start version: 1.0.0-185
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-14 16:29:02 +00:00
c159a11bbe topdir.mk: pkg-install-[testbuild|relase]-deps: Unify
Make pkg-install-testbuild-deps an alias for
pkg-install-release-deps. At this point, they do nearly the same
thing, and the distinction between what the implementations should do
are blurry at best. This commit removes redundancy but keeps the use
cases distinct. Different implementations can be reinstantiated
should requirements for different implementations become clearer
later on.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 14:30:28 +01:00
cecee8a842 systemctl-wrapper.sh: Add script to check for systemd
Maintainer scripts often mess with systemd services via systemctl. In
Docker containers, chroot environments or other environments not
governed by Systemd, systemctl will not exist or complain. This is a
frequent use case, worthy of providing a wrapper to catch and ignore
these cases conveniently.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 14:15:04 +01:00
2e1115e722 cmds.projects.CmdRequiredOsPkg: Select devel with release
The output of

  jw.pkg.py projects required-os-pkg --flavours release

should include all packages required by flavour devel, because during
the release process, -devel and -run packages are both installed, and
installing the -devel package is only possible if its dependencies
are installed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 12:09:42 +01:00
d97cf111da project.conf: pkg.requires.relase.os = build-essential:native
Fix the following package build error:

    $ dpkg-buildpackage -us -uc -ui
    dpkg-buildpackage: info: source package jw-pkg
    dpkg-buildpackage: info: source version 1.0.0-184
    dpkg-buildpackage: info: source distribution kali-rolling
    dpkg-buildpackage: info: source changed by janware GmbH <jan@janware.com>
     dpkg-source --before-build .
    dpkg-buildpackage: info: host architecture amd64
    dpkg-checkbuilddeps: error: unmet build dependencies: build-essential:native
    dpkg-buildpackage: error: build dependencies/conflicts unsatisfied; aborting
    dpkg-buildpackage: hint: satisfy build dependencies with your package manager frontend
    debuild: fatal error at line 1185:
    dpkg-buildpackage -us -uc -ui failed

This pulls in a lot of dependencies and should be made more specific
if possible.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:13 +01:00
d4aab54607 project.conf: Remove pkg.requires.ubuntu|raspbian
Remove the sections pkg.requires.ubuntu|raspbian from project.conf,
because their contents is present in pkg.requires.debian and is
already evaluated by Ubuntu and Raspbian builds.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:13 +01:00
cc058394d8 project.conf: pkg.requires.build.os: pkg-config -> devel
Don't build-depend on pkg-config, because it's unnecessary to build
jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:26:12 +01:00
b7b2e9d5f4 project.conf: pkg.requires.build.os: -inkscape, +cpio
Remove dependency inkscape: It's needed by svg-to-pixmap.mk, but not
for building jw-pkg. If anything, -devel should depend on it, but
that seems a little heavy handed and can be achieved by packages
which know that they include svg-to-pixmap.mk.

Add dependency cpio: Needed by pkg.sh to copy a the source file tree.
Will be removed again as soon as pkg.sh goes Python.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-14 11:25:46 +01:00
bc5099fc05 Release 1.0.0-184@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-12 14:08:16 +00:00
824919c62b Release 1.0.0-184@suse-tumbleweed/x86_64 2026-03-12 11:01:31 +00:00
cce82abafd Start version: 1.0.0-184 2026-03-12 11:00:37 +00:00
57a4d79675 Release 1.0.0-183@suse-tumbleweed/x86_64 2026-03-10 00:34:29 +00:00
31305975a2 Release 1.0.0-183@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-10 00:11:16 +00:00
64df012751 Start version: 1.0.0-183
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-10 00:10:33 +00:00
72bd5e3555 lib.Local.run(): Be less dramatic about exit != 0
Don't mention "error" in log message for exit codes > 0 from spawned
processes, because sometimes they don't mean an error.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 20:03:01 +01:00
281e6e2440 cmds.secrets.CompileTemplates: Log missing secrets
Log the number of secrets missing to fully compile all templates.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 20:01:26 +01:00
6df4c86fc5 lib.App: Add property cmdline
Add the property App.cmdline, containing the invoking command line as
a string.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 20:00:30 +01:00
f3c4a51b85 cmds.secrets.CmdCompileTemplates: Support -ogm
Add support for the -o (--owner) -g (--group) -m (--mode) options.
They allow to specify a default for compiling templates, but _don't_
override what's in the #conf: specification line in .jw-tmpl or
.jw-secret files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 19:58:28 +01:00
1ffac7b365 cmds.secrets.CmdXX: Add option --all
Support option --all to jw-pkg.py secrets list-compilation-output and
list-secrets (CmdListCompilationOutput & CmdSecrets). This allows
them to also report non-existent files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 19:58:02 +01:00
699980c32e cmds.secrets.Cmd: Fix errors on Kali 2026.1
Fix errors dug up by testing on Kali Linux 2026.1:

  - Nested class Cmds.Attrs is constructed without scope

  - "replace" falls back to empty list, not empty dictionary

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-09 19:57:56 +01:00
2aa2493dca Release 1.0.0-182@suse-tumbleweed/x86_64 2026-03-08 05:36:30 +00:00
0e199d89ec Release 1.0.0-182@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-08 00:10:40 +00:00
05284fc36d Start version: 1.0.0-182
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-08 00:09:57 +00:00
18de6f2cf2 cmds.CmdSecrets: Add command class + subcommands
jw-pkg.py secrets [sub-command] [packages] is a set of utility
commands designed to manage configuration files containing secrets.

To keep secrets from leaking via version control or packages, a
_template_ should be packaged for every sensitive configuration file.
Then, during post-install, configuration files can be generated from
packaged templates via

  jw-pkg.py secrets compile-templates <package> <package> ...

During post-uninstall

  jw-pkg.py secrets rm-compilation-output <package> <package> ...

removes them.

Not specifying any packages will compile or remove all templates on
the system.

To identify which files to consider and generate or remove, the
compilation scans <package> for files ending in .jw-tmpl. For each
match, e.g.

  /path/to/some.conf.jw-tmpl

it will read key-value pairs from

  /path/to/some.conf.jw-secret

and generate

  /path/to/some.conf

from it, replacing all keys by their respective values. The file
attributes of the generated file can be determined by the first line:
of some.conf.jw-tmpl or some.conf.jw-secret:

  # conf: owner=mysql; group=mysql; mode=0640

There are other commands for managing all secrets on the system at
once, see jw-pkg.py secrets --help:

    compile-templates   Compile package template files
    list-compilation-output
                        List package compilation output files
    list-secrets        List package secret files
    list-templates      List package template files
    rm-compilation-output
                        Remove package compilation output files

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-07 21:51:17 +01:00
18c16917b2 App, .cmds.Cmd: Add .distro property
DistroBase's option --id is now redundant to the new global option
--distro-id in the App class, so remove --id. The only added value
DistroBase then brings to the table is its .distro property, which
can be provided by App just fine at this point, given that App has
all it needs to construct a Distro object, so add .distro to App and
remove the entire DistroBase class.

For convenience, also make App.distro available as a newly added
cmds.Cmd.distro property. This also obviates the need for the
distro-related properties in the .distro.Cmd class, remove all that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-07 14:35:54 +01:00
bd38700f67 lib.Distro: Add .id
Allow to query the distribution ID a Distro was instantiated with via
the .id property.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-07 14:35:54 +01:00
72ac282b76 Release 1.0.0-181@suse-tumbleweed/x86_64 2026-03-06 19:17:37 +00:00
6cf217b2b1 Release 1.0.0-181@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-06 18:34:10 +00:00
09d9408df3 Start version: 1.0.0-181
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-06 18:33:29 +00:00
67a2931f5e App: Support --verbose
Add the --verbose global option, which is made available as the
App.verbose property.

Some functions still take a verbose parameter, but the type of these
parameters is converted from bool to bool|None.  The idea is that, if
they are None, their verbosity falls back to the global default.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 19:02:22 +01:00
525fa34387 lib.pm: Add parameter ec: ExecContext to functions
Functions in lib.pm (i.e. run_dpkg(), run_rpm() and friends) also get
an ExecContext-type parameter. Use them in lib/distros/*/Distro.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 19:02:22 +01:00
1325222fbd lib.ExecContext,Local: Remove callback default params
Remove defaults from protected callback function parameters. They
have to be decided by the base class's public API.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 19:02:22 +01:00
c6e8d38497 Release 1.0.0-180@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-06 15:23:29 +00:00
cb98f637d5 Release 1.0.0-179@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-06 15:22:49 +00:00