Commit graph

4,308 commits

Author SHA1 Message Date
bf6a83ccac build.cmds.CmdListRepos: Fix ssh://git.janware.com

A typo breaks enumeration of Git repos on git.janware.com, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:40:24 +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
1187c10c86 build.cmds.GetAuthInfo: Add module

Add command get-auth-info to jw-projects.py. It is meant to retrieve JANWARE_USER from an already cloned jw-build tree.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:14:43 +01:00
8de4a90796 projects-dir-minimal.mk: Fix linking after package build

Linking the projects-dir Makefile fails if make pkg-rebuild has been run on jw-build, because it leaves another projects-dir-minimal.mk below the dist directory. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-19 08:24:58 +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
b7833c928a pgit.sh fix: --create-remote-user-repos parsed incorrectly

--create-remote-user-repos is not recognized because of is not recognized because of a typo, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 21:12:54 +01:00
d484749b79 cmds.CmdListRepos: Don't import from lib

Don't directly import from lib (i.e. from __init__.py), because that won't work until "make all" has not run through, i.e. during fresh checkout.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 20:09:23 +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
dc5515df09 pgit.sh clone: Use jw-projects.py instead of git-srv-admin.sh

Replace git-srv-admin.sh list-personal-projects by the more universal "jw-projects.py list-repos" for enumerating repo names. This is a step towards supporting Git servers other than janware.com.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:40:27 +01:00
1b21e33ded pgit.sh: Support --remote-base

pgit.sh has ssh://$login@git.janware.com/srv/git/$fromuser/proj/$reponame hard-coded as the remote Git URLs of every cloned project.

This commit adds support for the global option --remote-base. Passing it changes the URL to <remote-base>/$fromuser/$reponame..

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:25:46 +01:00
3ed25d5654 scripts: Add symbolic link jw -> ../src/python/jw

Adding a symbolic link to src/python/jw allows jw-projects.py to run without pointing PYTHONPATH to that module.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 17:52:20 +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
aed14fd480 pgit.sh clone: Support --create-remote-user-repos

Add support for --create-user-repos to pgit.sh. It controls whether or not personal remote repositories on janware.com are created when cloning from another user.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:37:03 +01:00
9b85b3e8a6 build.cmds.CmdListRepos: Add module

Add the command list-repos to jw-projects.py. It is meant to do the same thing as "git-srv-adm.sh list-personal-projects", i.e. enumerate remote Git repositories, but also support additional servers and protocols. As of this commit, support for https://github.com and for forgejo installations over HTTPS is implemented.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:56:14 +01:00
b5ab0a3d26 build.lib.SSHClient: Add module

SSHClient(hostname) is an abstract class for SSH / SCP operations. It comes with two implementations, SSHClientInternal an SSHClientCmd. The former needs paramiko installed, which might be a reason to fail on unprepared systems, the latter is slower and more limited.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:11:31 +01:00
9f15868dd4 build.lib.utils: Add module

Add some utility functions, namely:

run_cmd(cmd: list[str], wd=None, throw=True, verbose=False) -> str|None run_curl(args: list[str], parse_json: bool=True) -> dict|str get_username(args: Namespace|None=None, url: str|None=None) -> str get_password(args: Namespace|None=None, url: str|None=None, askpass_env: list[str]=[]) -> str

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:07:02 +01:00
bc2033490f jw.build.lib: Add module

Add jw.build.lib as a location for generic utility modules.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:05:58 +01:00
a863bb9747 jw.build.App: Unroll run_from_cmd_module()

run_from_cmd_module() is a helper function used to allow command selection alongside the legacy and now obsolete method. Unrolling it is a step towards adding proper argparse subparsers, so do that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:42:16 +01:00
75820eee7c jw.build.App: Fix commands missing from help message

jw-projects.py --help doesn't list the commands, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:41:28 +01:00
b7d88a6e22 py-defs.mk: Default PY_UPDATE_INIT_PY ?= true

Set PY_UPDATE_INIT_PY to true to match jw-build's default behaviour before the variable was introduced.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 12:04:29 +01:00
e6757727fa purge-stale-projects.sh: Fix git-srv-admin.sh relies on PATH

git-srv-admin.sh is not necessarily in PATH, notably because jw-build doesn't add itself to it anylonger, so invoke it with itsits full path.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:15:02 +01:00
4074486735 purge-stale-projects.sh: Re-add purge-stale-projects.sh, needed for purging

