Commit graph

5,035 commits

Author SHA1 Message Date
5790e7ad96
Start version: 1.0.0-241
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-15 06:55:38 +00:00
bfad94c196
lib.distros.suse.Distro._install_local_files(): Use rpm
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m2s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m8s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m5s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m40s
CI / Packaging test (push) Successful in 0s
OpenSUSE leaves installing local packages to the default
implementation in lib.Distro._install_local_files(), which passes the
package path to the package manager, i.e. zypper in OpenSUSE's case.
That has advantages, namely automatic installation of dependencies,
but also disadvantages, namely the attempt to install dependencies
even if the package manager is disfunctional, possibly because an
installed package containing installation sources is broken.

That could lead to a deadlock when trying to install a fixed package.
I see two ways out: Support an additional flag to jw-pkg's install
command which selects whether or not dependencies shall be resolved
along, or just use rpm directly for all local install attempts.

The latter is the less fancy way to handle this, so as a first step
make it the default by overriding suse.Distro._install_local_files().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-15 08:18:40 +02:00
a739eb0763
lib.Result: Initialize with status = None
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m4s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m10s
CI / Packaging test (push) Successful in 0s
Define default parameter values for Result's constructor, namely None
for exit status, stdout and stderr.

Instantiating a Result object without parameters signifies "this
object doesn't contain data from a real process's exit event". Up to
now, similar meaning has been hand-crafted by ExecContext's run() and
friends by using an error exit status (1) to make sure it wasn't
mistaken for success. This commit formalizes that into the Result
structure itself, but uses None instead for the exit status.

Controlling default values in Result itself also means that the
Result class gets better awareness of what it contains, and its log
messages and stdin / stdout can be more fitting:

 - If a real process failed, make stdout return at least b''
 - If a real process succeeded, make stdout return at least b''

Returning something from .stdout on success fixes a real bug: An
attempt to access what "rpm -U somepackage.rpm" returns, namely
nothing, raises a bogus exception, because stdout is None.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-15 07:56:51 +02:00
f1df26aeac
Release 1.0.0-240@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m2s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m18s
CI / Packaging test (push) Successful in 0s
2026-06-12 23:23:45 +00:00
1bd0fb3a12
Release 1.0.0-240@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 2m56s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-12 23:09:08 +00:00
eb3c0c0b72
Start version: 1.0.0-240
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-12 23:08:15 +00:00
658a87fde0
lib.ExecContext.CallContext.log_delim: Beautify
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m10s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m16s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s
Fix commit 238cc05d which promised to beautify .log_delim but didn't.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-12 09:59:47 +02:00
335b9d601a
python-tools.sh create-init: Code beautification
Make the code in cmd_create_init() and command-line parsing a little
less ugly.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-12 09:58:56 +02:00
99da7a652b
Release 1.0.0-239@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m20s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m19s
CI / Packaging test (push) Successful in 0s
2026-06-12 06:33:21 +00:00
144fa010e6
Release 1.0.0-239@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m11s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m8s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-12 06:18:52 +00:00
f5644eee13
Start version: 1.0.0-239
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-12 06:17:55 +00:00
9039dc7e40
python-tools.sh, py-mod.mk: Use --symbol-filter
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m8s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m14s
CI / Packaging test (push) Successful in 0s
Letting python-tools.sh rewrite symbols is more robust than rewriting
an entire __init__.py with PY_INIT_FILTER in the including Makefile.
The latter can break in non-obvious ways if python-tools.sh changes
__init__.py's format.

Make python-tools.sh support --symbol-filter to remedy that. The
option takes an sed script which should expect a string of two
non-whitespace tokens: The module from which the symbol is imported,
and the name of the symbol in that module. It's output will then be
used as the symbol to be exported from __init__.py.

Also, support the PY_SYMBOL_FILTER variable in py-mod.mk. If it's
defined, it is used for --symbol-filter.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-12 07:33:07 +02:00
94c0045244
Release 1.0.0-238@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m23s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m23s
CI / Packaging test (push) Successful in 0s
2026-06-11 23:33:37 +00:00
a4a21adabf
Release 1.0.0-238@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 4m5s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m14s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-11 23:10:20 +00:00
29002f6c5c
Start version: 1.0.0-238
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-11 23:09:18 +00:00
238cc05d3b
lib.ExecContext.CallContext.log_delim: Beautify
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m18s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m24s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m21s
CI / Packaging test (push) Successful in 0s
Make the log delimiter look more consistent: Whether a CallContext
was constructed with a title parameter or without, prefix its
.log_delimiter property with a "----".

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 14:09:58 +02:00
844a358665
conf/templates: Fix installation
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m52s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m27s
CI / Packaging test (push) Successful in 0s
conf/templates is not installed to /etc/opt/jw-pkg/templates. Fix
that so that other packages including py-topdir.mk can use the
templates.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 13:30:43 +02:00
f153a990a7
build.cmds.CmdPythonpathOrig: Remove
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m35s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m39s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m32s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m29s
CI / Packaging test (push) Successful in 0s
Remove CmdPythonpathOrig. Its only purpose has ever been to document
and try out how  cmd_pythonpath_orig() had worked in an ancient
application version, that purpose is now served.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 12:36:10 +02:00
c8fc6326cb
py-topdir.mk: Use pythonpath --prefix for mypy_path
Make use of the newly introduced --prefix option to the pythonpath
command, and generate what's subseqently used to fill in mypy_path in
pyproject.toml.

