Commit graph

4,490 commits

Author SHA1 Message Date
b3fd624a3f jw.pkg.lib.util.get_profile_env(): add -> keep

Replace the boolean parameter "add" with the richer "keep":

- False -> Don't keep anything - True -> Keep what's in the current environment - List of strings -> Keep those variables

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 07:52:53 +01:00
fc80bde804 topdir.mk: git-init et al: Change commit message

Change commit message of first commit from "initial checkin" to "First commit", because that's more to the point.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 19:21:14 +01:00
48664724ce project.conf: Remove sudo and gawk from run deps

sudo is certainly not needed for the run package (which in itself is hardly useful at all), so move that dependency into the devel package. Same for gawk. /opt/jw-pkg/bin/get-os.sh depends on it, but I don't see where else but in a -devel context that would matter. And if it breaks something, it is going to be an easy fix without awk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 18:20:33 +01:00
3ad021f071 projects-dir.mk: reinstall with --source-profile=replace

--source-profile=replace should be passed to all

jw-pkg.py projects build pkg-*install

invocations. Those invocations typically happen in the context of pkg-%install, so add that target, specializing the pkg-% target.

The problem this solves is that /etc/profile is currently read only once before bootstrapping all software on a pristine system is started. This might lead to the situation that package A has installed environment variable definitions into /etc/profile.d, package B needs them for building, but never gets to read them.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 14:44:57 +01:00
230eacac8b jw.pkg.cmds.projects.CmdBuild: Add --source-profile

Add --source-profile=[no|add|replace] to the projects build command, doing the obvious thing.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 14:22:27 +01:00
2d1beeebb0 jw.pkg.lib.util.get_profile_env(): Add function

Add a function get_profile_env(), a function returning environment variables from /etc/profile. Pass add=True to add its contents to the existing environment dictionary, overwriting old entries, or pass False to get the pristine content.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 14:18:46 +01:00
e104fa2e46 jw.pkg.lib.util.run_cmd(): Add output_encoding

Add a parameter "output_encoding" to run_cmd(). The parameter allows the caller to specify if the output encoding should be detected as is by passing None (the default), if the output should be returned as undecoded bytes by passing the special string "bytes", or if the output should be treated as the encoding with the specified name and decoded to strings.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 13:38:12 +01:00
82c6a44ad6 jw.pkg.lib.util.run_cmd(): Fix mode:auto

In cmd_input == "mode:auto", the interactive variable is currently not set due to a typo. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 13:31:26 +01:00
f8dc8ee6d1 jw.pkg.lib.util.run_cmd(): Honour env in PTY mode

The evironment passed to run_cmd() via env is currently not honoured with mode:interactive. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 13:29:48 +01:00
838b745581 jw.pkg.cmds.projects.CmdBuild: Use run_cmd("make")

Use run_cmd() for centralized process handling, instead of hand-rolled Popen().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 11:37:40 +01:00
0cb6a7972c jw.pkg.cmds.projects.CmdBuild: Make run_make() async

Make the call chain to Popen(make ...) async, in preparation for the next commit.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 11:36:14 +01:00
75faf02232 jw.pkg.lib.util.run_cmd(): Add title parameter

Allow the caller to choose which title should be used for the command's logging output box.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 11:31:53 +01:00
7eb15f2477 jw.pkg.lib: Don't log {e}

Don't log an Exception as {e} but as str(e) producing nicer output. Or as repr(e) if a backtrace is requested, because to people who can read backtraces, type info might be of interest. Also, remove pointless time stamps, those belong into the logging framework.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 11:31:13 +01:00
78d49edfeb pkg.sh: Fix rpmbuild %attr(links) warning

dc945537 (pkg.sh log-install: Log %attr(0777, ...) for links) fixed packaging symlink for Debian-based distros, but produces a warning on RPM based distros: Links may not have explicit attributes, so go back to not specifying them at all for RPM.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 11:00:35 +01:00
55c114582d Release 1.0.0-165@suse-tumbleweed/x86_64 2026-02-18 00:52:25 +00:00
baad8f8646 Start version: 1.0.0-165 2026-02-18 00:51:53 +00:00
c569b188a4 rpmdist.mk: Add target pull-maintainer

