Commit graph jw-pkg/make/projects-dir.mk
Author SHA1 Message Date
d306e8cbdc
projects-dir.mk: Support check targets
Add support for the targets "check" and "check-post" to
projects-dir.mk to make them usable from inside the projects
directory.

Note that "check-pre" is intentionally left out: Running "make check"
in a project before its prerequisite projects have built their
__init__.py files will fail due to broken import resolution.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:38:04 +02:00
e1ccbc1115
projects-dir.mk: Add target test
projects-dir.mk lacks a "test" target, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-07-24 13:36:46 +02:00
d31768cbef
projects-dir.mk: Fix: clean-dirs does too much
The clean-dirs target does not only clean the repos present in
PROJECTS, but all repos it finds to be dirty, and clean-all-dirs does
the opposite. I suppose that was an oversight, swap their recipes.

Moreover, cleaning all directories goes about its business in an
overly complicated and unecessarily time-consuming way, fix that,
too.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-24 21:43:11 +02:00
ca72c21293
projects-dir.mk: Remove "-l user" in ssh-wrapper.sh
By the time projects-dir.mk is used during onboarding, it's already
cloned, and so is jw-pkg in all its glory. So better use a
ssh-wrapper.sh directly under jw-pkg's version control instead of
plainly generating one with echo some-script-logic > ssh-wrapper.sh.

This has the main benefit of allowing a more elaborate script.  The
one added by this commit removes "-l user" from remotes which have a
standard-user@gitserver form, typically because they differentiate
users via their SSH pubkeys only, and which would deny access if both
-l user and standard-user@ were specified.

ssh-wrapper.sh still needs to be a target which is updated by a
recipe, because the version found in jw-pkg can't be trusted to be
executable during bootstrapping, because "make all" has not run, yet.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-06-07 12:06:02 +02:00
b038baf668
topdir.mk / projects-dir.mk: Add get-pub
Add get-pub for top directory / projects directory level. This is a
janware specific target needed for CI. It integrates the current
master branch from the new Forgejo-based Git repos.

That said, this will likely need to go along with other release
machinery. Packaging is good, but releasing over a bunch of
directories is an intricate process, as-is only usable by janware
itself, and doesn't need to be part of jw-pkg.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-14 12:44:04 +02:00
f6f6e56943
make / scripts: git.janware.com -> devgit.janware.com
janware upstream development server moved from git.janware.com to
devgit.janware.com. This commit follows the move with pretty much a
simple

	s/git.janware.com/devgit.janware.com/

over jw-pkg. It found 14 matches, that's pretty bad.

FIXME: Reduce the redundancy, or, better, replace the
devgit.janware.com goodies by a more generally useful concept
altogether.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-12 15:15:29 +02:00
ff29d1f863
projects-dir.mk: push --force-with-lease
To make it easier to force-push feature branches, allow that, albeit
under --force-with-lease protection.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 17:37:53 +02:00
38f13e922a
projects-dir.mk: git-show-ahead-of-master: Add target
Add a new target git-show-ahead-of-master, which does what
git-show-pushable did up to now: List all repos where the currently
checked-out branch is ahead of origin/master.

git-show-pushable now shows repos that have their checked-out branch
ahead of their respective upstream branches. Which is truer to what
the target's name suggests.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-05-05 17:22:14 +02:00
514d66dac1
cmds.distro.CmdInfo: Rename to cmds.platform.CmdInfo
Rename command "distro" to "pkg" together with "info", its last
remaining subcommand. "distro" is often used in the sense of "Linux
distribution", which would be too narrow for the targets jw-pkg could
theoretically support.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:55 +02:00
5830984bfc
cmds.distro.CmdXxx: Rename to cmds.pkg.CmdXxx
With the exception of the "info" subcommand, nearly all of distro's
subcommands deal with package managing, so push them into their own
command category.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 16:53:55 +02:00
c1e76bdd81 projects-dir.mk: Get with --create-remote-user-repos
pgit.sh get is not invoked with --create-remote-user-repos by
default. For the janware Git servers, this makes CI fail over new
repos: Repos from the maintainers are pulled, but before
pkg-rebuild-reinstall, repos that the devops user has no remote repo
for are purged again and are subseqently missing during build.

Passing --create-remote-user-repos to all pgit.sh get invocations
should fix the problem, so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-24 09:02:52 +00:00
30c4d7101f projects-dir.mk: list-files: Don't use /usr/bin/file
/usr/bin/file <candidate> | grep text is used to detect if a file is
a text file or not. Replace that with grep -I., because that adds
some files left out by /usr/bin/file, notably systemd service files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-11 14:50:44 +02:00
160cb993df projects-dir.mk: Add git-show-pushable
Rename git-show-pushable-master-branches to git-show-pushable,
because, the target's recipe doesn't show pushable master branches,
but all commits in the working directories current branch not present
in origin/master.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 18:57:40 +02:00
fe5f343536 projects-dir.mk: Re-enable persistent SSH connections
This reverts commit 88e81 and effectively re-enables persistent SSH
connections to speed up builds.

    commit 88e8197ed7
    Author: Jan Lindemann <jan@janware.com>
    Date:   Thu Apr 20 20:00:46 2017 +0000

    projects-dir.mk: Partly disable persistent SSH

    Don't use persistent SSH-connections any more for "pkg-" targets,
    because, sadly, this hangs after uploading a package.

