Commit graph

4,077 commits

Author SHA1 Message Date
0b83c863a2 jw.build.cmds: Move build.cmds -> cmds.projects
Reorganize the Python module structure. Placing the command classes
under jw.cmds.projects instead of jw.build.cmds will allow to add a
nested command structure, with the current commands, being mostly
related to building software, found below a "projects" toplevel
command.

Other conceivable commands could be "package" for packaging, or
"distro" for commands wrapping the distribution's package manager.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
c8c5788aeb jw.pkg.App.proj_dir(): Return absolute path
Make App.proj_dir() return an absolute path. This looks like a good
idea, because some of the $(call proj_query xxx) paths end up being
relative, because they get proj_dir()'s idea of a directory
prepended. This prohibits caching them in $(TOPDIR)/make/.cache.mk
for make benefit glorious nation of performance.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
adb9837c63 jw.pkg.App: Remove --debug option
Remove the --debug option, which is superseded by the semantically
richer --log-level debug in the base class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
737f3986df jw.pkg.App: Use lib.log
Replace print() by log().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
1f26391452 jw.pkg.cmds.Cmd: Derive from lib.Cmd
The body of Cmd is pretty much entirely obviated by its base class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
e39047e0dd jw.pkg.App: Derive from jw.pkg.lib.App
Derive jw.pkg.App from jw.pkg.lib.App. App.run() dissolves as follows:

  - Its sub-command invocation logic is left to the base class
  - parser.add_arguments() are moved into self._add_arguments()
  - So is handling of early-parsed arguments
  - async def _run() is reimplemented to set some member variables

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
0be02c7154 lib.App, .Cmd: Add modules
Add App and Cmd as generic base classes for multi-command
applications. The code is taken from jw-python: The exising
jw.pkg.App is very similar to the more capable jwutils.Cmds class,
so, to avoid code duplication, add it here to allow for jwutils.Cmds
and jw.pkg.App to derive from it at some point in the future.

Both had to be slightly modified to work within jw-pkg's less
equipped context, and will need futher code cleanup.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
18467a6500 lib.Types: Add module
Types is a container for types, notably classes, which are
dynamically loaded from other modules. Which modules are loaded is
based on the following criteria passed to its constructor:

  - mod_names: A list of modules to load and investigate

  - type_name_filter: A regular filter expression or None (default).
    If it's None, all types pass this filter.

  - type_filter: A list of types the returned types must match.
    Defaults to [], in which case all types pass this filter

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
f7cc364be2 lib.log: Add module
A dedicated logging module is currently provided by jw-python, but
since it's often needed also in jw-pkg, and it's relatively small and
maintainable, it seems justified to move it into jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
2e69639362 jw.pkg.build.lib: Move to jw.pkg.lib
In preparation of reorganizing the tree below cmds, move the lib
subdirectory a level up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
eb2dd919a1 cmds.CmdGetval.add_arguments(): Don't use app.top_name
CmdGetval.add_arguments() uses self.app.top_name, which may or may
not be initialized at the time this runs. Not using it makes
CmdGetval's ctor safe to run in the context of App.__init__().

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
f869b5aaca defs.mk: Define Q and use it in *.mk
Define Q ?= @, and replace @<command> in recipes by $(Q)<command>.
Meant to be overridden from the environment for debugging as in

  Q= make

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:58:23 +01:00
6ba9b2079d projects.mk: PROJECTS_PY_EXTRA_(ARGS->OPTS)
Rename the variable PROJECTS_PY_EXTRA_ARGS to PROJECTS_PY_EXTRA_OPTS
to be consistent with projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
58ae1b68ca py-defs.mk: Remove PY_PREREQ_BUILD[_DIRS]
Remove PY_PREREQ_BUILD and PY_PREREQ_BUILD_DIRS from py-defs.mk:
Apparently they're not used anywhere, and are costly in terms of
directory startup time.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
f05e1ee0e3 make/[Makefile|*.mk): Improve variable caching
This commit aims at improving speed by using better caching.

  - Makefile, cache.mk: Split .cache.mk up

    To allow caching of runtime path variables which are
    project-specific, split .cache.mk up in .cache-project.mk and
    .cache-projects.mk

  - ldlibpath.mk: Cache ldlibpath, exepath and pythonpath

    Place the output of $(call proj_query ldlibpath), $(call
    proj_query, exepath) and $(call proj_query pythonpath) in
    JW_PKG_LD_LIBRARY_PATH, JW_PKG_EXE_PATH, and JW_PKG_PYTHON_PATH
    respectively, and cache the variables in make/.project-cache.mk.

  - cache.mk: Use = instead of :=

    Recursively expanded variables are nearly as fast as := variables
    if the assigned value is a fixed string. And sometimes it's not,
    rightly so, because variables get assigned below, as with
    JW_PKG_XXX for instance.

  - cache.mk: Use $(TOPDIR) as variable values

    Replace absolute references to project's topdir by $(TOPDIR) with
    sed. As soon as the project queries produce absolute paths, they
    will be transformed into relative paths which allow the code base
    to be moved to a different location and still remain functional
    without a rebuild.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
