diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-11 18:05:56 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-12 14:13:42 +0100 |
commit | 4e37fdf5adbf4d25561b472b4089b6782c599f93 (patch) | |
tree | 82182fee7bd6f56a91b392c12dfb5cede7b4455b | |
parent | 6b63ab3036e869c92b3c5d6471e4856df3583019 (diff) | |
download | morph-4e37fdf5adbf4d25561b472b4089b6782c599f93.tar.gz |
Don't require .morph in triplet arguments
This gives us consistency with morphologies, where the triplets are
repo|ref|morphology, not repo|ref|filename
Anyone who runs 'morph build baserock:morphs master system.morph' will
now see an error ending with 'was looking for system.morph.morph', which
should make it clear where they have gone wrong.
32 files changed, 46 insertions, 52 deletions
@@ -24,8 +24,8 @@ used to actually run the build. The usual workflow is this: Eventually, `morph` will get a manual page. Meanwhile, a short usage: - fakeroot morph --keep-path -v build morphs master foundation.morph - sudo morph --keep-path -v build morphs master base-system.morph + fakeroot morph --keep-path -v build-morphology morphs master foundation + sudo morph --keep-path -v build-morphology morphs master base-system (Run with `fakeroot`, when building anything but a system image; run with `sudo` when building a system image.) diff --git a/baserock-bootstrap b/baserock-bootstrap index 51d5f4f0..12917ffa 100755 --- a/baserock-bootstrap +++ b/baserock-bootstrap @@ -18,17 +18,17 @@ case "$(uname -m)" in *armv7*) export LFS_TGT=$(uname -m)-lfs-linux-gnueabi export TARGET_CFLAGS="-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -O2" - export PASS3_STRATUM="imx53-bootstrap-pass3.morph" + export PASS3_STRATUM="imx53-bootstrap-pass3" ;; *armv5*) export LFS_TGT=$(uname -m)-lfs-linux-gnueabi export TARGET_CFLAGS="-march=armv5 -O2" - export PASS3_STRATUM="imx53-bootstrap-pass3.morph" + export PASS3_STRATUM="imx53-bootstrap-pass3" ;; *) export LFS_TGT=$(uname -m)-lfs-linux-gnu export TARGET_CFLAGS="-O2" - export PASS3_STRATUM="x86_64-generic-bootstrap-pass3.morph" + export PASS3_STRATUM="x86_64-generic-bootstrap-pass3" ;; esac @@ -68,7 +68,7 @@ pass1_get_sources_with_morph() cd $LFS/baserock/gits/morph $HOST_MKDIR -p $LFS/baserock/cache python ./morph --verbose update-gits \ - baserock:morphs master bootstrap-pass1.morph \ + baserock:morphs master bootstrap-pass1 \ --cachedir=$LFS/baserock/cache \ --log=$LFS/baserock/morph.log \ --dump-memory-profile=none \ @@ -82,7 +82,7 @@ pass1_build_with_morph() $HOST_MKDIR -p $LFS/baserock/cache $HOST_MKDIR -p $LFS/tmp python ./morph --verbose build-morphology \ - baserock:morphs master bootstrap-pass1.morph \ + baserock:morphs master bootstrap-pass1 \ --no-git-update \ --no-distcc \ --no-ccache \ @@ -176,7 +176,7 @@ cd /baserock/gits/morph mkdir -p /baserock/cache export PATH="/usr/bin:/bin:$tools/bin:$tools/sbin" python ./morph --verbose update-gits \ - baserock:morphs master bootstrap-pass2.morph \ + baserock:morphs master bootstrap-pass2 \ --bootstrap \ --cachedir=/baserock/cache \ --log=/baserock/morph.log \ @@ -224,7 +224,7 @@ mkdir -p /baserock/cache export PATH="/usr/bin:/bin:$tools/bin:$tools/sbin" export LD_LIBRARY_PATH="/usr/lib:/lib:/lib64:/tools/lib:/tools/lib64" python ./morph --verbose build-morphology \ - baserock:morphs master bootstrap-pass2.morph \ + baserock:morphs master bootstrap-pass2 \ --bootstrap \ --no-git-update \ --cachedir=/baserock/cache \ diff --git a/morphlib/app.py b/morphlib/app.py index 508e0975..cbe8c63d 100755 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -173,7 +173,7 @@ class Morph(cliapp.Application): while args: assert len(args) >= 2, args - yield args[0], args[1], args[2] + yield args[0], args[1], args[2] + ".morph" args = args[3:] def _itertriplets(self, *args): diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index d6485c2b..2ab18869 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -320,7 +320,8 @@ class BranchAndMergePlugin(cliapp.Plugin): app = self.app cache = morphlib.util.new_repo_caches(app)[0] - for filename in args: + for morphology_name in args: + filename = morphology_name + '.morph' with open(filename) as f: morph = morphlib.morph2.Morphology(f.read()) @@ -708,7 +709,7 @@ class BranchAndMergePlugin(cliapp.Plugin): build_command) build_command.build([branch_root, build_repos[branch_root]['build-ref'], - '%s.morph' % system_name]) + system_name]) # Delete the temporary refs on the server. self.delete_remote_build_refs(build_repos) diff --git a/tests.as-root/archless-system-fails.script b/tests.as-root/archless-system-fails.script index 9eaa41ba..5006c061 100755 --- a/tests.as-root/archless-system-fails.script +++ b/tests.as-root/archless-system-fails.script @@ -43,4 +43,4 @@ git add archless-system.morph git commit --quiet -m "add archless system" "$SRCDIR/scripts/test-morph" \ - build-morphology test:morphs-repo archless archless-system.morph + build-morphology test:morphs-repo archless archless-system diff --git a/tests.as-root/disk-builds-rootfs-and-kernel.script b/tests.as-root/disk-builds-rootfs-and-kernel.script index 5b4f5d78..f9748ca9 100755 --- a/tests.as-root/disk-builds-rootfs-and-kernel.script +++ b/tests.as-root/disk-builds-rootfs-and-kernel.script @@ -84,7 +84,7 @@ git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' "$SRCDIR/scripts/test-morph" \ - build-morphology test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system > /dev/null for suffix in kernel rootfs do diff --git a/tests.as-root/make-patch.script b/tests.as-root/make-patch.script index 1578a768..de1ce172 100755 --- a/tests.as-root/make-patch.script +++ b/tests.as-root/make-patch.script @@ -45,7 +45,7 @@ EOF # Build first image. Remember the stratum. "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-system.morph + test:morphs-repo master hello-system img1=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.system.*-rootfs') # Modify the chunk, in a new branch. @@ -65,7 +65,7 @@ sed -i 's/master/alfred/' "$DATADIR/morphs-repo/hello-system.morph" # Build second image. "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo alfred hello-system.morph + test:morphs-repo alfred hello-system img2=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.system.*' \ ! -name $(basename "$img1")) diff --git a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script index 803ffe53..c20efff5 100755 --- a/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script +++ b/tests.as-root/rootfs-tarball-builds-rootfs-and-kernel.script @@ -85,7 +85,7 @@ git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' "$SRCDIR/scripts/test-morph" \ - build-morphology test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system > /dev/null for suffix in kernel rootfs do diff --git a/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script b/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script index 3cf39a51..f996aaa4 100755 --- a/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script +++ b/tests.as-root/syslinux-disk-builds-rootfs-and-kernel.script @@ -91,7 +91,7 @@ git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' "$SRCDIR/scripts/test-morph" \ - build-morphology test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system > /dev/null for suffix in kernel rootfs do diff --git a/tests.as-root/syslinux-fails-if-no-mbr-found.script b/tests.as-root/syslinux-fails-if-no-mbr-found.script index 4a23669d..ea1d135d 100755 --- a/tests.as-root/syslinux-fails-if-no-mbr-found.script +++ b/tests.as-root/syslinux-fails-if-no-mbr-found.script @@ -91,4 +91,4 @@ git add linux.morph git commit --quiet -m 'Make the kernel create a dummy zImage' "$SRCDIR/scripts/test-morph" --syslinux-mbr-search-path=nosuchfile.bin \ - build-morphology test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system > /dev/null diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script index 6911187e..5e995062 100755 --- a/tests.as-root/system-overlap.script +++ b/tests.as-root/system-overlap.script @@ -132,7 +132,7 @@ git add overlap-*.morph git commit --quiet -m 'Add overlapping chunks' "$SRCDIR/scripts/test-morph" \ - build-morphology test:morphs-repo overlap overlap-system.morph > /dev/null + build-morphology test:morphs-repo overlap overlap-system > /dev/null "$SRCDIR/scripts/list-overlaps" groups \ "$cache"/*.system.overlap-system*.overlaps | while IFS='\n' read overlaps; do diff --git a/tests.branching/petrify.script b/tests.branching/petrify.script index 502c8220..d6c380b2 100755 --- a/tests.branching/petrify.script +++ b/tests.branching/petrify.script @@ -23,10 +23,9 @@ set -eu cd "$DATADIR/workspace" "$SRCDIR/scripts/test-morph" init -"$SRCDIR/scripts/test-morph" update-gits baserock:morphs master \ - hello-stratum.morph +"$SRCDIR/scripts/test-morph" update-gits baserock:morphs master hello-stratum "$SRCDIR/scripts/test-morph" checkout baserock:morphs master cd master/baserock:morphs -"$SRCDIR/scripts/test-morph" petrify hello-stratum.morph +"$SRCDIR/scripts/test-morph" petrify hello-stratum cat hello-stratum.morph diff --git a/tests/build-chunk-failures-dump-log.script b/tests/build-chunk-failures-dump-log.script index 6f15c640..05a3bd8a 100755 --- a/tests/build-chunk-failures-dump-log.script +++ b/tests/build-chunk-failures-dump-log.script @@ -37,5 +37,5 @@ git add false.morph git commit --quiet -m "Make a morphology that fails." "$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo master false.morph \ + test:chunk-repo master false \ 2>/dev/null diff --git a/tests/build-chunk-writes-log.script b/tests/build-chunk-writes-log.script index 48557703..e34914df 100755 --- a/tests/build-chunk-writes-log.script +++ b/tests/build-chunk-writes-log.script @@ -19,8 +19,7 @@ set -eu -"$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello SOURCES="$DATADIR/cached-sources" find "$DATADIR/cache/artifacts" -name '*.chunk.*' | diff --git a/tests/build-chunk.script b/tests/build-chunk.script index c73502c2..e69515b3 100755 --- a/tests/build-chunk.script +++ b/tests/build-chunk.script @@ -19,8 +19,7 @@ set -eu -"$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/build-stratum-with-submodules.script b/tests/build-stratum-with-submodules.script index 06afd9f3..2a99b12d 100755 --- a/tests/build-stratum-with-submodules.script +++ b/tests/build-stratum-with-submodules.script @@ -66,7 +66,7 @@ EOF # No build and verify we got a stratum. "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master submod-stratum.morph + test:morphs-repo master submod-stratum "$SRCDIR/scripts/assemble-stratum" --cachedir "$DATADIR/cache" \ "$DATADIR/cache/artifacts/"*submod-stratum \ "$DATADIR/stratum.tar" submod-stratum diff --git a/tests/build-stratum.script b/tests/build-stratum.script index 046b66f0..d4909e9a 100755 --- a/tests/build-stratum.script +++ b/tests/build-stratum.script @@ -20,7 +20,7 @@ set -eu "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-stratum.morph + test:morphs-repo master hello-stratum "$SRCDIR/scripts/assemble-stratum" --cachedir "$DATADIR/cache" \ "$DATADIR/cache/artifacts/"*.hello-stratum \ "$DATADIR/stratum.tar" hello-stratum diff --git a/tests/build-system-autotools-fails-if-autogen-fails.script b/tests/build-system-autotools-fails-if-autogen-fails.script index 06edcd29..fb80fc72 100755 --- a/tests/build-system-autotools-fails-if-autogen-fails.script +++ b/tests/build-system-autotools-fails-if-autogen-fails.script @@ -34,6 +34,6 @@ chmod a+x "$x/autogen.sh" "$SRCDIR/scripts/run-git-in" "$x" commit --quiet -m initial "$SRCDIR/scripts/test-morph" build-morphology \ - test:autogen-chunk master detected.morph \ + test:autogen-chunk master detected \ >/dev/null 2> /dev/null diff --git a/tests/build-system-autotools.script b/tests/build-system-autotools.script index 992f34e0..f23eb04e 100755 --- a/tests/build-system-autotools.script +++ b/tests/build-system-autotools.script @@ -47,8 +47,7 @@ EOF git add hello.morph git commit --quiet -m "Convert hello to an autotools project" -"$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology test:chunk-repo farrokh hello for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/build-system-cpan.script b/tests/build-system-cpan.script index 94191395..aec91873 100755 --- a/tests/build-system-cpan.script +++ b/tests/build-system-cpan.script @@ -54,7 +54,7 @@ git add hello.morph git commit --quiet -m 'convert hello into a perl cpan project' "$SRCDIR/scripts/test-morph" build-morphology --prefix=/ \ - test:chunk-repo farrokh hello.morph + test:chunk-repo farrokh hello for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script index 470b175f..d7be93bd 100755 --- a/tests/build-system-python-distutils.script +++ b/tests/build-system-python-distutils.script @@ -52,7 +52,7 @@ git add hello.morph git commit --quiet -m 'convert hello into a python project' "$SRCDIR/scripts/test-morph" build-morphology --prefix= \ - test:chunk-repo farrokh hello.morph + test:chunk-repo farrokh hello for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/missing-ref.script b/tests/missing-ref.script index 0ee075d7..2da9fa05 100755 --- a/tests/missing-ref.script +++ b/tests/missing-ref.script @@ -17,6 +17,6 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -"$SRCDIR/scripts/test-morph" build-morphology\ - test:chunk-repo non-existent-branch hello.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo non-existent-branch hello diff --git a/tests/morphless-chunks.script b/tests/morphless-chunks.script index 45f88cd8..315f42ea 100755 --- a/tests/morphless-chunks.script +++ b/tests/morphless-chunks.script @@ -60,8 +60,7 @@ git init --quiet git add alfred.morph git commit --quiet -m initial -"$SRCDIR/scripts/test-morph" build-morphology \ - test:stratum master alfred.morph +"$SRCDIR/scripts/test-morph" build-morphology test:stratum master alfred for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/name-clash.script b/tests/name-clash.script index 974d15b0..9a3e942b 100755 --- a/tests/name-clash.script +++ b/tests/name-clash.script @@ -49,11 +49,11 @@ EOF # build the dodgy chunk "$SRCDIR/scripts/test-morph" build-morphology \ - test:chunk-repo farrokh goodbye.morph + test:chunk-repo farrokh goodbye # build a stratum "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo master hello-stratum.morph + test:morphs-repo master hello-stratum # unpack it and check the contents INSTDIR="$DATADIR"/unpack diff --git a/tests/rebuild-cached-stratum.script b/tests/rebuild-cached-stratum.script index dee08dfb..2615fb30 100755 --- a/tests/rebuild-cached-stratum.script +++ b/tests/rebuild-cached-stratum.script @@ -38,7 +38,7 @@ cache="$DATADIR/cache/artifacts" # Build the first time. "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo rebuild-cached-stratum hello-stratum.morph + test:morphs-repo rebuild-cached-stratum hello-stratum echo "first build:" (cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | LC_ALL=C sort) @@ -50,7 +50,7 @@ echo "first build:" # Rebuild. "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo rebuild-cached-stratum hello-stratum.morph + test:morphs-repo rebuild-cached-stratum hello-stratum echo "second build:" (cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | LC_ALL=C sort) diff --git a/tests/show-dependencies.script b/tests/show-dependencies.script index d7495f35..aad036e9 100755 --- a/tests/show-dependencies.script +++ b/tests/show-dependencies.script @@ -20,5 +20,5 @@ set -eu "$SRCDIR/scripts/test-morph" \ - show-dependencies test:test-repo master xfce-core.morph | + show-dependencies test:test-repo master xfce-core | sed 's/test://' diff --git a/tests/stratum-overlap-warns.script b/tests/stratum-overlap-warns.script index 08551333..8cf1606c 100755 --- a/tests/stratum-overlap-warns.script +++ b/tests/stratum-overlap-warns.script @@ -29,7 +29,7 @@ warning_mentions(){ } "$SRCDIR/scripts/test-morph" build-morphology --log=$log \ - test:morphs-repo overlap overlap-stratum.morph > /dev/null + test:morphs-repo overlap overlap-stratum > /dev/null grep WARNING "$log" >"$warnings" for str in overlap-stratum \ overlap-foo-baz overlap-foobar bin/bar \ diff --git a/tests/stratum-overlap-writes-overlap.script b/tests/stratum-overlap-writes-overlap.script index 6ea0ceac..d06b4677 100755 --- a/tests/stratum-overlap-writes-overlap.script +++ b/tests/stratum-overlap-writes-overlap.script @@ -24,7 +24,7 @@ cache="$DATADIR/cache/artifacts" "$SRCDIR/scripts/test-morph" build-morphology \ - test:morphs-repo overlap overlap-stratum.morph > /dev/null + test:morphs-repo overlap overlap-stratum > /dev/null "$SRCDIR/scripts/list-overlaps" groups \ "$cache"/*.stratum.overlap-stratum.overlaps | while IFS='\n' read overlaps; do diff --git a/tests/update-gits-chunk.script b/tests/update-gits-chunk.script index 8e42acd9..b07aef17 100755 --- a/tests/update-gits-chunk.script +++ b/tests/update-gits-chunk.script @@ -26,7 +26,7 @@ git checkout --quiet farrokh git commit --quiet --allow-empty --allow-empty-message -m "" NEWREF="$(git show-ref --hash farrokh)" -"$SRCDIR/scripts/test-morph" update-gits test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" update-gits test:chunk-repo farrokh hello # check the top commit of the cached repo's farrokh branch cd "$DATADIR/cache/gits/"*chunk?repo* diff --git a/tests/update-gits-stratum.script b/tests/update-gits-stratum.script index 13ce249c..24b6f199 100755 --- a/tests/update-gits-stratum.script +++ b/tests/update-gits-stratum.script @@ -26,8 +26,7 @@ git checkout --quiet farrokh git commit --quiet --allow-empty --allow-empty-message -m "" NEWREF="$(git show-ref --hash farrokh)" -"$SRCDIR/scripts/test-morph" update-gits \ - test:morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" update-gits test:morphs-repo master hello-stratum # check the top commit of the cached repo's farrokh branch cd "$DATADIR/cache/gits/"*chunk?repo* diff --git a/tests/update-gits-submodules.script b/tests/update-gits-submodules.script index 01be003e..49f4de62 100755 --- a/tests/update-gits-submodules.script +++ b/tests/update-gits-submodules.script @@ -33,8 +33,7 @@ chunkrepo="$DATADIR/chunk-repo" > /dev/null "$SRCDIR/scripts/run-git-in" "$chunkrepo" commit --quiet -m "add submodule" -"$SRCDIR/scripts/test-morph" update-gits \ - test:morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" update-gits test:morphs-repo master hello-stratum test -d "$DATADIR/cache/gits/"*chunk?repo* && echo chunk-repo cached test -d "$DATADIR/cache/gits/"*morphs?repo* && echo morphs-repo cached diff --git a/tests/uses-tempdir.script b/tests/uses-tempdir.script index b4cc2688..328413dd 100755 --- a/tests/uses-tempdir.script +++ b/tests/uses-tempdir.script @@ -24,4 +24,4 @@ TMPDIR="$DATADIR"/unwritable-tmp install -m 000 -d "$TMPDIR" mkdir "$DATADIR"/tmp "$SRCDIR/scripts/test-morph" build-morphology --tempdir "$DATADIR"/tmp \ - test:morphs-repo master hello-stratum.morph + test:morphs-repo master hello-stratum |