From 4d794d475e01363928916f7667a63eed6071f5e2 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Sun, 10 Aug 2014 20:29:41 +0100 Subject: yarns: Start from petrified refs This is closer to our current workflow, where we are always petrified and update the ref field when we need to update a component. This required rearranging the operations to create the chunk repository before the definitions repository, and remove a check that assumes we weren't already petrified. --- yarns/branches-workspaces.yarn | 1 - yarns/implementations.yarn | 53 ++++++++++++++++++++++-------------------- yarns/regression.yarn | 3 ++- yarns/splitting.yarn | 9 ++++--- 4 files changed, 36 insertions(+), 30 deletions(-) (limited to 'yarns') diff --git a/yarns/branches-workspaces.yarn b/yarns/branches-workspaces.yarn index 995a9450..2f617ce4 100644 --- a/yarns/branches-workspaces.yarn +++ b/yarns/branches-workspaces.yarn @@ -178,7 +178,6 @@ all the refs are unchanged. GIVEN a workspace AND a git server WHEN the user creates a system branch called foo - THEN in branch foo, stratum strata/test-stratum.morph refs test-chunk in master Edit the chunk. We make use of special knowledge here: `test:test-chunk` is a chunk repository created in the mocked git server, for testing diff --git a/yarns/implementations.yarn b/yarns/implementations.yarn index 24f67a1b..66dd9d57 100644 --- a/yarns/implementations.yarn +++ b/yarns/implementations.yarn @@ -67,7 +67,28 @@ another to hold a chunk. # Create a directory for all the git repositories. mkdir "$DATADIR/gits" - # Create a repo for the system and stratum morphologies. + # Create the chunk repository. + + mkdir "$DATADIR/gits/test-chunk" + + run_in "$DATADIR/gits/test-chunk" git init . + cat > "$DATADIR/gits/test-chunk/test-bin" <<'EOF' + #!/bin/sh + echo Hello World + EOF + cat > "$DATADIR/gits/test-chunk/test.h" <<'EOF' + int foo(void); + EOF + cat > "$DATADIR/gits/test-chunk/test.pc" <<'EOF' + prefix=/usr + includedir=${prefix}/include + Name: test + Cflags: -I{includedir} + EOF + run_in "$DATADIR/gits/test-chunk" git add . + run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. + + # Create a repo for the morphologies. mkdir "$DATADIR/gits/morphs" @@ -88,15 +109,12 @@ another to hold a chunk. - name: test-chunk repo: test:test-chunk morph: test-chunk.morph - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] EOF - # Create the chunk repository. - - mkdir "$DATADIR/gits/test-chunk" - # To verify that chunk splitting works, we have a chunk that installs # dummy files in all the places that different kinds of files are # usually installed. e.g. executables in `/bin` and `/usr/bin` @@ -240,23 +258,6 @@ another to hold a chunk. run_in "$DATADIR/gits/morphs" git commit -m Initial. run_in "$DATADIR/gits/morphs" git tag -a "test-tag" -m "Tagging test-tag" - run_in "$DATADIR/gits/test-chunk" git init . - cat > "$DATADIR/gits/test-chunk/test-bin" <<'EOF' - #!/bin/sh - echo Hello World - EOF - cat > "$DATADIR/gits/test-chunk/test.h" <<'EOF' - int foo(void); - EOF - cat > "$DATADIR/gits/test-chunk/test.pc" <<'EOF' - prefix=/usr - includedir=${prefix}/include - Name: test - Cflags: -I{includedir} - EOF - run_in "$DATADIR/gits/test-chunk" git add . - run_in "$DATADIR/gits/test-chunk" git commit --allow-empty -m Initial. - # Create the Morph configuration file so we can access the repos # using test:foo URL aliases. @@ -293,7 +294,8 @@ have a morphology using the test architecture. - name: stage1-chunk morph: stage1-chunk.morph repo: test:test-chunk - ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) + unpetrify-ref: master build-mode: bootstrap build-depends: [] EOF @@ -307,7 +309,8 @@ have a morphology using the test architecture. - name: test-chunk morph: test-chunk.morph repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] EOF diff --git a/yarns/regression.yarn b/yarns/regression.yarn index e5b3d875..6f499d90 100644 --- a/yarns/regression.yarn +++ b/yarns/regression.yarn @@ -90,7 +90,8 @@ Implementations - name: bootstrap-chunk morph: bootstrap-chunk.morph repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: bootstrap build-depends: [] EOF diff --git a/yarns/splitting.yarn b/yarns/splitting.yarn index 1b67a881..d4b942d8 100644 --- a/yarns/splitting.yarn +++ b/yarns/splitting.yarn @@ -141,7 +141,8 @@ Implementations chunks: - name: test-chunk repo: test:test-chunk - ref: master + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) morph: test-chunk.morph build-mode: test build-depends: [] @@ -189,13 +190,15 @@ Implementations chunks: - name: test-chunk repo: test:test-chunk - ref: master morph: test-chunk.morph + unpetrify-ref: master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) build-mode: test build-depends: [] - name: unbuildable-chunk repo: test:test-chunk - ref: refs/heads/master + unpetrify-ref: refs/heads/master + ref: $(run_in "$DATADIR/gits/test-chunk" git rev-parse master) morph: unbuildable-chunk.morph build-mode: test build-depends: -- cgit v1.2.1