Without purge-stale-projects.sh, projects not longer in the upstream directory don't get purged, so add it back.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 13:10:54 +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
3f8c1ad573 scm.sh: Be more explicit about where ls-files fails

scm.sh sometimes complains about "no VCS here" without detailing what "here" actually means. Fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 12:17:04 +01:00
9018eb7c30 projects-dir-minimal.mk: Run make after cloning jw-build

After initially cloning jw-build and including projects-dir-minimal.mk, new targets are not considered, so run make again.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 11:53:28 +01:00
b82d4249f9 pgit.sh: Remove CVS support

Don't identify projects directory by a the presence of a correct CVS subdirectory any longer.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 11:30:59 +01:00
4839f60cb8 jw-build-create-project.sh: Re-add jw-build-create-project.sh for toplevel git-init-%

Re-add jw-build-create-project.sh, because it's needed for the toplevel Makefile's git-init-% target.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 10:37:56 +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
e589caf73f Re-add git-srv-admin.sh: Needed for enumerating repos via SSH

Since currently remote SSH git repos are identified via git-srv-admin.sh, we still need it to run make over a bare toplevel Makefile.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 08:52:12 +01:00
ab7140ccd4 Release 1.0.0-138@suse-tumbleweed/x86_64
Signed-off-by: Janware DevOps <devops@janware.com>
2025-11-17 01:30:27 +00:00
265354414e Start version: 1.0.0-138
Signed-off-by: janware DevOps <devops@janware.com>
2025-11-17 00:08:47 +00:00
342030ee32 upload.sh: Re-add upload.sh, needed for release pipeline

upload.sh is needed for uploading a built package to the repo server, so re-add it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-17 02:19:08 +01:00
0f3c45c1d3 Re-add jw-pkg: Use by many postinstall scripts

There's a certain logic that jw-pkg is part of jw-build, because it comes in handy to compile config file templates in a post-install stage. On the other hand, jw-base looks like a better place for that.

Re-adding for now, to not break too many packages.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 20:19:32 +01:00
65d29af479 .gitignore: Add .gitignore
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 19:50:25 +01:00
0cd5ffa378 jw.__init__.py: Add empty file

Make $(TOPDIR)/src/python/jw a module. Needed since $(TOPDIR/make now also runs jw-python.py.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 19:43:49 +01:00
ded9588396 jw.build: Disable generation of __init__.py

The default behaviour of a generated __init__.py is to load all exported symbols in the respective directory. Since jw-python.py is invoked often, this hampers performance, so disable it.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 18:44:46 +01:00
d0c1eac1a9 py-defs.mk, py-mod.mk: Support PY_UPDATE_INIT_PY

Allow to disable auto-updating of __init__.py in a directory via PY_UPDATE_INIT_PY = true | false.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 18:42:58 +01:00
2a67708fb1 build.cmds.BaseCmdPkgRelations: Add Module

For requires, provides and conflicts, isolate the bulk of the code in BaseCmdPkgRelations, then derive CmdPkgConflicts, CmdPkgProvides and CmdPkgRequires from that class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 18:05:10 +01:00
31537a0bd6 build.cmds.CmdCreatePkgConfig: Add module

Implement the functionality of create-pkg-config.sh in a Python module CmdCreatePkgConfig.py. This allows to remove create-pkg-config.sh and jw-build-functions.sh.

Note that the translation was done pretty literally to play it safe. More code can and should be removed by taking advantage of the fact that jw-projects.py knows more about the project than the shell scripts.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 17:31:16 +01:00
3370dd6236 build.App: Remove some cruft

Remove code

- Explicitly marked as unused - Meant to provide Python2 compatibility - Meant to run App.py as main module - Turned obsolete by removing the command functions from Projects.py
Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 14:26:03 +01:00
ac583f76e1 build.cmds: Move build.App.cmd_xxx() here

For every cmd_xxx() method in build.App, create a class that's instatiated for running the respective command. This has the advantage of making App.py smaller (and faster), and having smaller, more maintainable command modules adhering to a common interface.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 11:39:27 +01:00
17bf98cb7a build.Cmd: Add module

Cmd is meant as a base class for classes representing commands currently still implemented as methods of the Project class.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-15 14:41:07 +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
7a315442d4 create-mkdebian.sh: Re-add create-mkdebian.sh

pkg.sh's operating system abstraction doesn't make much sense with the debian compatibilty script removed, so add it back.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-16 16:31:52 +01:00
3842e98e11 pkg-manager.sh: Re-add pkg-manager.sh

pkg-manager.sh is needed by rollout cronjob, so re-add it.

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