diff options
24 files changed, 45 insertions, 34 deletions
diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py index 7ad254cf..7cc2d6ec 100644 --- a/morphlib/plugins/build_plugin.py +++ b/morphlib/plugins/build_plugin.py @@ -22,13 +22,13 @@ import morphlib class BuildPlugin(cliapp.Plugin): def enable(self): - self.app.add_subcommand('build', self.build, + self.app.add_subcommand('build-morphology', self.build_morphology, arg_synopsis='(REPO REF FILENAME)...') def disable(self): pass - def build(self, args): + def build_morphology(self, args): '''Build a binary from a morphology. Command line arguments are the repository, git tree-ish reference, diff --git a/tests.as-root/archless-system-fails.script b/tests.as-root/archless-system-fails.script index 02372b5b..9eaa41ba 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 test:morphs-repo archless archless-system.morph + build-morphology test:morphs-repo archless archless-system.morph diff --git a/tests.as-root/disk-builds-rootfs-and-kernel.script b/tests.as-root/disk-builds-rootfs-and-kernel.script index 475df6c1..5b4f5d78 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 test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system.morph > /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 5204fce1..1578a768 100755 --- a/tests.as-root/make-patch.script +++ b/tests.as-root/make-patch.script @@ -44,7 +44,8 @@ EOF > /dev/null # Build first image. Remember the stratum. -"$SRCDIR/scripts/test-morph" build test:morphs-repo master hello-system.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master hello-system.morph img1=$(find "$DATADIR/cache/artifacts" -maxdepth 1 -name '*.system.*-rootfs') # Modify the chunk, in a new branch. @@ -63,7 +64,8 @@ sed -i 's/master/alfred/' "$DATADIR/morphs-repo/hello-system.morph" > /dev/null # Build second image. -"$SRCDIR/scripts/test-morph" build test:morphs-repo alfred hello-system.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo alfred hello-system.morph 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 c9bd418c..803ffe53 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 test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system.morph > /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 6a968563..3cf39a51 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 test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system.morph > /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 bb5f28cb..4a23669d 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 test:morphs-repo custom system.morph > /dev/null + build-morphology test:morphs-repo custom system.morph > /dev/null diff --git a/tests.as-root/system-overlap.script b/tests.as-root/system-overlap.script index c7e6969a..6911187e 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 test:morphs-repo overlap overlap-system.morph > /dev/null + build-morphology test:morphs-repo overlap overlap-system.morph > /dev/null "$SRCDIR/scripts/list-overlaps" groups \ "$cache"/*.system.overlap-system*.overlaps | while IFS='\n' read overlaps; do diff --git a/tests/build-chunk-failures-dump-log.script b/tests/build-chunk-failures-dump-log.script index e1015744..6f15c640 100755 --- a/tests/build-chunk-failures-dump-log.script +++ b/tests/build-chunk-failures-dump-log.script @@ -36,5 +36,6 @@ EOF git add false.morph git commit --quiet -m "Make a morphology that fails." -"$SRCDIR/scripts/test-morph" build test:chunk-repo master false.morph \ +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo master false.morph \ 2>/dev/null diff --git a/tests/build-chunk-writes-log.script b/tests/build-chunk-writes-log.script index 6b44d3cd..48557703 100755 --- a/tests/build-chunk-writes-log.script +++ b/tests/build-chunk-writes-log.script @@ -19,7 +19,8 @@ set -eu -"$SRCDIR/scripts/test-morph" build test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo farrokh hello.morph SOURCES="$DATADIR/cached-sources" find "$DATADIR/cache/artifacts" -name '*.chunk.*' | diff --git a/tests/build-chunk.script b/tests/build-chunk.script index 3219194d..c73502c2 100755 --- a/tests/build-chunk.script +++ b/tests/build-chunk.script @@ -19,7 +19,8 @@ set -eu -"$SRCDIR/scripts/test-morph" build test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo farrokh hello.morph 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 fee57d7c..06afd9f3 100755 --- a/tests/build-stratum-with-submodules.script +++ b/tests/build-stratum-with-submodules.script @@ -65,7 +65,8 @@ EOF # No build and verify we got a stratum. -"$SRCDIR/scripts/test-morph" build test:morphs-repo master submod-stratum.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master submod-stratum.morph "$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 f4fa15a1..046b66f0 100755 --- a/tests/build-stratum.script +++ b/tests/build-stratum.script @@ -19,7 +19,8 @@ set -eu -"$SRCDIR/scripts/test-morph" build test:morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master hello-stratum.morph "$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 2028e7ff..06edcd29 100755 --- a/tests/build-system-autotools-fails-if-autogen-fails.script +++ b/tests/build-system-autotools-fails-if-autogen-fails.script @@ -33,6 +33,7 @@ chmod a+x "$x/autogen.sh" "$SRCDIR/scripts/run-git-in" "$x" add . "$SRCDIR/scripts/run-git-in" "$x" commit --quiet -m initial -"$SRCDIR/scripts/test-morph" build test:autogen-chunk master detected.morph \ - >/dev/null 2> /dev/null +"$SRCDIR/scripts/test-morph" build-morphology \ + test:autogen-chunk master detected.morph \ + >/dev/null 2> /dev/null diff --git a/tests/build-system-autotools.script b/tests/build-system-autotools.script index 8c29b340..992f34e0 100755 --- a/tests/build-system-autotools.script +++ b/tests/build-system-autotools.script @@ -47,7 +47,8 @@ EOF git add hello.morph git commit --quiet -m "Convert hello to an autotools project" -"$SRCDIR/scripts/test-morph" build test:chunk-repo farrokh hello.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo farrokh hello.morph for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/build-system-cpan.script b/tests/build-system-cpan.script index 7fbe6540..94191395 100755 --- a/tests/build-system-cpan.script +++ b/tests/build-system-cpan.script @@ -53,7 +53,7 @@ git add hello.morph git commit --quiet -m 'convert hello into a perl cpan project' -"$SRCDIR/scripts/test-morph" build --prefix=/ \ +"$SRCDIR/scripts/test-morph" build-morphology --prefix=/ \ test:chunk-repo farrokh hello.morph for chunk in "$DATADIR/cache/artifacts/"*.chunk.* diff --git a/tests/build-system-python-distutils.script b/tests/build-system-python-distutils.script index bdf99623..470b175f 100755 --- a/tests/build-system-python-distutils.script +++ b/tests/build-system-python-distutils.script @@ -51,7 +51,7 @@ git add hello.morph git commit --quiet -m 'convert hello into a python project' -"$SRCDIR/scripts/test-morph" build --prefix= \ +"$SRCDIR/scripts/test-morph" build-morphology --prefix= \ test:chunk-repo farrokh hello.morph for chunk in "$DATADIR/cache/artifacts/"*.chunk.* diff --git a/tests/missing-ref.script b/tests/missing-ref.script index 51ffd459..0ee075d7 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 \ +"$SRCDIR/scripts/test-morph" build-morphology\ test:chunk-repo non-existent-branch hello.morph diff --git a/tests/morphless-chunks.script b/tests/morphless-chunks.script index 8ef653f6..45f88cd8 100755 --- a/tests/morphless-chunks.script +++ b/tests/morphless-chunks.script @@ -60,7 +60,8 @@ git init --quiet git add alfred.morph git commit --quiet -m initial -"$SRCDIR/scripts/test-morph" build test:stratum master alfred.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:stratum master alfred.morph for chunk in "$DATADIR/cache/artifacts/"*.chunk.* do diff --git a/tests/name-clash.script b/tests/name-clash.script index dcc04a8a..974d15b0 100755 --- a/tests/name-clash.script +++ b/tests/name-clash.script @@ -48,10 +48,12 @@ EOF ) # build the dodgy chunk -"$SRCDIR/scripts/test-morph" build test:chunk-repo farrokh goodbye.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:chunk-repo farrokh goodbye.morph # build a stratum -"$SRCDIR/scripts/test-morph" build test:morphs-repo master hello-stratum.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo master hello-stratum.morph # unpack it and check the contents INSTDIR="$DATADIR"/unpack diff --git a/tests/rebuild-cached-stratum.script b/tests/rebuild-cached-stratum.script index 1bea1ae6..dee08dfb 100755 --- a/tests/rebuild-cached-stratum.script +++ b/tests/rebuild-cached-stratum.script @@ -37,8 +37,8 @@ cache="$DATADIR/cache/artifacts" git commit --quiet -m "rebuild-cached-stratum" -a) # Build the first time. -"$SRCDIR/scripts/test-morph" \ - build test:morphs-repo rebuild-cached-stratum hello-stratum.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo rebuild-cached-stratum hello-stratum.morph echo "first build:" (cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | LC_ALL=C sort) @@ -49,8 +49,8 @@ echo "first build:" git commit --quiet -am change) # Rebuild. -"$SRCDIR/scripts/test-morph" \ - build test:morphs-repo rebuild-cached-stratum hello-stratum.morph +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo rebuild-cached-stratum hello-stratum.morph echo "second build:" (cd "$cache" && ls *.chunk.* *hello-stratum | sed 's/^[^.]*\./ /' | LC_ALL=C sort) diff --git a/tests/stratum-overlap-warns.script b/tests/stratum-overlap-warns.script index ab6c6de6..08551333 100755 --- a/tests/stratum-overlap-warns.script +++ b/tests/stratum-overlap-warns.script @@ -28,9 +28,8 @@ warning_mentions(){ grep -F "$1" <"$warnings" >/dev/null 2>/dev/null } -"$SRCDIR/scripts/test-morph" \ - build --log=$log test:morphs-repo overlap overlap-stratum.morph \ - > /dev/null +"$SRCDIR/scripts/test-morph" build-morphology --log=$log \ + test:morphs-repo overlap overlap-stratum.morph > /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 d40d3ba5..6ea0ceac 100755 --- a/tests/stratum-overlap-writes-overlap.script +++ b/tests/stratum-overlap-writes-overlap.script @@ -23,8 +23,8 @@ set -eu cache="$DATADIR/cache/artifacts" -"$SRCDIR/scripts/test-morph" \ - build test:morphs-repo overlap overlap-stratum.morph > /dev/null +"$SRCDIR/scripts/test-morph" build-morphology \ + test:morphs-repo overlap overlap-stratum.morph > /dev/null "$SRCDIR/scripts/list-overlaps" groups \ "$cache"/*.stratum.overlap-stratum.overlaps | while IFS='\n' read overlaps; do diff --git a/tests/uses-tempdir.script b/tests/uses-tempdir.script index 4143926f..b4cc2688 100755 --- a/tests/uses-tempdir.script +++ b/tests/uses-tempdir.script @@ -23,5 +23,5 @@ export TMPDIR TMPDIR="$DATADIR"/unwritable-tmp install -m 000 -d "$TMPDIR" mkdir "$DATADIR"/tmp -"$SRCDIR/scripts/test-morph" build --tempdir "$DATADIR"/tmp \ +"$SRCDIR/scripts/test-morph" build-morphology --tempdir "$DATADIR"/tmp \ test:morphs-repo master hello-stratum.morph |