This commit puts some safeguards against hanging SSH into place,
namely setting default SSH timeouts down, SSH keepalive, setting SSH
BatchMode to yes.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 18:57:16 +02:00
1d17d16519 projects-dir.mk: Retire BUILD_PROJECTS
Use DEP_PROJECTS instead of BUILD_PROJECTS everywhere. DEP_PROJECTS
considers more projects, and for all targets it is relevant to, it's
desirable to have them operate on the maximum blast radius.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-04 16:15:38 +02:00
5916dca0c5 projects-dir.mk: Add variable DEP_PROJECTS
make git-show-pushable-master-branches misses projects which should
better be pulled in as dependencies. It searches $(BUILLD_PROJECTS)
for repositories with pushable commits, that variable leaves some
out, and DEP_PROJECTS has them. It make use of the renovated
pkg-requires command.

This move should be extended to other uses of BUILD_PROJECTS as well,
after giving it some test runs. And the legacy and redundant command
prereq should be removed.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-04-03 19:07:44 +02:00
27bf98f747 pgit.sh: Beautify logging
Log to stderr and add some ASCII-art around the output. Also, add a
--porcelain option to allow more stable output parsing. Subsequently,
use that option in make targets parsing the output, notably make diff
and make git-show-xxx.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-27 09:16:14 +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
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
84f1ad66f6 topdir.mk / projects-dir.mk: Remove BASE_PKGS
Move the dependencies listed in BASE_PKGS from projcts-dir.mk and
topdir.mk into project.conf.

Due to various hen-and-egg problems on a minimal system, in some
situations these packages can't be installed from project.conf. The
same is true with BASE_PKGS, however, so remove it, at least that
does away with some redundancy.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 14:58:54 +01:00
e56befb1c3 projects-dir.mk: No time -p on JW_PKG_PY_PROJECTS
Don't prefix JW_PKG_PY_PROJECTS with time -p. A timing summary shows
up in too many places unexpectedly, e.g. in the context of the target
update-text-files. Add back later as more concrete demand comes up.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:30 +01:00
d652731624 projects-dir.mk: Fix list-files' recipe
Remove echo realpath PROJECTS_MAKEFILE_NAME from the list-files
recipe. Misguided on more than one level.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-15 10:40:05 +01:00
3e897f4df8 lib.Distro, ExecContext: Add classes, refactor lib.distro
The code below lib.distro, as left behind by the previous commit, is
geared towards being directly used as a command-line API. This commit
introduces the abstract base class Distro, a proxy for
distribution-specific interactions. The proxy abstracts distro
specifics into an API with proper method prototypes, not
argparse.Namespace contents, and can thus be more easily driven by
arbitrary code.

The Distro class is initialized with a member variable of type
ExecContext, another new class introduced by this commit. It is
designed to abstract the communication channel to the distribution
instance.  Currently only one specialization exists, Local, which
interacts with the distribution and root file system it is running
in, but is planned to be subclassed to support interaction via SSH,
serial, chroot, or chains thereof.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-06 14:56:46 +01:00
0cf4b29cfb scripts/get-os.sh: Remove
Remove the now obsolete get-os.sh from jw-pkg. Use "jw-pkg.py distro
info" to get the information it used to provide.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
c241634cf1 projects-dir.mk: Replace get-os.sh by jw-pkg.py distro info
To reduce redandancy, replace get-os.sh by jw-pkg.py distro info in
projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-03-02 12:55:36 +00:00
fbeefa2d9e projects-dir.mk: Add target get-official
Follow the pattern of get-maintainer, and add that target to
projects-dir.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:20:25 +01:00
9449840401 projects-dir.mk, topdir.mk: Alias get-% for git-get-%
Add a VCS-independent rule rule get-%, currently an alias for
git-get-%, with an empty recipe to keep GNU Make satisfied.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:18:09 +01:00
aa8d1cbfc6 projects-dir.mk: get-get-%: Merge into current branch
Don't use the master branch as target when getting code from
somebody, merge into the branch currently checked out.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-26 15:18:09 +01:00
5a3299b1c6 projects-dir.mk: Add [git-]get-maintainer
Add targets to update all repositories from their respective
maintainers.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 15:53:27 +01:00
f86634a1d1 pgit.sh: Rename command "clone" to "get"
"clone"  in the Git sense means to copy a remote project over from
scratch. pgit.sh clone has come from that, but has since evolved into
something different, a mixture of clone, pull and fetch, so find a
different name. "get" seems generic enough and doesn't clash with a
Git meaning. Adapt variable names accordingly across the project.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-02-21 15:53:25 +01: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
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
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
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
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
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
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
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
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
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
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
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
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
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
5bdd917abc rpmdist.mk: pkg-release ignores PACKAGE_VCS_FILES
PACKAGE_VCS_FILES is only considered by pkg-rebuild and ignored by
pkg-release. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-23 13:17:38 +01:00
82b875cde9 projects-dir.mk: Disable --create-remote-user-repos
--create-remote-user-repos had been disabled in
4053451bfd on the grounds that it's
hard to test and possibly superflous. It actually is not superfluous,
as devops builds show, and that's a valid test-case, so re-enable it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-12-13 09:05:14 +01:00
c3c6cdc446 purge-stale-projects.sh: Support --vcs
Support option --vcs. CVS is retired, but worked well as a test case
for mixing multiple version-control systems in one tree.

purge-stale-projects.sh is still pretty ugly and will have to go, but
its API might still serve as a working template.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-29 13:28:51 +01:00