# always flush
$| = 1;
-my $invocation_dir = getcwd();
+my $invocation_dir = $ENV{PWD} || getcwd();
## Configuration file handling
# when a script is run as "novaboot <options> <script>" then $ARGV[0]
# contains the first option. Hence the -f check.
my $dir = File::Spec->rel2abs($ARGV[0] && -f $ARGV[0] ? dirname($ARGV[0]) : '', $invocation_dir);
- while (-d $dir && $dir ne "/") {
+ while ((-d $dir || -l $dir ) && $dir ne "/") {
push @cfgs, "$dir/.novaboot" if -r "$dir/.novaboot";
- $dir = abs_path($dir."/..");
+ my @dirs = File::Spec->splitdir($dir);
+ $dir = File::Spec->catdir(@dirs[0..$#dirs-1]);
}
}
my $cfg = $ENV{'NOVABOOT_CONFIG'};
WVPASS sh -c "./script --gen-only 2> log"
WVPASS grep "novaboot: Read $PWD/.novaboot" log
+WVSTART Configuration files in symlinked directories
+mkdir config
+echo '1;' > config/.novaboot
+mkdir script
+( cd script; create_dummy )
+ln -s ../script config
+WVPASS sh -c "./config/script/script --gen-only 2> log"
+WVPASS grep "novaboot: Read $PWD/config/.novaboot" log
+
WVSTART Builddir configuration variable
WVPASS mkdir -p build
cat > .novaboot <<'EOF'
WVPASS ./script --gen-only --pulsar
WVPASS grep "exec HYP" config-novaboot
-
exit
# Broken