Commit graph

287 commits

Author SHA1 Message Date
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
f90f5aeebe Everywhere: Replace "JW_BUILD" by "JW_PKG"
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-28 13:35:56 +01:00
9217d38964 Everywhere: Rename package "jw-build" to "jw-pkg"
jw-build doesn't stop at building software, packaging it afterwards
is also a core feature, so this commit gives the package a better
name.

The commit replaces strings s/jw-build/jw-pkg/ in text files and file
names. Fallout to the functionality is fixed, variable names are left
as they are, though. To be adjusted by later commits.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-28 13:35:56 +01:00
f9f0041790 pgit.sh: Support --login
In the move away from environment variables, replace JANWARE_USER
support in pgit.sh by the --login option.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 10:35:07 +01:00
d047ad650c pgit.sh: Support --refspec
In the attempt to move away from communicating options via
environment variables from one part of jw-build software to another,
replace PGIT_CLONE_FROM_USER with the clearer --refspec option. Which
is also more versatile.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-24 10:04:47 +01:00
4053451bfd projects-dir.mk: Disable --create-remote-user-repos
Creating user repositories is hard to test. Not sure if the concept
will survive the current workflow changes, disable it for now.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 18:10:55 +01:00
561905bab7 projects-dir.mk: Fix empty JANWARE_USER error
JW_BUILD_SSH_EXTRA_OPTS contains a -l $(JANWARE_USER), which make ssh
break if $(JANWARE_USER) is empty. Fix that case.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 16:33:18 +01:00
99dca58e1d projects-dir.mk: Make GIT_ASKPASS absolute
The GIT_ASKPASS environment variable can point to a relative path,
and since pgit.sh currently does a chdir, it needs to be made an
absolute path.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 15:28:05 +01:00
7d436f1c76 projects-dir[-minimal].mk: Go from PROJECTS_DIR_REMOTE_BASE
Currently, the primary discriminating criterion on how to handle a
set of remote repositories is whether or not JANWARE_USER is defined.
The canonical way to do that is PROJECTS_DIR_REMOTE_BASE, though, so
go from that definition.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 13:52:41 +01:00
e1a4746ad5 projects-dir-minimal.mk: Use get-auth-info for JANWARE_USER
Default JANWARE_USER to the user retrieved by jw-projects.py get-auth-info.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:37:07 +01:00
d740f30226 projects-dir[-minimal.mk]: Group PGIT_SH-related variables
Group variables related with pgit.sh (PGIT_SH and PGIT_SH_CLONE)
closer together. Define CLONE_FROM_USER early on.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 21:14:19 +01:00
aac261d782 projects-dir[-minimal].mk: Change usage comment
The usage comments heading projects-dir-minimal.mk and
projects-dir.mk state that for cloning all repositories, JANWARE_USER
needs to be defined. That restriction is now gone, so reflect that in
the comment.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:21 +01:00
69132d9246 projects-dir[-minimal].mk: Support PROJECTS_DIR_REMOTE_BASE
Add the variable PROJECTS_DIR_REMOTE_BASE, defaulting to
ssh://git.janware.com/srv/git if REMOTE_USER is defined, and to
https://janware.com/code in case it isn't.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:55:20 +01:00