summaryrefslogtreecommitdiff
path: root/morphlib/morph2.py
Commit message (Collapse)AuthorAgeFilesLines
* Lookup chunks within strata by 'morph' field, not 'name'Sam Thursfield2012-09-241-1/+1
| | | | | 'morph edit' is for editing source code, not built artifacts, so we should use the source morphology name.
* Fix things so test suite works on Debian squeezeLars Wirzenius2012-09-131-9/+18
| | | | | | | | | | This requires disabling the feature that retains the original order of fields in a morphlogy when it gets overwritten. The implementation relies on features that are not available in Python 2.6. We need to support Morph on Debian squeeze, for bootstrapping purposes, and therefore need to have it work with Python 2.6. However, the morphology rewriting is only relevant for system branching and merging, and that isn't needed for bootstrapping, so we disable the affected tests on Python 2.6.
* Preserve sort order of morphologies, so they can be edited by MorphSam Thursfield2012-09-101-14/+48
|
* Morphology: Only set defaults specific to the morphology kindSam Thursfield2012-09-101-15/+24
| | | | | This helps us avoid writing out meaningless fields when we want to edit a morphology and write it back to disk.
* Allow 'disk-size' in system morphologies to be an integerJannis Pohlmann2012-09-041-8/+11
| | | | | | This is needed for being able to write morphologies to disk programmatically after making automatic changes to them using morph.
* Rework morphology child lookup to be more useful for branch/mergeJannis Pohlmann2012-09-041-24/+35
| | | | | | | | | | | | | In order to modify morphologies in place and then write them back to disk in system branches (e.g. when running "morph edit"), we need to have access to the dicts that store references to strata in system morphologies and chunks in stratum morphologies, respectively. Therefor, the previous triplet-returning child lookup is replaced with a new internal method to ensure uniqueness of names in morphologies and a new method to lookup children in this commit. The unit tests are adjusted to cover everything in appropriate ways.
* Morph: index component morphologies by nameSam Thursfield2012-09-041-0/+25
| | | | | | This requires that we enforce uniqueness. New method: Morphology.lookup_morphology_by_name()
* Strata contain "chunks", not "sources"Sam Thursfield2012-08-291-3/+2
| | | | Rename "sources" field of stratum morphologies to "chunks".
* python scripts: pep8ize codebaseRichard Maw2012-08-011-18/+17
| | | | | | | | | 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.
* Require system-kind on system morphologiesLars Wirzenius2012-07-191-0/+1
|
* morphlib: add 'arch' field to morphologiesRichard Maw2012-06-131-0/+1
| | | | | | | | | | | | | | | | | | | This is an ugly, ugly way to do this, but time is pressing. SystemBuilder checks what arch is defined in the morphology, if it is an x86 (or None for compatibility) then it will do the syslinux install stuff. This hack is needed because syslinux is x86 specific and arm often has different requirements for where the kernel must be loaded from, sometimes it is flash, sometimes it is a different partition. This will likely become board specific, but for a qemu-system-arm, the kernel should be a separate file, to be passed on the command line. Having a different 'kind' for each architecture would be a nicer way, but would require more changes, since there are various checks for morphology['kind'] == 'system'
* Add a Morphology.keys() methodLars Wirzenius2012-05-091-0/+3
|
* morphlib/morph2: default commands are NoneRichard Maw2012-04-231-4/+4
| | | | | | | | | | Builder checks whether commands need to be chosen from the build system by if the morphology has no commands, the check is whether the commands are None, rather than an empty list, so that it is possible to override a build system's commands with an empty list. However this means that the default of an empty list means that the build system is ignored and commands aren't run.
* Have a default 'chunks' field in a chunk morphologyLars Wirzenius2012-04-181-0/+1
|
* Add original_ref member to Source. Default to None for build-depends.Jannis Pohlmann2012-04-111-1/+2
| | | | | | | | | 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.
* Various small fixes to make the new update-gits work again.Jannis Pohlmann2012-04-101-1/+1
|
* Add a new morphology parser classLars Wirzenius2012-04-091-0/+83
The old morphlib.morphology.Morphlogy class is entangled by having treeish and requires reading from an open file. This is a bad design for the class: the treeish is unnecessary coupling, and the open file makes is harder than necessary to parse a morphology which we don't have as a file on disk. The new class gets the text of the morphology and does not care about treeishes at all. It also acts more like a dictionary, giving more uniform access to the various items, while reducing the amount of code we have in the class. The old class will remain until all uses of it have been eradicated.