To complement git-pull-maintainer with something more generic, also suitable for other SCMs, add the target pull-maintainer and make pkg-release-reinstall depend on it. Currently only visible in the context of pkg-% targets, scope might be expanded if need be.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
5e040f652e topdir.mk: Use pgit.sh for git-pull-%

Use pgit.sh to for the git-pull-% target. This should make git-pull-maintainer work. To limit the blast radius for now, only use it if the source user differs from the invoking user.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
d7f9fc7260 CmdAuthInfo: Fix no output

jw-pkg.py projects get-auth-info doesn't print anything, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
7f85a5f2d6 projects+project.mk: Add file

Multiple variables are redundantly defined both for a project and for the multiple-projects toplevel directory. Add a place to maintain them centrally, and add PGIT_SH as a first variable.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
0e4ab928de projects-dir-minimal.mk: Add target init

Add an init target. Use it if you want to tell the Makefile: _Just_ initalize the build machinery and nothing else, don't pull and build everything else you can. Not strictly necessary, most of the time pulling everything is what's wanted, and that does the init anyway.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
2f50092e19 projects-dir.mk: Add target pkg-delete-ours

The target pkg-delete-ours, invoked from the projects directory, should wipe all packages from the system which have been created and installed via jw-pkg.

Currently they are selected via url =~ janware. This is a default string which can be overridden by redefining JANWARE_PACKAGE_FILTER. This might not be the most generic name, but is kind of consistent and will be matched once all variables get renamed to a more generic naming scheme.

This currently does not get all packages: Some are not labeled with URLs matching "janware", because jw-pkg is only used as a convenient way to package other people's open source projects.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
4153fa7c05 jw.pkg.cmds.distro.CmdDelete: Add command

Add command to delete named packages, along with an implementation for OpenSUSE.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
3ceb2b71b7 jw.pkg.cmds.distro.CmdSelect: Add command

Add the sub-command select to jw-pkg.py distro, along with an Implementation for OpenSUSE.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
81833e049a jw.pkg.cmds.distro.lib.rpm: Add module

Add a place to bundle utilities for RPM-backed distributions.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
18747b8254 jw.pkg.cmds.distro.lib.Package: Add class

Add a package metadata abstraction.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
6c98c9b650 jw.pkg.cmds.distro.lib: Add Module

Add a place to for distribution related utilities.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
f991bbfcd9 jw.pkg.cmds.distro.backend.suse.Util.rpm(): Add method
Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:26 +01:00
421e75fc91 jw.pkg.cmds.distro.backend.*.Util: Backend -> ..Util

Derive all jw.pkg.cmds.distro.backend.*.Util classes from the common base class jw.pkg.cmds.distro.backend.Util.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
3c8f57f636 jw.pkg.cmds.distro.backend.Util: Add class

Add a common base class for all jw.pkg.cmds.distro.backend.*.Util classes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
7181849002 jw.pkg.cmds.distro.backend.*.*: Util -> BeXxx

Don't derive the Backend classes from distro-specifiy Util classes anylonger, but from command-specific BeXxx base classes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
63395f414f jw.pkg.cmds.distro.backend.*.*: Use util

Don't call self.some_utility() anylonger, make it self.util.some_utility().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
82e92ac068 jw.pkg.cmds.distro.backend.Backend: Add property util

Add a property .util to the Backend class, instanciated on demand from to the respective distribution directory's Util class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
78835ecc9c jw.pkg.cmds.distro.Cmd: Add property util

Provide a property .util from Cmd, instanciated on demand from to the respective distribution directory's Util class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
05f3f33931 jw.pkg.cmds.distro.backend.*.Base -> Util

