| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
| |
By default we brutally murder subprocess trees, but sometimes we
know the nature of the tool we are using and know that it handles
sigterm gracefully.
This patch allows those cases to have a chance at graceful termination.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using PurePath from pathlib, we use a modified version
of fnmatch.translate() to generate a regular expression.
This has multiple advantages:
* The private usage of regular expressions allows the Element
internal splitting rules to more easily adapt to the new globbing
syntax for split rules
* With the glob function under our control, we can document it more
clearly
* We have support for bash 'globstar' mode, which allows recursive
globs with double asterisk.
|
|
|
|
| |
Fixes: 10a0b98d ("utils.py: Add _call()")
|
|
|
|
|
|
|
|
|
| |
The glob module from the standard library only allows glob
pattern matching where there is a backing filesystem.
This utility allows glob matching on a simple list of paths,
and as such can be used to match things from an unextracted artifact
or an unextracted tarball.
|
|
|
|
|
|
|
|
| |
Instead of returning a tuple of two lists, return the
new FileListResult object.
This is better because it will allow us to enhance the result
over time without breaking API.
|
|
|
|
| |
This reverts commit 9ae1e1a290f67628d4e68632618b0aa9aa92b4e3.
|
|
|
|
|
|
|
|
|
|
| |
Since we merged MR 29 with a fix for resolving symlinks to realpaths,
we should also use the real path of the staging directory to produce
a relative path properly.
If we are considering that staged symlinks link to symlinked paths
inside the staging target, we must also consider that the staging
area itself can be in a symliked directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal of turning absolute symlink paths into relative ones is a noble one --
we want to avoid any chance of corrupting stuff on the host system. Symlinks
pointing to /lib/ld.so or whatever can be dangerous (although by not running
BuildStream as 'root' you are mostly protected anyway).
Some Baserock builds were broken by this as it didn't take into account that
the path to a symlink may itself contain symlinks. Adding an extra
os.realpath() call is enough to fix this case.
This was breaking the Baserock armv8l64 stage2 sysroot, where
/lib/ld-linux-aarch64.so is a symlink (to /tools/lib/ld-linux-aarch64.so.1) and
/lib is also a symlink (to /usr/lib).
|
|
|
|
|
| |
subprocess.call() wrapper supporting suspend and resume based on
plugin.__call().
|
|
|
|
| |
A brutally murderous function to kill a process and all of it's children.
|
| |
|
|
|
|
|
| |
These had a circular import, which is only supported > python 3.5
but undesirable anyway.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
o list_relative_files no longer has include_directories which
was always True, and now is better defined.
o Added move_files() function to compliment copy_files()
and link_files()
o Added safe_remove() utility to remove a path, only if it exists,
regardless of whether it is a directory or not, but not remove
non-empty directories.
|
| |
|
|
|
|
|
| |
This avoids any confusion as to if the master process can receive
SIGTSTP events it wants to handle, from child processes.
|
|
|
|
|
|
|
|
|
| |
This takes care of handling SIGTSTP and SIGCONT, allowing the
caller to pass one suspend() and one resume() function. This
should be used in the core where we launch sub processes which
will not go to sleep with the scheduler job, so that the handlers
in place can manually put these child processes to sleep and
wake them up later.
|
|
|
|
|
| |
Parts of the core use this to perform some minimal cleanup and ensure
proper process termination whenever a task is forcefully quit.
|
|
|
|
|
|
|
|
|
|
| |
When creating an overlay in which we can perform composites, it's important
to create it with:
copy = ChainMap({}, original)
Modifications will occur in the first mapping in the chain, we must provide
that first mapping with the prefixed {}.
|
|
|
|
|
| |
These use collections.ChainMap and should be used in place of
copy.deepcopy() as much as possible.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
o When removing a file that is in the way, dont recursively
nuke non-empty directories, warn instead
o When staging a symlink, stage a relative path; so that when
we stage files across the symlink boundary they never refer
to the host
o Fix list_relative_paths() to also report symlinks to directories
|
| |
|
|
|
|
| |
Set a deterministic mtime recursively in a given directory.
|
|
|
|
| |
Handle overlaps a bit more violently but report about it.
|
| |
|
| |
|
|
|
|
| |
Turns out every desired output of this is ordered at the moment.
|
|
|
|
|
| |
Now by default strips away provenance but also
optionally sorts it into a recursively ordered thingy.
|
|
|
|
|
|
| |
This sorts dictionaries in the input recursively so that
elements dont have to care too much about how they return
stuff from plugin.get_unique_key()
|
|
|
|
| |
These are all now handled by the Plugin class
|
| |
|
| |
|
|
|
|
|
|
| |
Used to create mirror directories for sources, these use fully
qualified urls because a user may have multiple projects and
we want to be damn sure they dont overlap.
|
|
|
|
| |
Since python 3.3 IOError (among a few others) are just aliases for OSError.
|
|
|
|
|
| |
This is useful for plugins to assert presence of host tools
so it should be publicly available
|
|
|
|
|
|
|
|
| |
o list_relative_paths() reports a sorted list of relative filenames
o safe_copy() copy a file, unlinking the destination if it exists
o safe_link() tries to create a hardlink but falls back to a copy
o copy_files() copies files from one directory to another
o link_files() links files from one directory to another, or falls back to copy
|
| |
|
|
|
|
|
| |
Needed by both Element and Source implementations, but let's
not give them the whole _yaml API.
|
|
|
|
|
|
|
| |
The _yaml module has everything we need for parsing and validating
loaded roundtrip yaml. This includes the dictionary compositing algorithm
and also some provenance tracking to tell whence a node, member or list
element was loaded from.
|
| |
|
|
|
|
| |
And renamed ContextError exception to a more general LoadError.
|
|
Utility box, now with method for recursively overriding dictionary values.
We use this to load user config overrides but will also be using
it for overriding defaults of elements from yaml
|