-#
+#!perl -w
+use strict;
+
BEGIN { warn "Running ".__FILE__."\n" };
BEGIN
{
require "Config.pm";
die "Config.pm:$@" if $@;
- Config::->import;
+ Config->import;
}
use File::Compare qw(compare);
use File::Copy qw(copy);
use File::Basename qw(fileparse);
+
my ($name, $dir) = fileparse($0);
$name =~ s#^(.*)\.PL$#../$1.SH#;
my %opt;
{
last if /^\s*sed/;
}
-($term,$file,$pat) = /^\s*sed\s+<<(\S+)\s+>(\S+)\s+(.*)$/;
+my($term,$file,$pat) = /^\s*sed\s+<<(\S+)\s+>(\S+)\s+(.*)$/;
$file =~ s/^\$(\w+)$/$opt{$1}/g;
my $cmd = shift;
if ($cmd =~ /^echo\s+(.*?)\s*\|\s+sed\s+'(.*)'\s*$/)
{
- local ($data,$pat) = ($1,$2);
+ my($data,$pat) = ($1,$2);
$data =~ s/\s+/ /g;
eval "\$data =~ $pat";
return $data;
+#!perl -w
+use strict;
use FindExt;
+
# take a semicolon separated path list and turn it into a quoted
# list of paths that Text::Parsewords will grok
sub mungepath {
if ($ARGV[0] =~ /--cfgsh-option-file/) {
shift @ARGV;
my $optfile = shift @ARGV;
- local (*F);
+ local (*OPTF);
open OPTF, $optfile or die "Can't open $optfile: $!\n";
my @opts;
chomp(my $line = <OPTF>);
}
while (<>) {
- s/~([\w_]+)~/$opt{$1}/g;
+ s/~([\w_]+)~/exists $opt{$1} ? $opt{$1} : ''/eg;
if (/^([\w_]+)=(.*)$/) {
my($k,$v) = ($1,$2);
# this depends on cf_time being empty in the template (or we'll