From: russell@coker.com.au (Russell Coker) Date: Mon, 13 Feb 2017 12:59:50 +1100 Subject: [refpolicy] [PATCH] capability sorting In-Reply-To: <311d8934-76e2-75fd-8ff3-8bbb3f7c573e@ieee.org> References: <37190070.fYifpz0EYe@russell.coker.com.au> <311d8934-76e2-75fd-8ff3-8bbb3f7c573e@ieee.org> Message-ID: <2272A259-6997-48B9-9DF4-E3BF457E23C4@coker.com.au> To: refpolicy@oss.tresys.com List-Id: refpolicy.oss.tresys.com I'm just pendant about such things. But it does make it easier to compare policy by looking at it if things are in the same order. If you have 2 lists of capabilities and one has an extra item it can take a minute if they are in random order. On 13 February 2017 5:58:38 am LHDT, Chris PeBenito wrote: >On 02/12/17 04:23, Russell Coker via refpolicy wrote: >> The attached patch (gzip compressed due to list size limits) sorts >the >> capabilities in alphabetical order which is also the order from the >system >> include files. >> >> I used the below perl script to sort the capabilities and both >inspected and >> tested the result. > >I'm ok with the change, but I'm not clear why you made it. If it is >what you understood from the style guide, I really need to clarify it, >since this type of alphabetical sorting isn't required. > > >> #!/usr/bin/perl >> use strict; >> >> while() >> { >> if($_ =~ /capability.*{/) >> { >> chomp; >> my @line = split /{/,$_; >> my @end = split /}/,$line[1]; >> my $capabilities = join(' ', sort split / /,$end[0]); >> print "$line[0]\{$capabilities }$end[1]\n"; >> } >> else >> { >> print $_; >> } >> } >> >> >> >> _______________________________________________ >> refpolicy mailing list >> refpolicy at oss.tresys.com >> http://oss.tresys.com/mailman/listinfo/refpolicy >> -- Sent from my Nexus 6P with K-9 Mail.