]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: [Debian] config-check -- handle V2 annotations format
authorAndy Whitcroft <apw@canonical.com>
Mon, 28 Sep 2015 15:21:49 +0000 (16:21 +0100)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 20 Feb 2017 03:57:58 +0000 (20:57 -0700)
Signed-off-by: Andy Whitcroft <apw@canonical.com>
debian/scripts/config-check

index 692546a0cce0ffe76f1562459da336cfac9cb354..07958556e58ec0d90173258bee3fc0c26de87a02 100755 (executable)
@@ -45,15 +45,25 @@ my $annotations = "$commonconfig/annotations";
 my ($config, $value, $options, $option, $value, $check, $policy);
 print "$P: $annotations loading annotations\n";
 my %annot;
+my $form = 1;
 open(ANNOTATIONS, "<$annotations") || die "$P: $annotations: open failed -- $! -- aborting\n";
 while (<ANNOTATIONS>) {
+       if (/^# FORMAT: (\S+)/) {
+               die "$P: $1: unknown annotations format\n" if ($1 != 2);
+               $form = $1;
+       }
+
        /^#/ && next;
        chomp;
        /^$/ && next;
 
        /^CONFIG_/ || next;
 
-       ($config, $value, $options) = split(' ', $_, 3);
+       if ($form == 1) {
+               ($config, $value, $options) = split(' ', $_, 3);
+       } elsif ($form == 2) {
+               ($config, $options) = split(' ', $_, 2);
+       }
 
        $annot{$config} = $annot{$config} . ' ' . $options;
 }