cwd=`pwd`
scripts/cleanup
scripts/copy-test-confs
-echo "${cwd}/build" >${cwd}/tmp/file-list
-sed 's/Include {/Include { Exclude Dir Containing = ".nobkp"/' $conf/bacula-dir.conf > $tmp/1
+cat >> $conf/bacula-dir.conf <<EOF
+FileSet {
+ Name = "ExcludeDir"
+ Include {
+ Exclude Dir Containing = ".nobkp"
+ Options {
+ signature=MD5
+ compression=GZIP
+ }
+ File = "$cwd/build"
+ }
+ Include {
+ Exclude Dir Containing = "bacula-dir.conf"
+ Options {
+ signature=MD5
+ compression=GZIP
+ }
+ File = "$conf"
+ File = "$rscripts"
+ File = "$cwd/build/po"
+ }
+}
+EOF
+sed 's/FileSet="CompressedSet"/FileSet=ExcludeDir/' $conf/bacula-dir.conf >$tmp/1
cp -f $tmp/1 $conf/bacula-dir.conf
change_jobname CompressedTest $JobName
start_test
bstat=2
fi
+# build/po is included 2 times with a different exclude file
+# we shouldn't see scripts and bin
+nb=$(grep -e 'build/po/fr.po$' $tmp/log3.out | wc -l)
+if [ $nb != 2 ]; then
+ print_debug "ERROR: Should see fr.po two times"
+ bstat=2
+fi
+
+grep $rscripts $tmp/log3.out > /dev/null
+if [ $? = 0 ]; then
+ print_debug "ERROR: Should not $rscripts in estimate output"
+ bstat=2
+fi
+
+grep $conf $tmp/log3.out > /dev/null
+if [ $? = 0 ]; then
+ print_debug "ERROR: Should not $conf in estimate output"
+ bstat=2
+fi
+
end_test