bud.bats refactoring: $TEST_SCRATCH_DIR, part 1 of 2
bud.bats refactoring: $TEST_SCRATCH_DIR, part 1 of 2

Hundreds of instances of scary duplication. All fixed with
this script:

   #!/usr/bin/perl -n -i
   use v5.20;

   our $contextdir;
   #      1   12     3     3                     24                          4
   if (m!^(\s+)(mkdir(\s+-p)?\s+|cp\s+-[aR]\s.*\s)(\$\{TEST_SCRATCH_DIR\}/\S+)\s*$!) {
       $contextdir = $4;
       print "${1}local contextdir=$contextdir\n";
       print "${1}${2}\$contextdir\n";
       next;
   }
   elsif (/^\}/) {
       $contextdir = undef;
   }
   elsif ($contextdir) {
       s!\Q$contextdir\E!\$contextdir!g;
   }
   print;

...which is imperfect, hence the need for a two-part commit.

Signed-off-by: Ed Santiago <792d28329de7ed446c01b83f731a071248ffeaf4@redhat.com>

TomSweeneyRedHat/buildah,nalind/buildah-1,TomSweeneyRedHat/buildah,TomSweeneyRedHat/buildah,nalind/buildah-1,nalind/buildah-1