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>
This commit is contained in:
Jan Lindemann 2025-11-26 17:48:01 +01:00
commit 9217d38964
50 changed files with 36 additions and 36 deletions

View file

@ -95,7 +95,7 @@ class App(object):
def get_os(self, args = ""):
import subprocess
for d in [ self.projs_root + '/jw-build/scripts', '/opt/jw-build/bin' ]:
for d in [ self.projs_root + '/jw-pkg/scripts', '/opt/jw-pkg/bin' ]:
script = d + '/get-os.sh'
if os.path.isfile(script):
cmd = '/bin/bash ' + script
@ -452,7 +452,7 @@ class App(object):
import importlib
cmd_name = args.cmd.replace('-', '_')
cc_cmd_name = 'Cmd' + ''.join(x.capitalize() for x in cmd_name.lower().split("_"))
module = importlib.import_module('jw.build.cmds.' + cc_cmd_name)
module = importlib.import_module('jw.pkg.build.cmds.' + cc_cmd_name)
cmd = getattr(module, cc_cmd_name)()
cmd.app = self
subparser = argparse.ArgumentParser(description=cmd_name)

View file

@ -8,7 +8,7 @@ from argparse import ArgumentParser
class Cmd(abc.ABC): # export
def __init__(self, name: str, help: str) -> None:
from .App import App
from ..App import App
self.name = name
self.help = help
self.parent = None

View file

@ -22,10 +22,10 @@ class CmdGetAuthInfo(Cmd): # export
def _run(self, args: Namespace) -> None:
keys = ['username', 'password']
# --- Milk jw-build repo
jw_build_dir = self.app.proj_dir('jw-build')
# --- Milk jw-pkg repo
jw_build_dir = self.app.proj_dir('jw-pkg')
if not os.path.isdir(jw_build_dir + '/.git'):
self.app.debug(f'jw-build directory is not a Git repo: {jw_build_dir}')
self.app.debug(f'jw-pkg directory is not a Git repo: {jw_build_dir}')
return
remotes = run_cmd(['git', '-C', jw_build_dir, 'remote', '-v'])
result: dict[str, str] = {}
@ -38,7 +38,7 @@ class CmdGetAuthInfo(Cmd): # export
for key in keys:
result[key] = getattr(parsed, key)
base = parsed.geturl()
base = re.sub(r'/jw-build', '', base)
base = re.sub(r'/jw-pkg', '', base)
base = re.sub(r'/proj$', '', base)
url['remote-base'] = base
break

View file

@ -31,13 +31,13 @@ class CmdListRepos(Cmd): # export
match url.scheme:
case 'ssh':
if re.match(r'ssh://.*git\.janware\.com/', args.base_url):
from jw.build.lib.SSHClient import SSHClientCmd as SSHClient
from jw.pkg.build.lib.SSHClient import SSHClientCmd as SSHClient
ssh = SSHClient(hostname=url.hostname)
if username is not None:
ssh.set_username(username)
if password is not None:
ssh.set_password(password)
cmd = f'/opt/jw-build/bin/git-srv-admin.sh -u {args.from_user} -j list-personal-projects'
cmd = f'/opt/jw-pkg/bin/git-srv-admin.sh -u {args.from_user} -j list-personal-projects'
out = ssh.run_cmd(cmd)
print(out)
return

View file

@ -1,4 +1,4 @@
TOPDIR = ../../../..
TOPDIR = ../../../../../..
PY_UPDATE_INIT_PY = false
include $(TOPDIR)/make/proj.mk

View file

@ -1,4 +1,4 @@
TOPDIR = ../../../../..
TOPDIR = ../../../../../..
include $(TOPDIR)/make/proj.mk
include $(JWBDIR)/make/py-mod.mk