Commit graph

4,128 commits

Author SHA1 Message Date
6f6b7cc85c Release 1.0.0-161@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-11 00:13:46 +00:00
660efa1972 Start version: 1.0.0-161
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-11 00:13:15 +00:00
d50a33d9ab jw.pkg.cmds.lib.Cmd: Define run()

Define run(), which calls _run() in the abstract base class Cmd, not in lib.Cmd. Otherwise lib.Cmd is not abstract, which will predictably confuse including code outside of jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 10:00:46 +01:00
4932c6816c projects.mk: ?= -assign VERSION_FILE

If VERSION_FILE is not found, trying to include makefile snippets triggers the attempt to regenerate it. This happened for installed Makefiles of jw-docker-images: It defines TOPDIR to /opt/jw-docker-images, projects.mk looks there, but the version file is installed under /usr/share/doc/packages/jw-docker-images/VERSION.

Allow VERSION_FILE to be overridden including code to keep that from happening.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 10:00:17 +01:00
26cf7f7823 project.conf: Use Group Development/Tools/Building

Change package group from System/Libraries to Development/Tools/Building because that expresses the purpose of the package better.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:59:24 +01:00
ef52a2810a defs.mk: Add $(wildcard *.timer) to LOCAL_SYSTEMD

By default, install sytemd timer definitions found in a config directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:58:30 +01:00
67e56146f8 lo.mk: Fix warning that targets were not remade

make complains for plugins that soandso.dll has not been remade. The problem is that it tries to remake all targets of a multi-target. Split that up into two rules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:57:59 +01:00
1e9ab195a6 pgit.sh: Pass --autostash to rebase

Calling make git-pull-xxx from a projects directory stops iterating projects if one has a dirty workspace. Calling --autostash fixes that.

With this in place, a failed rebase leaves the local changes behind stashed. So, after manually fixing the rebase, the stash needs to be manually reapplied. The commands that led up to the failure are logged right before, so I have hope that this is learnable, and not too much of a footgun.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-10 09:55:59 +01:00
05378a6e7e Release 1.0.0-160@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-05 00:21:11 +00:00
00af90c768 Start version: 1.0.0-160
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-05 00:20:39 +00:00
eaa38113bb jw.pkg.App.get_libname(): Fix typo

get_project_refs() is invoked with projects_only=true, which should read names_only. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-04 16:00:45 +01:00
a55dd8175c jw.pkg.cmds.projects.CmdProjectDir: Fix warning typo

Trying to find the directory of a project should log a warning. It throws an exception instead. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-02 15:56:19 +01:00
53ba9e6fbe lib.App: Stay functional without autocomplete

If Python's autocomplete is not installed, jw-pkg.py fails to run commands. Fix that in order stay compatible with minimal excecution environments.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-02 12:15:41 +01:00
741a3b6db2 make: Install cache-projects.mk

.cache-projects.mk is not installed / packaged, which makes builds against an installed jw-pkg considerably slower. Change that, at the risk of making the installed jw-pkg-devel less versatile. This commit installs a cache file cache-projects.mk, renamed from .cache-projects.mk, because there's no justification for hiding an installed makefile. At least I can't think of one.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-01 09:50:52 +01:00
4431993665 pgit.sh pull: Rebase target branch before merge

Before merging the remote branch, do a rebase. This may fail and prompt conflict resolution, but that seems the canonical outcome for the common use case "interactive make git pull-xxx" with master out-of-sync.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-31 11:13:41 +01:00
059cdc0fe7 Release 1.0.0-159@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-30 00:21:12 +00:00
3f2a9bffef Start version: 1.0.0-159
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-30 00:20:41 +00:00
845e7a3577 projects-dir.mk: Fix typo JW_PKG_PY_PRJECTS

Fix misspelled variable JW_PKG_PY_PRJECTS.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 13:29:50 +01:00
4ff29ba255 projects-dir.mk: Add target pkg-manager-dup

There's pkg-manager-refresh already, so by adding pkg-manager-dup the distribution can be upgraded by distribution agnostic targets only through the Makefile. This might come in handy for CI, so add it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 12:53:06 +01:00
e075e8902b jw.pkg.cmds.CmdDistro: Default --interactive to true

Better safe than sorry: If things are to happen unattendedly, enforce the need to explicitly request that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 11:32:32 +01:00
6ca4af77d7 jw.pkg.App: Code beautification

Major - but not yet sufficient - code beautification starting from jw.pkg.App.

- Make more methods private - Rename methods to be more self-explanatory - Same for method arguments, notably clean up some inconsistent uses of "module" vs "project" - Add more type hints

Fix API breakage in the command modules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 11:32:14 +01:00
2bbf5bd8e7 jw.pkg.cmds.projects.CmdRequiredOsPkg: Support --quote

--quote puts double quotation marks around the listed dependencies, protecting version requirements (>= 1.0) and parenthesis "perl(GD)" from the shell.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-29 11:28:17 +01:00
26bfda109c cmds.projects.CmdListRepos: Try Forgejo users and orgs

A "username" in jw-pkg terms, as in $(CLONE_FROM_USER), is not sufficient to identify a remote API URL on a Forgejo server, it can denote both an organization and a user, so try organizations first, then users, and stop on the first occasion found.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:10 +01:00
b8e8ecf2f1 pkg-manager.sh: Replace by jw-pkg.py distro

Retire pkg-manager.sh and replace it by the cleaner "jw-pkg.sh distro" command, essentially providing the same functionality and nearly the same command-line interface.

Not-so-fun-fact:

jw-pkg > git diff --stat jw-devops/master ... 71 files changed, 732 insertions(+), 340 deletions(-)

