Commit graph

265 commits

Author SHA1 Message Date
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
7d1ff5c6e6 projects-dir.mk: Default PGIT_CLONE_FROM_USER to janware
Clone from user janware if JANWARE_USER is not defined.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:02 +01:00
fe81bd209e projects-dir[-minimal].mk: Don't default JANWARE_USER
Do not set JANWARE_USER to $(id -un) in case it's undefined. Instead,
rely on it being set explicitly in the environment if so desired.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:44:57 +01:00
370c7e499e projects-dir.mk: Conditionally pass --create-remote-user-repos
Pass --create-remote-user-repos to pgit.sh clone in case JANWARE_USER
is defined, restoring the original behaviour.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 16:39:52 +01:00
0c9fd98009 projects-dir.mk, scripts/Makefile, jw-pkg: Move jw-pkg from jw-build to jw-base
jw-pkg is related to, but strictly speaking not indispensible for building and
packaging software. So, in the attempt have a minimal jw-build, move jw-pkg to
jw-base, and fix all packages that use it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:05:43 +01:00
36092d6b1b projects-dir.mk: Make list-files ignore errors
Make list-files target ignore errors. This catches errors from
git ls-files | xargs realpath if git ls-files lists dead symbolic
links, as in my-project/blah/dev/fd -> ./proc/self/fd.

Implemented by passing -q (quiet) to realpath, not sure what else
this suppresses.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 12:34:14 +01:00
67fb954f3e projects-dir.mk: Remove CVS support
Now that CVS is finally retired for building multiple projects from
VCS, remove support.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 10:22:35 +01:00
fbc9e3a001 make, scripts: Rename projects.py -> jw-projects.py
projects.py is too unspecific, rename it to jw-projects.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-15 12:06:38 +01:00
aa3e2efd84 projects.py: Move bulk of code into module
Move nearly all of projects.py into src/python/jw/build/App.py. The
plan is to split the script into parts and import them.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-15 11:08:52 +01:00
df9a4e6a40 projects-dir-*.mk: Re-add files necessary for building projects directory
Re-add everything necessary for recursively building all repos in
a directory, e.g. as a build controlled by janware.com/Makefile or
any other installation.

This adds 489 lines of code which can (and should) be massively
reduced, notably removing code supporting CVS.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-13 16:23:35 +01:00
bc883deed4 Everywhere: Remove everything non-essential for "make clean all"
This commit removes everything not strictly necessary for running
"make clean all" inside jw-build.

packaging jw-devtest. This cuts the repo down from 24077 to 4725
lines of code.

The idea is to

1) Further remove bloat from the remaining bits

2) Re-add what's necessary to build and package other essential repos.

   The decision should be based on whether or not jw-build can also be
   useful in a non-janware context.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-14 15:02:56 +01:00
cea804eac4 projects-dir.mk: Remove Makefile from CVS/Entries
The projects toplevel Makefile is not maintained in CVS anylonger but
in Git, so don't update it from CVS any longer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-11 16:58:22 +01:00
9147a78f2e projects-dir.mk: Don't hardcode Makefile name
"Makefile" is used in dependency checks within projects-dir.mk. Since
it might be included from projects-dir-minimal.mk, which also works
with "GNUmakefile", make this fallback of a predefinable variable,
PROJECTS_MAKEFILE_NAME.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-06 16:51:10 +01:00
51c1a1508d projects-dir.mk: Support JWBDIR_NAME and JWBDIR_SEARCH_PATH
Adapt projects makefile to match the mechanism all proj.mk's are
supposed to find their JWBDIR. Namely make JWBDIR_NAME a
conditionally assigned variable to allow for some testing of
alternative jw-build trees.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-05 12:49:29 +01:00
349f1d2602 Makefile: Add target text-files-list-0
text-files-list-0 returns a zero-delimited list of text files for further
processing, which allows to correctly handle spaces in file names

Signed-off-by: Jan Lindemann <jan@janware.com>
2024-12-09 08:31:32 +00:00
2989cc87c8 Makefile: JWB_SCRIPT_DIR: Add support for /opt/jw-build/bin
Signed-off-by: Jan Lindemann <jan@janware.com>
2024-07-16 15:21:15 +00:00
a343cf7806 pkg-install-%-deps: Protect projects from shell with quotes
Project names passed to the package manager can contain characters
not well digested by the shell. Don't let it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2024-06-30 17:01:18 +00:00
19bc4037c0 Makefile: Make list-files consider build dependencies, too
Signed-off-by: Jan Lindemann <jan@janware.com>
2024-06-25 17:35:35 +00:00
4ebe82970f projects-dir.mk: Make INTERACTIVE=true default
Signed-off-by: Jan Lindemann <jan@janware.com>
2020-11-30 13:32:30 +00:00
5e9168480a project-dirs.mk / pgit.sh: Add support for offlining projects
This adds support for the variable OFFLINE_PROJECTS in projects-dir.mk and the
PGIT_IGNORE environment variable. Both go hand in hand and do what their names
insinuate. OFFLINE_PROJECTS is initialized from EXCLUDE_FROM_BUILD, which in
turn is initialized from exclude.txt and friends.

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-05-10 08:07:22 +00:00
3e99fe51cd projects-dir.mk: Don't do git-pull.done before git-pull-%
Use cvs-update.done instead of git-pull.done as prerequisite
of git-pull-%, because otherwise broken remote own repos
might not be recoverable

Signed-off-by: Jan Lindemann <jan@janware.com>
2020-03-23 08:13:14 +00:00
9370121c65 Fix: Tried to purge on first download without jw-build present
Signed-off-by: Jan Lindemann <jan@janware.com>
2020-01-20 09:21:35 +00:00
20e599c049 projects-dir.mk: Add python3 to BASE_PKGS
Signed-off-by: Jan Lindemann <jan@janware.com>
2019-12-10 18:51:39 +00:00