summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-10 13:52:38 -0700
committerMichael Forney <mforney@mforney.org>2016-04-15 02:10:08 -0700
commit02680c5c5fa0efceb1a5222f072b0a4a9e8b18cc (patch)
tree235daaf76ff5774f85e2ee1fbb4390f9876d12bc
parent8613a3571e738d57096da8b6b9da2d1535a80b0d (diff)
Add gitarchive rule to create tar archive of root filesystem
-rw-r--r--config.ninja2
-rw-r--r--gen.rc3
-rw-r--r--rules.ninja9
3 files changed, 9 insertions, 5 deletions
diff --git a/config.ninja b/config.ninja
index 522687bf..4c2c5d5c 100644
--- a/config.ninja
+++ b/config.ninja
@@ -9,4 +9,4 @@ yacc = yacc
python = python
perl = perl
-repo = root.git
+repo = root
diff --git a/gen.rc b/gen.rc
index 4ecdff9b..ca1919d0 100644
--- a/gen.rc
+++ b/gen.rc
@@ -106,7 +106,8 @@ printf '%s\n' $root_perms >$outdir/root_perms.txt
file .perms '$outdir'/root_perms.txt 644
ninja_vars='tag = tree' {
- build '$repo/refs/tags/tree' gittree $root_inputs '|' '$repo.stamp' '$root_srcdir/scripts/tree.rc'
+ build '$repo.git/refs/tags/tree' gittree $root_inputs '|' '$repo.stamp' '$root_srcdir/scripts/tree.rc'
+ build '$repo.tar' gitarchive '|' '$repo.git/refs/tags/tree'
}
for(pkg in $packages) subninja core/$pkg/local.ninja
diff --git a/rules.ninja b/rules.ninja
index e4c8a519..63e5eab5 100644
--- a/rules.ninja
+++ b/rules.ninja
@@ -26,11 +26,14 @@ rule sed
command = sed $expr >$out.tmp $in && mv $out.tmp $out
rule githash
- command = rc $root_srcdir/scripts/hash.rc $repo $out $args $in
+ command = rc $root_srcdir/scripts/hash.rc $repo.git $out $args $in
rule gittree
- command = rc $root_srcdir/scripts/tree.rc $repo $tag $in
+ command = rc $root_srcdir/scripts/tree.rc $repo.git $tag $in
restat = 1
+rule gitarchive
+ command = git -C $repo.git archive -o $$PWD/$out $tag
+
rule gitinit
- command = mkdir -p $repo && git -C $repo init --bare && touch $out
+ command = mkdir -p $repo.git && git -C $repo.git init --bare && touch $out