Not logging any attribute for links, as it's now, breaks Debian's
parser. So, log %attr(0777, $owner, $mode). This fixes the parser on
the Debian side and hopefully leaves the RPM side intact.
Signed-off-by: Jan Lindemann <jan@janware.com>
CmdGetAuthInfo calls run_cmd() with a list instead of a *-expanded
list of arguments. Fix this to match the current run_cmd() prototype.
And think again if the current prototype conforms to the priciple of
least surprise: Most exec- / run- / whatever- functions do expect
ether a string to be run by the shell, or an argv list.
Signed-off-by: Jan Lindemann <jan@janware.com>
Prepending --login to the argument list of BackendCmd.sudo() fails if
run as root, because BackendCmd.sudo() detects that and leaves the
/usr/bin/sudo out from the exec call. Fix that by adding an
opts: list[str] parameter to sudo, defaulting to an empty list, with
options that should be passed to /usr/bin/sudo.
Signed-off-by: Jan Lindemann <jan@janware.com>
On OpenSUSE, run sudo with --login. This picks up a possible
ZYPP_CONF config variable definition in /etc/profile.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a package dependency on make for the -devel package. Installing
jw-pkg's Makefiles doesn't make much sense without it.
Signed-off-by: Jan Lindemann <jan@janware.com>
Define run(), which calls _run() in the abstract base class Cmd, not
in lib.Cmd. Otherwise lib.Cmd is not abstract, which will predictably
confuse including code outside of jw-pkg.
Signed-off-by: Jan Lindemann <jan@janware.com>
If VERSION_FILE is not found, trying to include makefile snippets
triggers the attempt to regenerate it. This happened for installed
Makefiles of jw-docker-images: It defines TOPDIR to
/opt/jw-docker-images, projects.mk looks there, but the version file
is installed under /usr/share/doc/packages/jw-docker-images/VERSION.
Allow VERSION_FILE to be overridden including code to keep that from
happening.
Signed-off-by: Jan Lindemann <jan@janware.com>
Change package group from System/Libraries to
Development/Tools/Building because that expresses the purpose of the
package better.
Signed-off-by: Jan Lindemann <jan@janware.com>
make complains for plugins that soandso.dll has not been remade. The
problem is that it tries to remake all targets of a multi-target.
Split that up into two rules.
Signed-off-by: Jan Lindemann <jan@janware.com>
Calling make git-pull-xxx from a projects directory stops iterating
projects if one has a dirty workspace. Calling --autostash fixes
that.
With this in place, a failed rebase leaves the local changes behind
stashed. So, after manually fixing the rebase, the stash needs to be
manually reapplied. The commands that led up to the failure are
logged right before, so I have hope that this is learnable, and not
too much of a footgun.
Signed-off-by: Jan Lindemann <jan@janware.com>
Trying to find the directory of a project should log a warning. It
throws an exception instead. Fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
If Python's autocomplete is not installed, jw-pkg.py fails to run
commands. Fix that in order stay compatible with minimal excecution
environments.
Signed-off-by: Jan Lindemann <jan@janware.com>
.cache-projects.mk is not installed / packaged, which makes builds
against an installed jw-pkg considerably slower. Change that, at the
risk of making the installed jw-pkg-devel less versatile. This commit
installs a cache file cache-projects.mk, renamed from
.cache-projects.mk, because there's no justification for hiding an
installed makefile. At least I can't think of one.
Signed-off-by: Jan Lindemann <jan@janware.com>
Before merging the remote branch, do a rebase. This may fail and
prompt conflict resolution, but that seems the canonical outcome for
the common use case "interactive make git pull-xxx" with master
out-of-sync.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
Better safe than sorry: If things are to happen unattendedly, enforce
the need to explicitly request that.
Signed-off-by: Jan Lindemann <jan@janware.com>
Major - but not yet sufficient - code beautification starting from
jw.pkg.App.
- Make more methods private
- Rename methods to be more self-explanatory
- Same for method arguments, notably clean up some inconsistent
uses of "module" vs "project"
- Add more type hints
Fix API breakage in the command modules.
Signed-off-by: Jan Lindemann <jan@janware.com>
--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>
A "username" in jw-pkg terms, as in $(CLONE_FROM_USER), is not
sufficient to identify a remote API URL on a Forgejo server, it can
denote both an organization and a user, so try organizations first,
then users, and stop on the first occasion found.
Signed-off-by: Jan Lindemann <jan@janware.com>
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>
Add a hand-coded __init__.py into jw.pkg.cmds.distro. Auto-generation
works fine, but has to run before it can work. For a freshly
downloaded toplevel Makefile / project-dirs-minimal.mk, the targets
pkg-install-xxx-deps requires a working package manager without
jw-pkg built.
Signed-off-by: Jan Lindemann <jan@janware.com>