From 02680c5c5fa0efceb1a5222f072b0a4a9e8b18cc Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 10 Apr 2016 13:52:38 -0700 Subject: Add gitarchive rule to create tar archive of root filesystem --- config.ninja | 2 +- gen.rc | 3 ++- rules.ninja | 9 ++++++--- 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 -- cgit v1.2.3