19d0397b34 make/Makefile: Remove cruft + CACHED_VARS
Remove unused code, and code which actually does something:
CACHED_VARS looks as if it's sufficently and more centrally defined
in make.mk, don't override that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
494d5d29d6 std-targets.mk: Add file
Add std-targets.mk, meant to be included mostly to make sure all
mandatory targets are there. On clean and distclean, it also removes
stuff that should not be there anymore after clean.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
bb44ee11c8 projects-dir.mk: clean-dirs: Remove trailing slashes
clean-dirs passes project names with trailing slashes to projects.py,
remove them.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
1183aed3f5 Revert "scripts: Add __init__.py"
This reverts commit 98188eab23.

__init__.py alone is not enough to resolve the jw module in all
circumnstances, so go back to the old symbolic links solution.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-26 17:17:23 +01:00
c6016b62fd Release 1.0.0-157@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-22 00:10:39 +00:00
7055def54b Start version: 1.0.0-157
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-22 00:10:13 +00:00
18f6d583b4 rpmdist.mk: make check_scm_sync pull from maintainer
Change $(check_scm_sync) from "make git pull" to "make
git-pull-maintainer", which most notably should delegate devops
builds to the maintainer defined in project.conf.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 15:14:34 +01:00
c39c268d98 jw-projects.sh: Fix -p / --prefix help message
--prefix doesn't denote an "App Path Prefix", "Parent directory of
project source directories" decribes it better.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 15:04:48 +01:00
4b4b43193c topdir.mk: Add pkg-install-testbuild-deps
There's little system in the pkg-install-xxx targets, add one more to
increase the confusion. It's needed to install all packages needed to
do a standalone build against the packages installed into the system
via package manager. That said, the respective jw-projects.sh
commands need broader refactoring, as well as the pkg-install-xxx
target naming.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 14:56:08 +01:00
98188eab23 scripts: Add __init__.py
$(TOPDIR)/scripts contains a symbolic link jw -> ../src/python/jw, to
allow jw-python.py access to the in-repo module jw.pkg. Should be
fine now even on Windows, OTOH, it's also solvable via __init__.py,
so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-20 14:56:08 +01:00
d0e5957ec8 Release 1.0.0-156@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-15 15:05:23 +00:00
c05a43b199 Start version: 1.0.0-156
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-15 15:05:23 +00:00
d678bab05a pkg-manager.sh: Support running without sudo
To support minimal environments, notably minimal Docker containers
which don't have /usr/bin/sudo by the time pkg-manager.sh is invoked
(possibly to install sudo), support running all commands without
invoking sudo first. Of course this only works if invoked as root.

