Replace all_installed_packages() by query_packages(). The function
takes an optional list of packages to be queried. If it's empty, a
list of all installed packages are returned.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add more methods, to make Package more useful:
- __repr__()
- Class-mMethods to help with parsing of strings gathered from the
OS-tools' output:
parse_spec_str()
parse_specs_str()
order_tags()
- Add field maintainer
Signed-off-by: Jan Lindemann <jan@janware.com>
Make all pkg commands take a "names" argument (plural) instead of
"name", and make it a non-option-argument, to be passed to the
subcomand instead.
Signed-off-by: Jan Lindemann <jan@janware.com>
There's no "Homepage" meta tag in the .deb files created by jw-pkg,
add one.
Also, generate an e-mail address <global.jw-maintainer>@janware.com
to go into the Maintainer field. Not ideal, but a low-hanging fruit.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add --download-only to the options of jw-pkg.py distro dup, which
makes the command only download packages from the repositories
without installing them.
Signed-off-by: Jan Lindemann <jan@janware.com>
Passing --only-update should keep "jw-pkg.py distro install" from
installing packages that are not already installed on the the system.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add the command distro.CmdRebootRequired, adding support for "distro
reboot-required". The command exits with status code 1 if a reboot is
required and 0 otherwise.
Signed-off-by: Jan Lindemann <jan@janware.com>
If a Cmd-classes's _run() method returns an integer between 0 and
255, use that as the program's exit status.
Signed-off-by: Jan Lindemann <jan@janware.com>
Most run_xxx() return stdout and stderr. There's no way, really, for
the caller to get hold of the exit code of the spawned executable. It
can pass throw=true, catch, and assume a non-zero exit status. But
that's not semantically clean, since the spawned function can well be
a test function which is expected to return a non-zero status code,
and the caller might be interested in what code that was, exactly.
The clearest way to solve this is to return the exit code as well.
This commit does that.
Signed-off-by: Jan Lindemann <jan@janware.com>
HOST_TUPLE is bastardized to contain more info that just the GNU
Triplet. Add HOST_DISTRO_INFO to do the caching job, and leave
HOST_TUPLE alone.
Signed-off-by: Jan Lindemann <jan@janware.com>
pgit.sh logs "Running $0 $@ GIT_SSH=" which is not the exact command
line. Fix that, and prefix log messages with "pgit.sh".
Signed-off-by: Jan Lindemann <jan@janware.com>
get-os.sh returned "suse" for SuSE-like distros, and that seems more
appropriate since SLES is not OpenSUSE but should share and ID with
other SuSE variants.
Signed-off-by: Jan Lindemann <jan@janware.com>
App.distro_id used to return "opensuse-tumbleweed", analogous to
what's in ID@/etc/os-release, but now returns "opensuse", and the
"tumbleweed" goes into "codename". That matches more what Debian-like
distributions do, but it confuses _backend_path. Adapt it to map the
new distro_id correctly.
Signed-off-by: Jan Lindemann <jan@janware.com>
A compiled release package is currently uploaded to a fixed
directory, determine it dynamically for every distro seperately.
Signed-off-by: Jan Lindemann <jan@janware.com>
PKG_FORMAT is now more straightforward to get with from the revised
jw-pkg.py distro info --format '%{cascade}', so do that, and do it in
the context where all the other variables are set from the output of
that command.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
To remove redundancy, get-os.sh needs to be retired in favor of
pkg.py distro info. It's needed in platform.mk, but the only
definiton of JW_PKG_PY is in projects.mk, so move it, along with the
variables essential for the command:
include $(JWBDIR)/make/py-version.mk (defining PYTHON)
JW_PKG_PY
DEVELOPMENT
VERSION_FILE
Signed-off-by: Jan Lindemann <jan@janware.com>
CmdInfo provides what "projects os-cascade" provided as "distro info
--format '%{cascade}'" plus additional macros: %{id}, %{name},
%{codename} and ${gnu-triplet}.
Signed-off-by: Jan Lindemann <jan@janware.com>
In addition to the existing propert distro_id, add the properties
distro_codename, distro_name, distro_cascade and distro_gnu_triplet.
Signed-off-by: Jan Lindemann <jan@janware.com>
pkg.run is not evaluated on Debian, fix that. For now it's hacked
into pkg.sh, which is bound to be replaced by Python. The limited
hassle is still worth the detour.
Signed-off-by: Jan Lindemann <jan@janware.com>
Support --remote-owner-base in the command CmdGetAuthInfo. Make it
return what currently --remote-base returned: A URL including the
user / organization specific prefix of the Git remote's URL that
jw-pkg was pulled from.
https://my-company.com/src/theowner/jw-pkg.git
would have a --remote-owner-base of
https://my-company.com/src/theowner
Also, change what --remote-base returns to
https://my-company.com/src
Signed-off-by: Jan Lindemann <jan@janware.com>
Rename the --from-user option to --from-owner. Forgejo supports users
and organizations under the more general term "owner", so that's the
better term.
Signed-off-by: Jan Lindemann <jan@janware.com>
list-repos tries /users/ and /orgs/ to find a working repo URL in a
Forgejo instance, logs a failure and doesn't log anything if it finds
one that works. In the context, that can be mildly confusing,
beautify the output somewhat.
Signed-off-by: Jan Lindemann <jan@janware.com>
Make some incomprensible parser error messages if run_curl() returns
nothing slightly less incomprehensible.
Signed-off-by: Jan Lindemann <jan@janware.com>
base-url is not used as a prefix in its entirety, but massaged in a
janware-specific way. Still is, but at least this commit is a step
towards being more generic.
Signed-off-by: Jan Lindemann <jan@janware.com>
This is a code maintenance commit: some run_xxx() helper functions
take a string, some a list, and some just digest all arguments and
pass them on as a list to exec() to be executed. That's highly
inconsistent. This commit changes that to list-only.
Except for the run_cmd() method of SSHClient, which is still run as a
shell method, because, erm, it's a shell. Might be changed in the
future for consistency reasons.
Signed-off-by: Jan Lindemann <jan@janware.com>