) {
chop;
next if (/\.xml$/); # Ignore XML PPD sources
/([^\/]+)$/;
next if ($donefile{$1}++);
push(@files, $_);
}
close(FIND);
}
&read_file("$module_config_directory/ppd-cache", \%cache);
foreach $f (@files) {
if (!defined($cache{$f})) {
$outofdate = $f;
last;
}
}
if ($outofdate || scalar(keys %cache) != scalar(@files)) {
# Cache is out of date
undef(%cache);
local %donecache;
foreach $f (@files) {
local $ppd = &parse_cups_ppd($f);
local $nn = $ppd->{'NickName'};
$cache{$f} = $donecache{$nn} ? "duplicate" : $ppd->{'NickName'};
$donecache{$nn}++;
}
&write_file("$module_config_directory/ppd-cache", \%cache);
}
local %done;
print "\n";
# Display driver option inputs
if ($currppd) {
local $ppd = &parse_cups_ppd($currppd);
print " ",&text('cups_opts', $ppd->{'NickName'}),
"\n";
open(OPTS, "$lpoptions -p '$_[0]->{'name'}' -l 2>/dev/null |");
while() {
if (/^(\S+)\/([^:]+):\s*(.*)/ && $1 ne "PageRegion") {
print "\n" if ($i%2 == 0);
local $code = $1;
local $disp = $2;
local @opts = split(/\s+/, $3);
print "| $disp: | \n";
print " | \n";
print " \n" if ($i%2 == 1);
}
}
close(OPTS);
print " \n";
}
print " |