Rename the class Base of all distribution backends to Util. It contains distribution specifics, but is not going to be the base class anymore shortly.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
2cc3b59e75 jw.pkg.cmds.distro.backend.BackendCmd -> Backend

Rename jw.pkg.cmds.distro.backend.BackendCmd to Backend, because it's not necessarily a command, i.e. doesn't necessarily have a run() method. It's more of a distribution abstraction of the steps needed for for a specific command, the run() method itself is implemented in jw.pkg.cmds.distro.CmdXxx.

This commit is the beginning of a bigger move to change the distribution backend class hierarchy. At the end of this change set, the backend command should not derive the backend classes from a base specific to the respective distribution, but from an abstract base class specific to the command run. The distribution specifics are then going to be encapsulated in another class called "Util", an instance of which is going to be provided to the backend as .util member.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
b1d4e20295 jw.pkg.util: Add sudo()

Move the body of BackendCmd.sudo() into a function. The rationale behind that is that its functionality is independent of the calling object for the most part, so having it in a function instead of a method is the more modular pattern.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
cb3ccaa338 pgit.sh: Auto-detect current project in toplevel dir

This commit allows pgit.sh to target not only multiple projects below a projects-directory, but also one single project. If invoked from the toplevel directory of a project, it uses that as the only project it should deal with. This is meant to facilitate running the same VCS abstraction logic for one project as for many projects. The project or projects to deal with should probably be specified on the command line, but changing the auto-detection mechanism buys us what we want for now with low hassle.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
f28ee62209 pgit.sh: Make some (!) variable names less messy

Some variable names are too short for global scope ($p, $pdir, $pdirs), among others. For those mentioned: Make them longer and more descriptive.

Also add a variable project_name, which denotes what a project is in a remote repository, and which is currently but not necessarily always the same as the project directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-18 01:20:25 +01:00
9f66cd9c2b Release 1.0.0-164@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-16 00:13:31 +00:00
479e407dcd Start version: 1.0.0-164
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-16 00:12:59 +00:00
2d08c2a12d jw.pkg.App.os_cascade: Add more fields

Add more fields to the OS cascade returned by App.os_cascade, based on the ID field in /etc/os-release. This includes some new ones, prefixed by pkg-, revealing which package format is used.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:13:21 +00:00
26e739ca0d src.python.jw.pkg.App: Add property distro_id

Add @property App.distro_id, returning the ID field of /etc/os-release. It is supposed to be the most specific part of the OS cascade.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:13:21 +00:00
bdb6ae69b3 apt-get install: Add --fix-broken to commandline

apt-get install suggests it wants to be called with -f to clean up some mess left behind from a previous install. Adding -f in the hope add it to the install options by default. OTOH, it wants to be called that without arguments, not sure if always passing it along is a good idea.

The man page says:

-f, --fix-broken

Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.

Also turn the short options -yq into long options --yes --quiet for more obvious debugging if something goes awry.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:13:12 +00:00
c84e119e6f pkg.sh milk-install-log: Clean up Debian filters

Among other atrocities, the Debian path filter contains some horrible redundancies in an sed regular expression. Be a little less redundant about it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:04:59 +00:00
dc94553732 pkg.sh log-install: Log %attr(0777, ...) for links

Not logging any attribute for links, as it's now, breaks Debian's parser. So, log %attr(0777, $owner, $mode). This fixes the parser on the Debian side and hopefully leaves the RPM side intact.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:04:45 +00:00
93c24c657d pkg.sh log-install: -f package-format is ignored

pkg.sh log-install ignores the -f option passed to pkg.sh, and always defaults to "rpm". Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:04:39 +00:00
37b436c04f defs.mk: Pass -f $(PKG_FORMAT) to pkg.sh log-install

pkg.sh log-install needs to know what package format it should log an install for, so specify it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-15 16:04:33 +00:00
143096663d Release 1.0.0-163@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-15 00:12:40 +00:00
f47dd2a8d7 Start version: 1.0.0-163
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-15 00:12:03 +00:00