Commit graph

4,414 commits

Author SHA1 Message Date
cbe5da4c7a Start version: 1.0.0-190
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-20 09:44:55 +00:00
5078c27682 cmds.projects.CmdListRepos.run(): Fix trailing newline
projects list-repos prints a traling newline, remove that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
02697af568 lib.ExecContext: Align .sudo() prototype to .run()
ExecContext's .sudo() omits many of run()'s parameters, and this
commit adds them. To avoid redundancy around repeating and massaging
the long parameter list of both functions and their return values, it
also adds some deeper changes:

  - Make run(), _run(), sudo() and _sudo() always return instances of
    Result. Before it was allowed to return a triplet of stdout,
    stderr, and exit status.

  - Have ExecContext stay out of the business of decoding the result
    entirely. Result provides a convenience method .decode()
    operating on stdout and stderr and leaves the decision to the
    caller.

    This entails miniscule adaptations in calling code, namely in
    App.os_release, util.get_profile_env() and CmdListRepos._run().

  - Wrap the _run() and _sudo() callbacks in a context manager object
    of type CallContext to avoid code duplication.

  - Consistently name the first argument to run(), _run(), sudo() and
    _sudo() "cmd", not "args". The latter suggests that the caller is
    omitting the executable, which is not the case.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
37af0a05e9 lib.SSHClient: Implement verbose logging
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
e924f34441 pkg.App.os_release: Call cat /etc/os-release
Don't open and parse /etc/os-release with Python built-in functions.
Spawn "cat /etc/os-release" as a subprocess and capture the output
for parsing instead. The obvious advantage is that this also works
with a remote shell.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
df40af9fc3 lib.App.call_async(): Add method
Use the AsyncRunner class introduced in the previous commit to add a
call_async() method, allowing to run async functions from sync
functions by spawning an extra event loop.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
67e51cf07c lib.AsyncRunner: Add class
Add class AsyncRunner. This is a wrapper around the ceremony needed
to spawn an extra event loop in a synchronous function which wants to
call an async function.

Guido van Rossum considers it bad design that such a function exists
in the first place. While that may be true in the long run also for
jw-pkg, at this point I'm unwilling to flag every lazyly initialized
App property as async. It's not clear, yet, which will be async and
which not, and I dread the churn. So I will accept this as a
minimally invasive helper for now. When the API has stabilized, a
design without it may be better.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
95a384bfff lib.App.eloop: Add property
Expose App's __eloop member containing the application's main event
loop to allow outside async event loop trickery.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
52dd3b8f21 lib.ExecContext.run(): Push code up into base class
Take implementation burden from the derived classes _run() callback
by moving the respective code into the run() wrapper methods of the
base class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
f2ffe85b61 lib.SSHClientInternal: No key_filename in connect()
Remove the key_filename parameter from the call to Paramiko's
connect(). It's user-dependent, and the current DevOps implementation
relies on having a SSH_AUTH_SOCK in the environment, anyway.