400 LOC more. That's what the move from a shell script to the more maintainable Python versions costs. Still a good idea, and the enhanced extensibility might pay off in terms of LOC with other shell scripts in the future.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
45af308ae6 jw.pkg.cmds.distro.backend.arch: Add Module

Add Arch backend for pacman-based package management.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
f6a8b6307a jw.pkg.cmds.distro.backend.redhat: Add Module

Add backend for YAM-based package management, as used by RHEL, Fedora, CentOS.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
3ca544a32d jw.pkg.cmds.distro.backend.suse: Add Module

Add backend code for package managing on OpenSUSE Tumbleweed, Slowroll, LEAP, SLES and SLED.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
58e56648d2 jw.pkg.cmds.distro.backend.debian: Add Module

Add backend code for Debian-like package managing.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
674e51a7b2 jw.pkg.cmds.distro.backend: Add module

Add directory to host distro backends.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
0b6fb48485 jw.pkg.cmds.distro.CmdDup: Add Module

Add CmdDup, the class providing the "jw-pkg.py distro dup" subcommand.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
6e3fec0bec jw.pkg.cmds.distro.CmdInstall: Add module

Add CmdRefresh, the class providing the "jw-pkg.py distro install" subcommand.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
6a5e5aaf0d jw.pkg.cmds.distro.CmdRefresh: Add command

Add CmdRefresh, the class providing the "jw-pkg.py distro refresh" subcommand.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
d0311560da jw.pkg.cmds.distro: Add __init__.py

Add a hand-coded __init__.py into jw.pkg.cmds.distro. Auto-generation works fine, but has to run before it can work. For a freshly downloaded toplevel Makefile / project-dirs-minimal.mk, the targets pkg-install-xxx-deps requires a working package manager without jw-pkg built.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:11:09 +01:00
ad45ee8510 jw.pkg.cmds.distro: Add directory

Add the subdirectory structure for the distro subcommand.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 18:08:48 +01:00
53601c8abd jw.pkg.cmds.projects.CmdListRepos: Remove test code

Remove --insecure from curl invocation on janware.test.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 17:44:28 +01:00
4274a71c62 lib.util.run_cmd(): Rewrite it to be async

run_cmd() is synchronous. Now that all commands are asynchronous, we can await it, so rewrite it to be asynchronous, too.

Other changes:

- Make it return stderr as well in case its needed

- Drop into a pseuto-tty if - cmd_input == "mode:interactive" or - cmd_input == "mode:auto" and stdin is a TTY
- Add argument env, defaulting to None. If it's a dict, it will be the environment the command is run in

This entails making all functions using run_cmd() async, too, including run_curl(), get_username() and get_password().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 17:41:40 +01:00
9c06103a4a cmds.project.*: Make _run() async

Cmd._run(), as conceived for working with lib.App, is meant to be an async method. To be conservative about changes, jw-pkg's legacy way of handling _run() was kept when deriving from libApp, and async was not propagated down to the _run() implementations. This commit rectifies that before adding additional subcommands.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 17:41:10 +01:00
f175f9d5c9 lib.Cmd: Add argument "parent" to __init__()

During __init__(), commands have no idea of their parent. This is not a problem as of now, but is easy to fix, and it's architecturally desirable to be prepared just in case, so add the parent argument to the ctor before more commands are added.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:24 +01:00
132dce8b3f jw-projects.py: Rename it to jw-pkg.py

jw-projects.py is now a multi-call executable, with "projects" being just one of its subcommands. Rename it to jw-pkg.py to reflect that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:16 +01:00
1154cb984c ldlibpath.mk: Replace ifndef by ifeq ($(origin, ...))

As per info make, it turns out that ifndef SOME_VAR is true for SOME_VAR defined to an empty value. This is unusable for caching, so replace it with ifeq ($(origin SOME_VAR),undefined).

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-28 15:24:13 +01:00
ec31e48b47 Release 1.0.0-158@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-27 00:15:54 +00:00
9e052f9082 Start version: 1.0.0-158
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-27 00:15:27 +00:00
f6ed191d73 jw.pkg.App.get_modules_from_project_txt(): Add Scope

Add the Enum "Scope" to denote the scope argument of jw.pkg.App.get_modules_from_project_txt(), because it explains itself better than an integer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
bf4834085e jw.pkg.App: Annotate add_modules_from_project_txt()

Type-annotate add_modules_from_project_txt()'s parameter list.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
5cdc32abd7 jw.pkg.App: Add lru_cache where possible

ResultCache is a home-grown result cache. The @lru_cache decorator, now available in Python 3, accomplishes the same thing, so try to ditch ResultCache for it.

Sadly, this doesn't entirely work as of now, because it uses hash() to hash the arguments, which won't work for the two list-type arguments to add_modules_from_project_txt() (buf and visited).

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
a377745e5e jw.pkg.App: Make member variables private

With the exception of top_name, which cmds.project.GetVal needs read-access to, all member variables of jw.pkg.App can be made private.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
dd5adbfcfc create-mkspec.sh: Use jw-projects.py os-cascade

In the os_cascade() function, don't roll own logic, call the richer jw-projects.py projects os-cascade instead.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
917f56a814 CmdBuild: Don't use App.res_cache()

App.res_cache should be private. It's needed here to cache the results of a function which is private to CmdBuild anyway, so solve that with lru_cache, to allow App to do it's private thing with caching.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
eafed6434b CmdBuild: Don't use App.dep_cache

App.dep_cache is only used by CmdBuild, prepare for removing it from App.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
95fa2f0d06 jw.pkg.App: Remove .debug() and friends

Replace the jw.pkg.App.debug(), .warn() and .err() methods by the global log() function. There's no obvious benefit in having App know what's logged.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00