aboutsummaryrefslogtreecommitdiff
path: root/t/prep.pl
diff options
context:
space:
mode:
authorJ Pipkin <j@dawnrazor.net>2013-01-12 04:14:03 -0600
committerJ Pipkin <j@dawnrazor.net>2013-01-12 04:14:03 -0600
commitbe2bb2b27d61a39bff6efd890c3d519c39db321e (patch)
tree387f0c14a12526c6eb1668b3d588ded1a0472212 /t/prep.pl
parentb2a26f795d32e398bfc3dbfc13882419bd3ba929 (diff)
downloadsbotools2-be2bb2b27d61a39bff6efd890c3d519c39db321e.tar.xz
implement failure-dependent exit statuses, ask to proceed if a failure is encountered during the process
Diffstat (limited to 't/prep.pl')
-rwxr-xr-xt/prep.pl31
1 files changed, 22 insertions, 9 deletions
diff --git a/t/prep.pl b/t/prep.pl
index c8d38bd..b7dc111 100755
--- a/t/prep.pl
+++ b/t/prep.pl
@@ -69,15 +69,15 @@ while (my $line = <$file_h>) {
}
seek $file_h, 0, 0;
-my @not_exported;
-FIRST: for my $sub (@subs) {
- my $found = 'FALSE';
- my $has = 'FALSE';
+my @not_exported;
+FIRST: for my $sub (@subs) {
+ my $found = 'FALSE';
+ my $has = 'FALSE';
SECOND: while (my $line = <$file_h>) {
- if ($found eq 'FALSE') {
+ if ($found eq 'FALSE') {
$found = 'TRUE', next SECOND if $line =~ /\@EXPORT/;
- } else {
- last SECOND if $line =~ /^\);$/;
+ } else {
+ last SECOND if $line =~ /^\);$/;
$has = 'TRUE', last SECOND if $line =~ /$sub/;
}
}
@@ -91,7 +91,20 @@ FIRST: for my $line (@file) {
if ($line =~ /\@EXPORT/) {
$line = "our \@EXPORT = qw(". join ' ', @not_exported;
}
- $line = "#$line" if $line =~ /root privileges/;
+ $line =~ s/^/#/ if $line =~ /^read_config;$/;
}
-
+my $found = 0;
+FIRST: for my $line (@file) {
+ unless ($found) {
+ if ($line =~ /^unless\s+\(\$<\s+==/) {
+ $found++;
+ $line =~ s/^/#/;
+ }
+ } else {
+ $line =~ s/^/#/;
+ if ($line =~ /^#}$/) {
+ last FIRST;
+ }
+ }
+}