| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
This workaround fix http://bugs.python.org/issue12841
The code added in this patch is from tarfile.py from python 2.7.3.
Also only use the workaround for tarfile.makefile when the ptyhon
is smaller than 2.7.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Filenames are now matched before chunks are constructed, so
bins.create_chunk now takes a list of relative file names.
bins.chunk_contents is gone, since this is now handled by passing
source.split_rules.partition the file names.
We now don't consider it to be a problem for directories to remain in
the DESTDIR after artifacts have been removed, since we need to handle
file matches implying their parent directories, and explicit matches
against directories.
NOTE: The bins_tests were broken in this patch, and are fixed in the
next. This was done to try and aid readability of the patch series.
Full functionality is still broken until stratum splitting is fixed.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
We already silently, automatically decompress if the artifact is
compressed. It is thus safe to turn off compression.
Compression saves disk space, but on ARM it takes up a lot extra
time, and we have lots of disk space, so for speed, not compressing
is a good idea.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ExtractedTarball is more or less the equivalent to MountableImage for
artifacts that are not mountable images. So in order to inspect root
file system tarballs, ExtractedTarball can be used, for disk images,
MountableImage can be used.
The morphlib.bins.call_in_artifact_directory() method combines these
two classes and provides a way to extract/mount an artifact and call
a callback with the temporary directory / mount point as its first
argument. Using this, a plugin that runs a command relative to an
artifact's root directory can be written easily.
|
|
|
|
| |
Reported upstream as: http://bugs.python.org/issue16477
|
|
|
|
|
|
|
| |
This prevents us from leaving file handles open when code throws an
exception. When the file handle is on a loopback mount, this is a real
problem because Morph then cannot unmount the image in its exception
handler. In most cases 'with' is the best option.
|
|
|
|
|
| |
os.path.relpath does approximately the same as mkrel, with the
exception of asserting.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mutliple issues here:
* tarfile can throw IOErrors in addition to OSErrors, and both may need
the filename attribute set
* tarfile needs to be told to raise exceptions for errors, rather than
ignoring them (errorlevel=1 to the constructor)
* tarfile needs to be told to raise exceptions for tar format corruptions
and not just I/O errors (errorlevel=2)
* the exception should be re-raised with a plain "raise" instead of "raise e"
to preserve the stack trace correctly; it's OK to modify the exception
before re-raising it
Also moved the creating of tf to the rest of the code that sets it up,
for clarity.
I've tested these changes manually, but not written a test case,
since a test case is tricky to write for this.
Originally found by Joe Burmeister.
|
|
|
|
|
|
|
|
|
| |
This was done with the aid of the pep8 script, available by running
`easy_install pep8`.
It may be worth making this part of ./check, but that will require
putting pep8 into the development tools stratum.
This should be easy, given pep8 has no external dependencies.
|
| |
|
|
|
|
|
|
|
| |
This changes the timestamp in the Python tarfile.TarInfo data structure
rather than setting the timestamp in the filesystem.
Suggested by Richard Maw.
|
|
|
|
|
|
|
| |
This avoids problems with clock skew between the machine that built
an artifact and the machine the uses it. I ran into this problem
during a test build of other changes in this patch series. We have
seen it before, now it is fixed.
|
|
|
|
| |
create_stratum is no longer used, since strata are now chunk lists
|
| |
|
|
|
|
|
| |
This import was forgotten when the artifact extract code was moved
into bins, so it could be used in builder
|
|
|
|
|
| |
Before only the staging area had symbolic links handled, now
strata and systems will have the same logic.
|
| |
|
| |
|
|
|
|
|
|
| |
This should stop tar from replacing symbolic links with directories
and instead follow the symbolic links, extracting the files into
the linked directories
|
| |
|
|
|
|
|
| |
This avoids problems with files with the right names but partial
content, if morph is killed in the middle of writing the file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead, assume the whole build will be run, by the user, under
fakeroot or sudo (the latter for system image builds). This allows
us to run all non-system-image-build tests without root access
at all.
We now always create the cache directory, if missing, even if
we're running as root.
We no longer run ldconfig if ld.so.conf is missing. It is missing
during our tests, but is (now) created by fhs-dirs for real builds.
|
|
|
|
|
| |
Busybox tar is incapable of doing this, so we have to use
Python's tarlib, at least for now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some commands can remain as fakeroot if they share the same fakeroot
This can be done with the -i and -s parameters to fakeroot
Now the Execute objects contain a reference to the file that stores
their state, so fake commands' fake state is recognised by later commands
The creating a system image definitely needs to be sudo though.
Morph needs to create some files as part of the process, so unfortunately
the equivalent to 'echo foo | sudo tee bar >/dev/null' is being used.
They could be created with sufficient permissions, written then have
better permissions set, but it seemed neater this way
A better solution may be to have a subprogram that does the system image
creation
Putting files into the staging area for building other chunks is currently
sudo, but shouldn't have to be. Rather than having a fakeroot per Execute
object, it may be better to have a global one, though this would prevent
concurrent use of fakeroot.
|
|
|
|
|
|
|
|
| |
Then fix all the places where this broke things because they didn't have
the required permissions.
This is a potential security risk of course, it would be preferable if
the install commands were run in a fakeroot session and only the final
image building was run as root, but it needs to work first
|
|
|
|
| |
This saves a bunch of memory use.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|