By decoupling it from PYTHONPATH, this commit makes the creation of
mypy_path less involved and easier to understand. It also obviates
the need replace the relatively heavy ldlibpath.mk by the relatively
lightweight projects.mk, thereby enhancing performance.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 12:18:37 +02:00
46b1ce776e
cmds.projects.CmdPythonpath: Opts subdir, delimiter, prefix
Support additional options:

  --subdir    makes the command look for these existing
              subdirectories. Can be specified multiple times.

  --delimiter Does the obvious and defaults to ":"

  --prefix    A string to prepend verbatim before each path component

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 12:18:37 +02:00
b35d61311c
App: Support --topdir-format "relative"
The global --topdir-format option governs how a project's root
directory is represented in paths output by various queries.
"absolute" means as absolute path, "unaltered" means verbatim as
specified via --topdir, make:xyz means replaced by the string $(xyz),
for later expansion in a makefile variable.

This commit adds another variant: "relative" yields the shortest
possible output format of the output path in question relative to
--topdir, with "shortest possible" in this context meaning
canonicalized and leading "./" stripped.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-11 12:18:37 +02:00
0d18ee8ec1
Release 1.0.0-237@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m18s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m40s
CI / Packaging test (push) Successful in 0s
2026-06-10 23:29:28 +00:00
33091215d4
Release 1.0.0-237@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m11s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m40s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-10 23:10:32 +00:00
573c04968c
Start version: 1.0.0-237
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-10 23:09:31 +00:00
422f09a0b4
lib.ExecContext._put(): Fix forgotten input
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m12s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m10s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m22s
CI / Packaging test (push) Successful in 0s
_put() doesn't put: An empty stdin is passed to tee, a regression
introduced with 6db73873e7, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:56:05 +02:00
cd1716ff6f
lib.ExecContext._put(): Clean up temporary file
_put() can leave temporary files behind if one of its shell commands
fails, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:58 +02:00
4a6c8ab1d1
lib.ExecContext|.Distro: Ignore stdout_str newline
Ignore newline at the end of Result.stdout_str if only one line of
output is wanted from an executed shell command. The output of both
uname and mktemp are used wrongly in that regard.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:39 +02:00
9732b48788
lib.Result.__repr__(): Fix binary stdout exception
__repr__() tries to decode binary stdout as string and fails without
a backup. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:31 +02:00
812ddaa1b0
lib.Result.__repr__() Fix missing f-qualifier
__repr__() tries to format a variable in an f-string without "f". Fix
that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-10 12:55:20 +02:00
ead06831f5
Release 1.0.0-236@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m28s
CI / Packaging test (push) Successful in 0s
2026-06-09 23:27:22 +00:00
19b00e2597
Release 1.0.0-236@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m14s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m22s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-09 23:09:52 +00:00
0c604621c0
Start version: 1.0.0-236
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-09 23:08:49 +00:00
4b6966c480
pyproject.toml: Add {mypypath}
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m7s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m8s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m9s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s
Add a [tool.mypy] section to pyproject.toml with a {mypypath}
template variable. The already existing template generation mechanism
in py-topdir.mk should fill that in with a path pointing to all
Python modules managed by jw-pkg:

  [tool.mypy]

    {mypypath}

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:52:15 +02:00
850efda804
py-topdir.mk: Add machinery to generate pyproject.toml
pyproject.toml is currently copied unchanged from conf/topdir to the
toplevel directory. Set up machinery in py-topdir.mk to render it
from a template in conf/templates instead, replacing {mypypath} in
the process.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:52:15 +02:00
9ba6c70dee
py-topdir.mk: Add --config pyproject.toml
ruff tries to recursivley use every config file it finds and stumbles
over a template:

  /usr/bin/ruff check --select TC,FA --fix --unsafe-fixes .
  ruff failed
    Cause: Failed to parse /home/jan/local/src/jw.dev/proj/jw-pkg/conf/templates/pyproject.toml
    Cause: TOML parse error at line 3, column 3
    |
  3 |   {mypypath}
    |   ^
  invalid key-value pair, expected key

