Commit graph

4,207 commits

Author SHA1 Message Date
82b41ffce2 pgit.sh: Beautify variable names some more
Continue to name variables in pgit.sh somewhat more consistently,
notably turn somevar into some_var. Plus some additional cleanup.
Still not a beauty.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 14:10:34 +01:00
b9e1f91ff6 pgit.sh: Don't show fat header for one project
The fat marker with counter (# ==== [1/1] Fetching ...) is
distracting if shown for only one project, so only show a regular
marker without counter.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 12:13:11 +01:00
b758bc80cf Release 1.0.0-168@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-21 03:58:35 +00:00
f49fd47967 Start version: 1.0.0-168
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-21 03:58:02 +00:00
8074abad5d projects-dir.mk: Fetch to current branch by default
To be explicit about what's happening during make fetch, default the
fetch refspec to $(CLONE_FROM_USER):current-branch:current-branch.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 04:21:34 +01:00
93b2a2f222 pgit.sh: Support refspec keyword current-branch
If "current-branch" is specified within --refspec, either as from-ref
or as to-ref, expand that to the branch the working directory has
currently checked out.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 04:14:59 +01:00
e5e0cf9930 jw.pkg.lib.Cmd._run(): Call parent._run()
jw.pkg.lib.Cmd._run() is abstract, but it's nice to give it a default
implementation which calls self.parent._run() in case parent is also
a command class. That allows for some default processing in _run()
for each node up the parent chain.

The children / derived classes just need to make sure all classes in
the hierarchy do:

    async def _run(self, args):
      return await super()._run(args)
      ... add main command logic here ..

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-20 19:30:22 +01:00
6916d7edc8 jw.pkg.lib.util.run_sudo(): Add parameter verbose
Add parameter verbose to run_sudo() and pass it on to run_cmd().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-20 19:30:22 +01:00
d004e2c5ec Release 1.0.0-167@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-20 00:37:29 +00:00
4ced42a186 Start version: 1.0.0-167
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-20 00:36:38 +00:00
ada7e7572f topdir.mk: git-pull-%: Always use pgit.sh
git-pull-<username> doesn't use pgit.sh if username == login.
pgit.sh should handle that case fine now, so remove the distinction
from topdir.mk and make it in one place, i.e. pgit.sh. This has the
additional advantage that pull as done by pgit.sh conveniently uses
--autostash.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 19:38:16 +01:00
f38abb9057 pgit.sh clone: Merge code path "from-user == login"
The cases from-user == login and from-user != login have different
code paths and can be streamlined somewhat, so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 19:37:17 +01:00
01bf027070 Release 1.0.0-166@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-19 07:59:26 +00:00
b4e58b7d4a Start version: 1.0.0-166
Signed-off-by: janware DevOps <devops@janware.com>
2026-02-19 07:53:20 +00:00
f1bb90423f projects-dir.mk: Keep HOME in reinstall's env
Add HOME back to environment for pkg-*install*-like targets.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 08:46:44 +01:00
0c0617d794 projects-dir.mk: Keep SSH_AUTH_SOCK in reinstall's env
Purging the environment of pkg-release-reinstall did a tad too much:
Add SSH_AUTH_SOCK back to allow SSH agent-based authentication to go
through.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 08:22:43 +01:00
d814052aac jw.pkg.cmds.projects.CmdBuild: --source-profile -> --env-reinit
Replace --source-profile by --env-reinit and --env-keep to allow more
fine-grained control over environment manipulation.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-19 08:22:43 +01:00
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