summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-06-18 16:09:43 -0700
committerMichael Forney <mforney@mforney.org>2016-06-18 16:09:43 -0700
commite01e004a95dcc60f5cb496d4f016affc9d3d72b8 (patch)
tree509968d711b3fdc6ce7a0d29048636aaff262b33
parent03122929d1b2eae16acae8f43b657b74eadc5314 (diff)
Produce sorted .perms
-rw-r--r--rules.ninja3
-rwxr-xr-xsetup.rc4
2 files changed, 5 insertions, 2 deletions
diff --git a/rules.ninja b/rules.ninja
index c26891ef..3e1ac487 100644
--- a/rules.ninja
+++ b/rules.ninja
@@ -27,6 +27,9 @@ rule copy
rule cat
command = cat $in >$out.tmp && mv $out.tmp $out
+rule mergeperms
+ command = sort -k 2 -m $in >$out.tmp && mv $out.tmp $out
+
rule gzip
command = gzip -c -9 -n $in >$out.tmp && mv $out.tmp $out
diff --git a/setup.rc b/setup.rc
index 300b9f40..1a11cb16 100755
--- a/setup.rc
+++ b/setup.rc
@@ -49,11 +49,11 @@ fn gen {
phony ninja '$dir/local.ninja' $gen_inputs
if(! ~ $#tree_perms 0) {
- printf '%s\n' $tree_perms >$absdir/local.perms
+ printf '%s\n' $tree_perms | sort >$absdir/local.perms
perms_inputs=($perms_inputs '$dir'/local.perms)
}
if(~ $#perms_inputs 0) build '$outdir/root.perms' empty
- if not build '$outdir/root.perms' cat $perms_inputs
+ if not build '$outdir/root.perms' mergeperms $perms_inputs
if(~ $#tree_inputs 0) build '$outdir/root.tree' empty
if not build '$outdir/root.tree' cat $tree_inputs
} >local.ninja.tmp