#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
use strict;
require v5.8.4;
# Use the same mechanism as def.dir.flp to determine if there are any
# SCCS files matching the pattern supplied for a "find_files"
# statement.
sub sccs_empty {
return 0 if $f_flg;
$foo eq "";
}
# Not pretty, but simple enough to work for the known cases.
# Does not bother with curly braces or fancy substitutions.
# Returns undef if this pattern is excluded.
sub expand {
my ($str) = @_;
while ($str =~ /\$(\w+)/) {
}
}
$str;
}
# Process a single inc.flg or req.flg file.
sub process_file {
$dname =~ s+/[^/]*$++;
if (defined $incpath) {
$newpath = "$incpath, from $fname:";
} else {
$newpath = "from $fname:";
}
if (open INC, "<$fname") {
$line = 0;
$cont = 0;
while (<INC>) {
chomp;
$line++;
if ($cont) {
} else {
$text = $_;
}
if (/\\$/) {
$cont = 1;
$text =~ s/\\$//;
next;
}
$cont = 0;
warn "$fname:$firstline: $1 isn't a file\n" if ! -f $expfile;
foreach my $dir (split(/\s+/, "$2")) {
if (! -d $expfile) {
warn "$fname:$firstline: $dir isn't a directory\n";
warn "$fname:$firstline: $dir is unnecessary\n";
warn "$fname:$firstline: $dir has no SCCS objects ",
"with '$1'\n";
}
}
if (-f $expfile) {
} else {
warn "$fname:$firstline: $1 isn't a file\n";
warn "included $incpath\n" if defined $incpath;
}
} else {
warn "$0: $fname:$firstline: unknown entry: $text\n";
warn "included $incpath\n" if defined $incpath;
}
}
close INC;
} else {
warn "$0: $fname: $!\n";
}
}
sub wanted {
}
sub next_arg {
my ($arg) = @_;
if ($arg eq "") {
die "$0: missing argument for $_\n" if $#ARGV == -1;
}
$arg;
}
# I'd like to use Perl's getopts here, but it doesn't handle repeated
# options, and using comma separators is just too ugly.
# This doesn't handle combined options (as in '-rm'), but I don't care.
my $arg;
while ($#ARGV >= 0) {
$_ = $ARGV[0];
last if /^[^-]/;
shift @ARGV;
last if /^--$/;
SWITCH: {
if (/^-e(.*)$/) {
last SWITCH;
}
print "$0: unknown option $_\n";
usage();
}
}
# compile the 'exclude' regexps
$basedir = "usr";
if ($#ARGV == 0) {
} elsif ($#ARGV > 0) {
die "$0: unexpected arguments\n";
}
# After passing through the tree, process all of the included files.
# There aren't many of these, so don't bother trying to optimize the
# traversal. Just do them all.
while (@execlist) {
}
exit 0;