Limiting it to the toplevel pyproject.toml by explicitly specifying
--config fixes the behaviour, so that's what this commit does.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:47:06 +02:00
da877c624f
cmds.projects.CmdCreateFile: Add more options
- Add an additional, more generic value that --format understands:
    "tmpl". If chosen, the template selected by the new option
    --template-name is rendered by replacing --field key=value pairs.

  - This commit also adds the option --quote, which makes the
    renderer enclose the rendered variable values in double quotes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:46:47 +02:00
01be594103
cmds.projects.CmdCreateFile: Support --search-path
Add --search-path to the list of CmdCreateFile's supported options.
Its value is split by ":" and subsequently passed to the tmpl_render()'s
search_path argument.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:46:27 +02:00
81e71bc5c1
cmds.projects.lib.templates.tmpl_render(): RenderValues
tmpl_render()'s "values" argument currently understands
dict[str,str|list[str]]. Enhance that to understand the broader
RenderValues type, which also includes Iterable[tuple[str, str]], as
produced by argparse.add_argument(action='append').

This commit also adds proper type-checking for the values argument.
Before, its type had gone unchecked entirely.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:49 +02:00
841fb8b361
cmds.projects.lib.templates.tmpl_render(): search_path
Add an additional keyword-argument search_path to
templates.tmpl_render(). It allows to specifiy a list of directory
paths in which a template of a given name can be found. It defaults
to [], in which case only the built-in templates are considered.
Otherwise file locations are tried first, then the built-in
templates.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
7396794122
conf/templates: Add subdir
Add $(TOPDIR)/conf/templates as a location for templates, i.e. input
files to the CmdCreateFile template rendering command.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
c0c9148281
cmds.projects.CmdCreateFile: Add subdirs src/python
In order to allow Pyright to check the types provided by dependant
repositories without installing them, pyrightconfig.json contains a
list of paths to their root directories in "extraPaths".  These paths
are unusable for Pyright, though: For type checking to work, it needs
to be pointed to the "jw" namespace package paths within those repos.
This commit achieves that by appending the subdirs src/python and
tools/python to them, provided they exist.

TODO: This fix hardcodes the current project directory structure.
Better would be a way to customize that via makefiles, where the
paths can be more easily customized.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
0b558635a8
py-topdir.mk: Introduce $(PY_CHECK_ROOTS)
Replace variable PY_SRC_ROOT by PY_CHECK_ROOTS. The name PY_SRC_ROOT
was a bad choice, given that it isn't immediately obvious that it a)
can contain multiple root locations to be checked, and that it b)
specifically concerns static type checking.

As of this commit, it's possible to limit the type checking scope
with PY_CHECK_ROOTS as in

  PY_CHECK_ROOTS="src/python/jw/pkg/CmdBase.py src/python/jw/lib" \
    make check

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-09 07:45:15 +02:00
c3fafdf039
Release 1.0.0-235@suse-tumbleweed/x86_64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m28s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m16s
CI / Packaging test (push) Successful in 0s
2026-06-08 23:27:03 +00:00
149620daa3
Release 1.0.0-235@kali-rolling/amd64
All checks were successful
CI / Packaging - Kali Linux (push) Successful in 3m23s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-08 23:10:38 +00:00
03ceefaabd
Start version: 1.0.0-235
Signed-off-by: janware DevOps <devops@janware.com>
2026-06-08 23:09:36 +00:00
3f47abb29a
App.get_libname(): Don't use get_proj_refs()
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m12s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m18s
CI / Packaging test (push) Successful in 0s
App.get_projects_refs() is a versatile tool, but what it does isn't
obvious. Use the simpler method .get_value() instead for
get_libname(), and return None if a project doesn't provide a
linkable library.

This is similar to fix aadcdfb5f.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:41:37 +02:00
c538447cc5
App.__get_project_refs(): Code beautification
In __get_project_refs():

  - Rename variable dep and deps to val and vals, respectively,
    because that's more what they are values of key-value pairs. In
    some cases that can represent dependencies, in some case other
    things.

  - Make a scope case distinction a little clearer by mentioning all
    possible cases in a match / case block

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:41:37 +02:00
857efee225
jw-pkg-create-project.sh: Gitignore .cache-project.mk
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m15s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m19s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m20s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m11s
CI / Packaging test (push) Successful in 0s
Add make/.cache-project.mk to default the .gitignore file created by
make pkg-init-%.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 20:25:15 +02:00
345364cd85
ci.yaml: test-packaging.yaml@{master-test -> master}
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m16s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m12s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m12s
CI / Packaging test (push) Successful in 0s
Don't use master-test branch from ci/workflows for
test-packaging.yaml, because it might mo away. Use master instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 19:43:15 +02:00
00af6a2b37
ci.yaml: enable-email-notifications: true
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m21s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m17s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m15s
CI / Packaging test (push) Successful in 0s
Add enable-email-notifications: true. This seems to be needed for sending
information about failed runs. Apparently it doesn't make it difference if I
add it to ci/workflows/.github/workflows/test-packaging.yaml.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-08 19:14:00 +02:00