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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>