PROJECTS_DIR_REMOTE_BASE and JANWARE_USER is determined by jw-pkg.py
get-auth-info. Interactivity hurts here, though, turn it off.
Signed-off-by: Jan Lindemann <jan@janware.com>
Support --hide-jw-pkg. This is a step towards replacing
required-os-pkg, which leaves out packages from pkg.requires.jw
sections.
Signed-off-by: Jan Lindemann <jan@janware.com>
If a package P is added, only those of its dependendencies are added
along which are in the same os-cascade section as P. That's wrong,
fix it.
Signed-off-by: Jan Lindemann <jan@janware.com>
Make variable names a little more readable and searchable within the
long pkg_relations_list() method by making their names longer and
truer to what they actually mean.
Signed-off-by: Jan Lindemann <jan@janware.com>
CmdPrereq was mostly redundant to PkgRequired all along. CmdPrereq
has grown more versatile, and CmdPrereq is not used throughout jw-pkg
anylonger by now. Remove it.
Signed-off-by: Jan Lindemann <jan@janware.com>
Enclose sections / keys taken from project.conf in [square.brackets],
hinting at what they are supposed to mean.
Signed-off-by: Jan Lindemann <jan@janware.com>
log_start_stop() is responsible for logging markers at the beginning
and end of a decorated log. They should not be applied if pgit.sh is
run with --porcelain. In fact, they are, and vice versa. Fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
Set -o pipefail at the start of the script. This makes pgit.sh commit
work. Before it didn't, because run_git() doesn't return a proper
return value when it's used in a pipe with a cosmetic sed afterwards.
Signed-off-by: Jan Lindemann <jan@janware.com>
Rename git-show-pushable-master-branches to git-show-pushable,
because, the target's recipe doesn't show pushable master branches,
but all commits in the working directories current branch not present
in origin/master.
Signed-off-by: Jan Lindemann <jan@janware.com>
This reverts commit 88e81 and effectively re-enables persistent SSH
connections to speed up builds.
commit 88e8197ed7
Author: Jan Lindemann <jan@janware.com>
Date: Thu Apr 20 20:00:46 2017 +0000
projects-dir.mk: Partly disable persistent SSH
Don't use persistent SSH-connections any more for "pkg-" targets,
because, sadly, this hangs after uploading a package.
This commit puts some safeguards against hanging SSH into place,
namely setting default SSH timeouts down, SSH keepalive, setting SSH
BatchMode to yes.
Signed-off-by: Jan Lindemann <jan@janware.com>
Use DEP_PROJECTS instead of BUILD_PROJECTS everywhere. DEP_PROJECTS
considers more projects, and for all targets it is relevant to, it's
desirable to have them operate on the maximum blast radius.
Signed-off-by: Jan Lindemann <jan@janware.com>
make git-show-pushable-master-branches misses projects which should
better be pulled in as dependencies. It searches $(BUILLD_PROJECTS)
for repositories with pushable commits, that variable leaves some
out, and DEP_PROJECTS has them. It make use of the renovated
pkg-requires command.
This move should be extended to other uses of BUILD_PROJECTS as well,
after giving it some test runs. And the legacy and redundant command
prereq should be removed.
Signed-off-by: Jan Lindemann <jan@janware.com>
print() should be used to output information requested by a certain
command, but not for logging the process to achieve it. log() should
be used for the latter. The current code has the distinction not down
clearly, fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
By default, argcomplete uses argcomplete.FilesCompleter as default
for every argument. This mixes accessible files into the list of
possible completions. For most of jw-pkg's commands, that's unwanted,
so turn it off by defining a NoopCompleter class which does nothing,
and by set every arguments's default completer to a NoopCompleter
instance. If desired, completing files can be restored for an
argument by
parser.add_argument("some-arg").completer = FilesCompleter()
Signed-off-by: Jan Lindemann <jan@janware.com>
Every module derived from lib.Cmd implements its own
parser.add_argument() logic. As a consequence, all Cmd derived
modules need to be loaded to have the full argument tree available.
This is avoided during normal program startup because it takes some
time. It's not necessary during normal program execution, nor for
showing help messages. It is, however, needed for argcomplete to do
its thing, so fully parse the command line if the program runs in
argcomplete mode, as determined by checking if _ARGCOMPLETE is
present in the environment.
Signed-off-by: Jan Lindemann <jan@janware.com>
lib.ExecContext.log_delim() logs a header not designed for enclosing
command output, and, hence, no footer should be output. This commit
suppresses it.
Signed-off-by: Jan Lindemann <jan@janware.com>
print() should be used to output information requested by a certain
command, but not for logging the process to achieve it. log() should
be used for the latter. The current code has the distinction not down
clearly, fix that.
Signed-off-by: Jan Lindemann <jan@janware.com>
Log to stderr and add some ASCII-art around the output. Also, add a
--porcelain option to allow more stable output parsing. Subsequently,
use that option in make targets parsing the output, notably make diff
and make git-show-xxx.
Signed-off-by: Jan Lindemann <jan@janware.com>
run_sudo() is a thin wrapper around ExecContext.sudo(), so don't try
to make sense more arguments than necessary.
Signed-off-by: Jan Lindemann <jan@janware.com>
Request a remote PTY from AsyncSSH, and wire the local terminal's
stdin up with it if interactive == True. This gives a real
interactive session if local stdin belongs to a terminal. Also,
thanks to AsyncSSH understanding that, forward terminal size changes
to the remote end.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a SSHClient implementation using AsyncSSH. This is the first and
currently only class derived from SSHClient which implements
SSHClient.Cap.LogOutput, designed to consume and log command output
as it streams in. It felt like the lower hanging fruit not to do that
with Paramiko: Paramiko doesn't provide a native async API, so it
would need to spawn additional worker threads. I think.
Signed-off-by: Jan Lindemann <jan@janware.com>