#! /usr/bin/perl use warnings; use strict; use integer; use FindBin; use lib $FindBin::RealBin; use Def; # This extremely obscure helper script checks the packages named in # cmdsel-debs.data against one or more lists of selected packages (the # lists each having one binary package name per line). If you don't # know what this is about, you can ignore this script. our $file_data = "${FindBin::RealBin}/cmdsel-debs.data"; our $usage = < 1 } 1 .. length($o)-1 } @opt; if ( $opt{'?'} || $opt{h} ) { print $usage; exit 0; } # Read in the selections. my %sel; for ( @arg ) { open F, '<', $_; while () { chomp; $sel{$_} = 1 if /\S/ && !/^#/; } close F; } # Object to unselected packages in the data file. open F, '<', $file_data; { my $cmd2 = ''; my $sect2 = ''; while () { my( $cmd, $sect, $pkg ) = /^(\S+)\(([^()\s]+)\)\s+(\S+)\s*$/ or die "$0: badly formatted data line\n$_\n"; $sel{$pkg} or warn "$0: package $pkg unselected or unknown\n"; $sect gt $sect2 || ( $sect eq $sect2 && $cmd gt $cmd2 ) or warn "$0: commands $cmd2($sect2) and $cmd($sect) are misordered\n"; $cmd2 = $cmd; $sect2 = $sect; } } close F;