Signed-off-by: janware DevOps <devops@janware.com>
2026-03-20 10:30:25 +01:00
49daa86696 lib.SSHClient: Log more details around exceptions
Add a wrapper around urlparse() and Paramiko's connect() function, in
order to log some more info in case an exception is thrown.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
d905f6d555 App: Support --uri <remote-host>
Add a --uri option to App, allowing jw-pkg.py to operate over the
wire.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
76b702f5b4 lib.ExecContext.create(): Add method
Add a class method to instantiate an ExecContext by its URI.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
5f6ec5a182 lib.SSHClient: Retire non-EC API
Remove .run_cmd(), forcing future clients to use the ExecContext
aligned API.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
888c1e7f16 lib.ExecContext.__init__(): Add parameter uri
Take a positional uri argument to the constructor of ExecContext,
forcing SSHClient to follow suit. The latter was instantiated with a
hostname as only argument up to now, which still works as a special
case of an uri.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
db9bf1826d cmds.projects.CmdListRepos: Use new SSHClient API
Use SSHClient as an ExecContext, i.e. use the .run() method instead
of .run_cmd(). Also, let SSHClient decide which implementation to
use.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
a76a6c9316 lib.SSHClient: Move public methods down
Code beautification chore: Move the public methods of SSHClients to
the bottom of the class to be consistent with other classes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
284eb30ecf lib.SSHClient: Derive from ExecContext
Make SSHClient an ExecContext by implementing _run() and _sudo().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
989e2c93e3 lib.SSHClient.run_cmd(): Align prototype with EC
Align the prototype of SSHClient.run_cmd() to ExecContext.run(). This
is a push towards making the SSHClient code an ExceContext, too. Some
arguments still log a warning or outright raise NotImplementedError.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
666f778e05 cmds.distro.CmdInfo: Beautify exception logging
CmdInfo._expand_macros() raises a custom exception during exception
handling. Replace that by logging some details and raising the
original exception to keep the stack trace readable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
ca6f27d2f0 mkspec-wrapper.sh: Add OS id to $INSTALL_LOG
Add the name of the operating system ID as taken from /etc/os-release
to $INSTALL_LOG. This should allow for easier post-mortem debugging
if multiple builds used the same file in /tmp and possibly also
prevent conflicts.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-20 10:30:25 +01:00
210f58f1f8 Release 1.0.0-189@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-17 16:02:34 +00:00
30d966254f Release 1.0.0-189@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-17 15:45:48 +00:00
37a8a4bc7b Start version: 1.0.0-189
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-17 15:45:00 +00:00
d0776db01f lib.SSHClient.run_cmd(): Accept cmd: list[str]
Make SSHClient accept a list of strings for the cmd argument to align
with the other run_cmd() functions in jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 16:23:34 +01:00
5a48143064 py-defs.mk: Move boolean vars to top
Move the PY_XXX = true|false variable definitions meant to be preset
by including makefiles to the top of py-defs.mk to make the structure
of the file clearer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 16:22:17 +01:00
226a241e8a py-defs.mk: Add PY_INSTALL_INIT_PY
Add PY_INSTALL_INIT_PY ?= true to py-defs.mk. If set to false, a
Python module will not try to attempt installing an existing /
generated __init__.py. This is useful when installing into an exiting
directory with an existing __init__.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 16:22:02 +01:00
eb216692eb defs.mk: Add *.yaml to LOCAL_CFG
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 13:38:18 +01:00
a6bf4b164a cmds/__init__.py: Make class loading dynamic
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 10:44:24 +01:00
58142a1115 lib.Distro.pkg_files(): Fix argument name
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-17 07:35:21 +01:00
896a607b09 systemctl-wrapper.sh: Beautify logging
Apply some more ASCII-art to systemctl-wrapper.sh's output.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 19:14:41 +01:00
c893584e5e make: Replace RPM -> PKG
jw-pkg supports more than RPM-based package managers, but for
historic reasons, lots of its Makefile variables still have "RPM" in
their names. This is misleading. Replace "RPM" in variable names by
the more generic "PKG" where appropriate.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:50 +01:00
ed17aaa6c9 make: Align equal signs in *.mk to column 30
Chore: Format equal signs uniformly. They should all be at column 30
but aren't. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:50 +01:00
d8db1e77dc rpmbuild.mk: Remove cruft
Remove stuff from rpmbuild.mk which is either unused, unusable or
not aligned with non-rpm-centric packaging workflows:

  - Variable RPMBUILD

  - Targets pkgbuild.dist pkg-upload-local.dist

  - Variables used by these targets

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:57:43 +01:00
824de4eca4 lib.distros.*.Distro: Align PM prototypes
Make all backend package manager prototypes have the same arguments:

	yum(self, args: list[str], verbose: bool=True, sudo: bool=True)

This also implies having them behave equally verbose, unless
otherwise specified by the caller. This changes the default for
Debian.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:53:58 +01:00
9cd5ef2b98 upload-defs-rpm.mk: Remove
upload-defs-rpm.mk doesn't contain anything useful, remove it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 14:53:53 +01:00
445fb5b2a8 Release 1.0.0-188@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 09:22:09 +00:00
8c314e7480 Release 1.0.0-188@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 06:37:47 +00:00
b34c22fdf8 Start version: 1.0.0-188
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 06:27:38 +00:00
153652a832 rpmdist.mk: Add pkg-release-update-version
Currently, the the version file is updated in the context of

  pkg.sh release-reinstall -D "$(RPM_REQUIRES_DEVEL)"

RPM_REQUIRES_DEVEL is often filled from the current version, which in
turn is filled from the version file, so the order of events here is
unclear at best.

Add target pkg-release-update-version and make pkg-release-reinstall
depend on it to make the order explicit.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 07:20:52 +01:00
e66acbee70 rpmdist.mk: Remove dead code
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:12:01 +01:00
d7cd96bd4b rpmdist.mk: pkg-release-reinstall -> get-official
Make target pkg-release-reinstall depend on target get-official. It
already depends on get-maintainer, but that's not enough in
situations where devops built a target on platform A, pushed the new
release, then proceeds to build on platform B: It needs to pull its
own changes made during release of A.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:05:01 +01:00
02c4f9080b topdir.mk: Add target get-official
make get-official already works as a pattern rule, but this commit
adds it explicitly to make tab-completion work.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:05:01 +01:00
8869a2d3df cmds.projects.BaseCmdPkgRelations: Code beautification
pkg_relations_list() has an intricate case distinction around
expand_semver_revision_range, clean that up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-16 06:05:01 +01:00
8785412eb7 Release 1.0.0-187@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 03:39:59 +00:00
10123d8232 Release 1.0.0-187@kali-rolling/amd64
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 00:10:06 +00:00
1635499168 Start version: 1.0.0-187
Signed-off-by: janware DevOps <devops@janware.com>
2026-03-16 00:09:16 +00:00
adb7fce0ab topdir.mk: pkg-install-release-deps: Improve selector
Use pkg-requires --hide-self to find all prerequisites that should be
installed for a test run against packages installed from the
repositories, including self-built and self-hosted packages.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 19:34:50 +01:00
277e5166e8 App.get_value(): Log return value
Log what App.get_value() lookups return with priority DEBUG,
insightful for debugging.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 19:34:50 +01:00
5b3118319c cmds.projects.CmdRequiredOsPkg|BaseCmdPkgRelations: Align APIs
In a push to eventually merge the classes, somewhat align the
command-line API of CmdRequiredOsPkg to the one of
BaseCmdPkgRelations by using dependency flavours as mandatory, first
argument.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 18:33:51 +01:00