File: subdirs-vars.pl

package info (click to toggle)
octave 4.0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 94,200 kB
  • ctags: 52,925
  • sloc: cpp: 316,850; ansic: 43,469; fortran: 23,670; sh: 13,805; yacc: 8,204; objc: 7,939; lex: 3,631; java: 2,127; makefile: 1,746; perl: 1,022; awk: 988
file content (29 lines) | stat: -rwxr-xr-x 461 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl -w

### Manipulates the SUBDIRS and INSTALL_SUBDIRS variables. Run like this
### subdirs-vars.pl no-doc
### subdirs-vars.pl only-doc

my $line = "";
my $action = shift @ARGV;

while (<>) {
  $line .= $_;

  ## Line continuation character ("\")
  next if /\\$/;

  if ($line =~ /^((INSTALL_|)SUBDIRS =)/) {
    if ($action eq "no-doc") {
      $line =~ s/doc//;
    } else {
      $line = "$1 doc\n";
    }
  }

  print $line;

  $line = "";
}