summaryrefslogtreecommitdiff
path: root/morphlib
Commit message (Collapse)AuthorAgeFilesLines
* Avoid rebuilds when unimportant morphology contents changeJonathan Maw2012-11-291-0/+8
| | | | | | | | This changes the cache key generation so that it will ignore unimportant fields of the morphology, e.g. description, build-depends, chunks. description is unimportant because it does not affect building, and build-depends/chunks are unimportant because they are already considered
* Change method comments to docstringsLars Wirzenius2012-11-291-3/+6
| | | | This also makes coverage.py be silent on Debian squeeze.
* Use the builder runcmd, to get build environment rightLars Wirzenius2012-11-291-6/+4
|
* Reformat code, plus adapt for non-staging-area buildsLars Wirzenius2012-11-292-16/+22
|
* Refactor and fix to make it pass (more of) the test suiteLars Wirzenius2012-11-292-10/+29
|
* Hardlinked chroot done with linux-user-chrootJoe Burmeister2012-11-292-34/+64
| | | | | | | | | | | | | | The patch gives two things. Improves morph build time by reusing decompressed files of chunks/stage-fillers with hardlinks from the chroot. Rather than decompressing each time into each chroot. Original: real 5h 17m 47s Hardlink: real 2h 52m 27s It uses linux-user-chroot to create the chroot and make all but the basics readonly.
* Don't store original filename in compressed image filesSam Thursfield2012-11-161-1/+2
| | | | | | | gzip files can store the name and date of the uncompressed original, and this is displayed in some GUI archive managers, or when gunzip -N is used. In our case the original filename is something like 'tmpXsgaY15', which is useless information and serves only to confuse.
* Cleanly handle out of disk space on target filesystem.Sam Thursfield2012-11-151-1/+7
| | | | Includes new test.
* Override Python tarfile module to close file handles on exceptionSam Thursfield2012-11-151-0/+15
| | | | Reported upstream as: http://bugs.python.org/issue16477
* Close file handles correctly on exceptions when unpacking strataSam Thursfield2012-11-152-23/+25
| | | | | | | 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.
* Consistency fixSam Thursfield2012-11-151-1/+1
|
* Revert "Merge remote-tracking branch 'origin/jonathanmaw/autotools-sysconfdir'"water-bombSam Thursfield2012-11-131-1/+1
| | | | | | | | | | cmake has a ./configure, which accepts --prefix, but chokes on --sysconfdir This means that bootstrap is broken by this commit. This reverts commit 5f22ded9711a047704fc91b68a182b057e29bc0f, reversing changes made to e13753d4f3e26f3a4c705fb3e694ae8dea860c2d.
* Merge branch 'samthursfield/build-without-push' of ↵Richard Maw2012-11-128-17/+66
|\ | | | | | | git://git.baserock.org/baserock/morph
| * Avoid caching repos that are on the local machine anywaySam Thursfield2012-11-125-5/+30
| | | | | | | | | | Currently the message is still displayed "Updating xxx" but no update is actually done.
| * morph build: Allow forcing build branches to be pushedSam Thursfield2012-11-123-4/+10
| | | | | | | | | | This is for users who prefer the old behaviour of building from the remote repos.
| * morph build: Use the user's own repos when buildingSam Thursfield2012-11-121-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | This means that Morph no longer requires changes to be pushed in order to build them. The repos from the system branch are currently cached in the local repo cache as part of the build process, which is far from ideal. Tests for 'morph build' now test build without push. The build metadata now includes a repo path that is inside the TMPDIR, so the tests have been rewritten to avoid having any hardcoded cache keys because the cache keys are no longer static.
| * Add docstrings for some build functionsSam Thursfield2012-11-121-0/+9
| |
* | Merge branch 'samthursfield/spelling-fixes' of ↵Richard Maw2012-11-123-5/+5
|\ \ | | | | | | | | | git://git.baserock.org/baserock/morph
| * | Fix spelling mistakesSam Thursfield2012-11-123-5/+5
| |/
* | Set sysconfdir to /etc when morph builds an autotools projectJonathan Maw2012-11-081-1/+1
| | | | | | | | | | | | Some autotools projects default their sysconfdir to $prefix/etc. This leads to some projects trying to install files to /usr/etc, which is not desired.
* | Merge branch 'liw/expand-repo-plugin' of git://git.baserock.org/baserock/morphRichard Maw2012-11-081-0/+42
|\ \ | |/ |/| | | Unused imports in morphlib/plugins/expand_repo_plugin.py were also removed
| * Add a morph helper subcommand for expanding aliased reposLars Wirzenius2012-11-071-0/+53
|/ | | | | This is helpful for when the user is not sure what an aliases repo URL actually expands to.
* Process systems for merging in a fixed orderSam Thursfield2012-11-051-1/+1
| | | | | | | | | | | The test tests.merging/rename-stratum could potentially trigger two different errors in Morph, based on the order that the systems in the root repo were processed. This meant that the test would sometimes spuriously fail if TMPDIR was manually set, because of differences in the way file systems work. To fix the root cause requires proper 3-way merging, really.
* Fix use of variable before assignmentSam Thursfield2012-11-021-0/+1
| | | | | | BranchAndMergePlugin.load_morphology() would crash if a parse error occurred while reading a morphology from a specific revision in git, instead of from on disk.
* Merge remote-tracking branch 'remotes/origin/samthursfield/update-help'Lars Wirzenius2012-10-318-162/+121
|\
| * Set option group for some advanced settingsSam Thursfield2012-10-312-21/+38
| | | | | | | | | | | | | | | | It would be nice to put every option in a group, but for now the built-in cliapp options cannot be grouped so the output is less than ideal. Also, we have no way of setting an order for groups, which results in e.g. 'Advanced Options' preceeding 'General Options' etc.
| * Improve command descriptions in --helpSam Thursfield2012-10-265-47/+31
| | | | | | | | | | Make sure all commands have one line of description, and reduce the size of some which had large amounts of text.
| * Remove hello-pluginSam Thursfield2012-10-261-29/+0
| | | | | | | | | | | | We have several plugins now that can be used as examples, and since cliapp does not yet support hiding commands Morph currently has a futile 'morph hello' command listed in --help.
| * Reduce some option descriptionsSam Thursfield2012-10-261-27/+13
| |
| * Reorder settings by broad categorySam Thursfield2012-10-261-58/+59
| | | | | | | | | | | | | | | | Also remove the '--ignore-submodules' option, which is redundant. Hopefully cliapp will one day support option grouping, so we can hide some sets by default and group eg. all the logging options together.
* | Write /etc/os-release in system imagesSam Thursfield2012-10-261-1/+14
|/ | | | | | This is intended to for human consumption, with the full set of metadata in /baserock/system-artifact-name.meta. It currently lists system name, the symbolic ref of the system morphology and build date.
* Write metadata for the rootfs itself into the rootfsSam Thursfield2012-10-262-2/+4
| | | | | | | | This makes it easier to identify what version of a system we are running. Tests are updated to check inside the contents of the rootfs we created, and the code to mount the rootfs as a loopback device was extracted out into tests.as-root/lib
* Merge branch 'samthursfield/morph-status-in-workspace-sorted'Sam Thursfield2012-10-181-2/+3
|\ | | | | | | Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
| * morph status: Sort list of system branches in a workspaceSam Thursfield2012-10-181-2/+3
| | | | | | | | | | Output needs to be stable, not least so that the test doesn't fail sporadically.
* | Merge branch 'samthursfield/petrify-avoid-edited-chunks' of ↵Richard Maw2012-10-181-18/+39
|\ \ | |/ |/| | | git://git.baserock.org/baserock/morph
| * morph petrify: Avoid petrifying chunks that have already been editedSam Thursfield2012-10-181-18/+39
|/ | | | | | | | | | | | | This change causes 'morph petrify' to avoid petrifying any chunk whose ref matches the current system branch, because it makes no sense to petrify something that is also being edited. It also improves efficiency slightly and adds warning where different systems point to different refs of the same stratum. A non-obvious effect of this is that if you try to petrify 'master', many of the chunks won't get petrified because they are built from 'master'. However, petrifying master makes no sense so I'm not sure that we need to worry.
* morph status, foreach: Find root repo in correct waySam Thursfield2012-10-121-5/+8
| | | | | | | | Previously if the user had renamed the directory holding the root repository, the commands would break tragically. Also fix find_repository() to avoid aborting if it encounters a git repo in the branch checkout that wasn't put there by Morph.
* Factor out common function iterate_branch_repos()Sam Thursfield2012-10-121-10/+14
|
* morph status: Add initial version of commandSam Thursfield2012-10-121-0/+57
| | | | This provides a user-friendly summary of the workspace or branch status.
* Reorder branch and merge plumbing commands to end of fileSam Thursfield2012-10-121-25/+30
| | | | | Users do not need these now due to 'morph status' existing. However, they are still useful for scripts to call.
* Fix use of GzipFile to not assume "with" protocolLars Wirzenius2012-10-122-5/+7
| | | | | This fixes a bunch of tests so they pass on squeeze, which has a version of Python whose GzipFile doesn't support the "with" protocol.
* Merge remote-tracking branch ↵Daniel Silverstone2012-10-111-8/+83
|\ | | | | | | | | | | 'origin/samthursfield/S4873-warn-when-merge-causes-petrification' Renamed petrification test slightly as merge fixup.
| * morph merge: Warn if a merge will cause unexpected petrificationSam Thursfield2012-10-111-8/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | The concept of a component path is new. This is simply a concise way of referring to a component in an error message, and looks like this: base-system-x86_64-generic.bsp-x86_64-generic.linux We currently only touch the 'edited chunks' in merge_stratum(), i.e. those in the FROM branch where 'morph edit' was run. However, the petrification can affect any chunk so there is a new method added to obtain all components in a morphology. This function also returns the differences between the two, which we will make use of at a later date.
* | Validate that systems, strata reference correct kindsLars Wirzenius2012-10-111-0/+43
| |
* | Warn about unknown morphology fieldsLars Wirzenius2012-10-111-0/+32
| |
* | Add morphology validation to branch+mergeLars Wirzenius2012-10-111-0/+35
| |
* | Handle ValueErrors from JSON libraryLars Wirzenius2012-10-111-1/+7
|/
* morph foreach: Handle repos addressed by full URLs correctlySam Thursfield2012-10-101-3/+5
| | | | | | | | | | This should not normally be used, because we make no attempt to detect when a full URL and a keyed URL are equivalent, so they cannot be used interchangably. However, 'foreach' would previously fail completely if the branch root happened to be a full URL because it didn't call convert_uri_to_path() correctly.
* Make hardlink paths relativeRichard Maw2012-10-091-0/+3
| | | | | | Symlink paths are not altered, since their paths are relative to where the link is, not the root of the file system, and should be handled by the chunk's creation.
* Use os.path.relpath for fixing paths in tarball system builderRichard Maw2012-10-091-4/+2
|