Note that this is still somewhat hacky, command-line parsing needs to
be cleaned up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-15 15:05:23 +00:00
57cbb42fcd pkg-manager.sh: Add command dup
Add command dup (dist-upgrade), currently only supported on OpenSUSE.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-15 15:05:23 +00:00
49086708e4 build.cmds.CmdListRepos: Support local repos
Make jw-projects.py list-repos support a local directory as base URL
of all git repositories, notably used by PROJECTS_DIR_REMOTE_BASE,
which can now point to a local directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-15 15:05:23 +00:00
50a19954b4 projects-dir-minimal.mk: Make included targets once
Targets defined by projects-dir.mk are not available before it is
included, but make makes up its mind about what targets are available
after parsing the included makefiles, so remove that redundancy.

On the other hand, a dependency alone is not enough for make to
understand that an included makefile has been remade, it needs a
rule, so add a dummy-rule body. In this case only echoing that the
include file has been provided.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-14 13:05:15 +01:00
34b21041fa Release 1.0.0-155@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-14 04:12:06 +00:00
c2a72039aa Start version: 1.0.0-155
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-14 04:11:38 +00:00
1759266dd6 defs-dist.mk: HTMLDIROWNER wwwrun -> root
Change HTMLDIROWNER from wwwrun to root for the same reason as with
HTMLOWNER: Better security.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-13 15:41:46 +01:00
5a1836998f Release 1.0.0-154@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-07 08:46:10 +00:00
d9c5cb972b Start version: 1.0.0-154
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-07 08:45:43 +00:00
47efb08088 projects-dir.mk: Cope with missing /usr/bin/time
Kali Linux' default installation doesn't have /usr/bin/time which
brings out a but: $(TIME) doesn't expand to nothing but to -p, which
fails miserably, of course. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-07 09:38:50 +01:00
a294c4ec34 projects-dir.mk: Fix pgit.sh lacking --remote-base
PGIT_SH gets added --remote-base, but too late to make it into the
non-recursive variable PGIT_SH_CLONE. This leads to --remote-base
lacking from the clone invocation, and anonymous Git over HTTP
failing because it tries to clone via SSH. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-07 09:35:11 +01:00
81c56c7924 Release 1.0.0-153@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-07 06:12:54 +00:00
7ef11dc222 Start version: 1.0.0-153
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-07 06:12:27 +00:00
93052882de pgit.sh clone: Fetch submodule tags only from origin
To avoid network errors while fetching tags, run

  git submodule foreach --recursive 'git fetch --tags -f origin

i.e. only fetch tags from origin, which by convention points to
git.janware.com.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-06 19:11:01 +01:00
8bdd02fece Release 1.0.0-152@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-06 12:22:16 +00:00
6c08150993 Start version: 1.0.0-152
Signed-off-by: janware DevOps <devops@janware.com>
2026-01-06 12:21:49 +00:00
f090015b48 projects-dir.mk: Fix git-show-pushable-master-branches
make git-show-pushable-master-branches output too litte for two
reasons: 1. grep -q returns zero also if no matches are found, and 2.
PROJECTS doesn't contain all relevant projects. BUILD_PROJECTS is
more meaningful.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-01-06 10:38:33 +01:00
6c315f027e defs-dist.mk: HTMLOWNER wwwrun -> root
HTMLOWNER wwwrun is not a good idea with file mode 0644. The web
server process should not be allowed to write its own executable
files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 20:59:47 +01:00
ba246d51a9 Release 1.0.0-151@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2025-12-23 14:10:24 +00:00
199318ec41 Start version: 1.0.0-151
Signed-off-by: janware DevOps <devops@janware.com>
2025-12-23 14:09:55 +00:00
3af712705d pgit.sh: Run git fetch --tags on submodules
On pull / clone operations, run

 git submodule foreach --recursive 'git fetch --tags'

Notably the Bootstrap package needs the tags to check out different
Bootstrap versions.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 14:06:41 +00:00
490601c9db Release 1.0.0-150@suse-tumbleweed/x86_64
Signed-off-by: janware DevOps <devops@janware.com>
2025-12-23 12:28:14 +00:00
1868908fa7 Start version: 1.0.0-150
Signed-off-by: janware DevOps <devops@janware.com>
2025-12-23 12:27:46 +00:00