1 #!/usr/bin/perl -T -t -w -W
3 # Sort each line of the input, ignoring any line beginning with a #.
4 # Also format the output so that it is properly aligned, with exceptions
5 # for values which are too long for their respective field.
9 # Sorted using sort_set.pl in releasetools.
10 # to add an entry simply add it at the end of the
12 # ../../../../releasetools/sort_set.pl < mi > out
18 # Ignore any line starting with a '#'
23 # Entry with a condition field, one or more whitespace characters
24 # separate each column. Example:
25 # ./etc/X11 minix-base xorg
26 if ($_ =~ m/(\S+)\s+(\S+)\s+(\S+)/) {
27 my ($f, $s, $c) = ($1, $2, $3);
35 # Entry without a condition field. Example:
37 if ($_ =~ m/(\S+)\s+(\S+)/) {
38 my ($f, $s) = ($1, $2);
45 # Sort by file/directory name.
46 foreach $key (sort keys %sets) {
50 if (length($file) < 56) {
51 printf("%-55s ", $file);
57 if (exists($conditions{$key})) {
58 # A condition is present, so make sure it is printed with
59 # the required alignment, by adding the necessary padding
60 # after the set column. Otherwise do not add trailing
62 $last = $conditions{$key};
63 if (length($set) < 16) {
64 printf("%-15s ", $set);
70 printf("%s\n", $last);