summaryrefslogtreecommitdiff
path: root/morphlib/source.py
Commit message (Collapse)AuthorAgeFilesLines
* Use the modern way of the GPL copyright header: URL instead real addressJavier Jardón2015-03-161-3/+2
| | | | Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
* Remove Artifact compatibility methodsRichard Maw2014-09-191-2/+2
|
* FIXUP: Add compatibility methods to Artifact for fields that moved to SourceRichard Maw2014-09-191-1/+1
| | | | | This means we can avoid having to rewrite everything immediately after the fields moved.
* Move dependencies and cache keys to SourcesRichard Maw2014-09-191-1/+20
|
* Create multiple sources per stratum morphologyRichard Maw2014-09-191-11/+41
| | | | | | | | | | | | | | | | | Building per-artifact results in undesirable behaviour, as multiple artifacts are produced for every chunk build. It therefore makes more sense to build per-source. This implies that actually, the model of one source per morphology is wrong and we should move the dependencies into the source. Unlike chunks however, where every chunk artifact has the same dependencies, stratum artifacts can have different dependencies. So before we can move the dependencies into the Source, we need to have as many Sources as Stratum Artifacts.
* Add __repr__ method to Source and SplitRulesRichard Maw2014-09-171-0/+3
| | | | | This helps debugging issues with rule matching, since SplitRules can be print-statemented
* Use exact filenames to refer to morphology filesRichard Maw2014-07-101-1/+1
| | | | | | | | | | | | | | | | | | | Rather than repeatedly stripping and appending an optional .morph extension morphology names, instead always use the file path of the morphology relative to the definitions repository. This is an inversion of the previous logic, which would strip the .morph extension and use the "name" internally. The exception to this rule of always using the filename, is that `morph edit CHUNK` uses the name of the morphology as-defined in the stratum. This is based off Adam Coldrick's inital patch, but this version will allow the old style of providing the "name" by converting it into a path if it does not have either a / or a . in it. An unfortunate consequence of this change is that the show-dependencies command's output changed, so the test needed updating.
* Add split rules to sourcesRichard Maw2014-01-161-1/+7
| | | | | | | | | This introduces a new artifactsplitrule module, which tries to provide a nice abstraction over matching a sequence of things to a bunch of outputs, to be used by both chunks splitting, for separating files out into chunk artifacts, the stratum splitting, where chunks are aggregated into stratum artifacts, and systems selecting the right strata to go into the artifact.
* Source: Create all Artifact objects in advanceRichard Maw2014-01-151-1/+4
| | | | | | | | This simplifies logic for the ArtifactResolver, since it doesn't need to have its own cache of (source, artifact_name) -> artifact and the artifacts a source produces can be iterated directly with the artifacts attribute, rather than having to iterate over the names and look up the artifact object.
* Remove features used by old bootstrap methodSam Thursfield2013-03-131-1/+1
| | | | | | That means that bootstrapping Baserock is currently not possible with this branch of Morph, but there's no reason it cannot be bootstrapped using an older version of Morph instead.
* Fix incorrect commentSam Thursfield2013-03-131-5/+0
|
* Don't use .morph extension when printing name of tripletsSam Thursfield2012-09-121-1/+1
| | | | | We should now be fully consistent regarding the form of triplets (ie. the last component is always a morphology name rather than a filename)
* Resolve tree SHA1 along with commit SHA1 when resolving refsJannis Pohlmann2012-09-051-1/+4
| | | | Adjust all other parts and the tests to work with this.
* python scripts: pep8ize codebaseRichard Maw2012-08-011-9/+9
| | | | | | | | | 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.
* Remove dead code (dependencies in Source objects)Lars Wirzenius2012-06-181-12/+0
|
* Remove assert for checking type of argumentLars Wirzenius2012-06-141-1/+0
| | | | | | It's not Pythonic, and isn't catching any errors anymore. It was useful during a transition period when refactoring things to use the new class for morphologies.
* Add a repo_name to Source, use that instead of repo in most places.Jannis Pohlmann2012-04-181-3/+5
| | | | | | | | | | This is because we will need to integrate a RemoteRepoCache and we don't always want to create a CachedRepo object (in fact, we only want that for the sources of artifacts we actually need to build). So we'll use either the local or the remote repo cache to resolve refs and morphology texts and then later, when actually caching a repo, we'll set the source.repo member to a CachedRepo object that we can then use to unpack the sources.
* Add original_name member to CachedRepo. Use it for SourcePool lookups.Jannis Pohlmann2012-04-171-1/+3
| | | | | | This is done to avoid a nasty mix of SourcePool lookups using CachedRepo objects (e.g. for strata within a system) versus lookups using repo names (e.g for sources within a stratum).
* Accept any object that is an instance of morph2.Morphology in Source.Jannis Pohlmann2012-04-121-1/+1
|
* morphlib.source: print the ref rather than the shaRichard Maw2012-04-111-1/+1
|
* Add the new BuildGraph class including tests.Jannis Pohlmann2012-04-111-0/+2
| | | | | This class takes a source pool and computes a valid build order for the sources in this pool, if possible.
* Add original_ref member to Source. Default to None for build-depends.Jannis Pohlmann2012-04-111-1/+3
| | | | | | | | | We will almost always want to look up sources based on the data we find in morphologies (e.g. chunk sources found in a stratum or strata found in a system). For that we need to remember the original_ref in addition to the resolved SHA1 and look up sources using this original ref. The original ref is therefore also used as part of the hash key in SourcePool now.
* Add SourcePool class and make Source store its morphology filenameLars Wirzenius2012-04-101-1/+3
|
* Add a Source classLars Wirzenius2012-04-101-0/+54
This will eventually replace the Blob class we are currently using. It is somewhat simpler, because the envisioned usage of Source will be different from Blob: we'll be rewriting the build ordering class, and the builder classes, in ways that simplify things, and thus a simpler Source class will hopefully suffice.