diff --git a/src/tools/make/buildall.pl b/src/tools/make/buildall.pl index 0dbb0260..797e7220 100755 --- a/src/tools/make/buildall.pl +++ b/src/tools/make/buildall.pl @@ -14,13 +14,13 @@ my %machines = ( "darwin" => ['dave@dcb', "sudo", "projects/oberon/vishap/voc", "make full"], "cygwin" => ['-p5932 dave@wax', "", "oberon/cygwin/voc", "export CC=gcc && make full;" . "cd ~;" - . "sh start64.sh \\\"cd oberon/cygwin/voc && git reset --hard && git clean -dfx &&" - . "git pull && git checkout $branch && git pull;" + . "sh start64.sh \\\"cd oberon/cygwin/voc &&" + . "src/tools/make/getbranch $branch &&" . "export CC=gcc && make full;\\\""], "mingw" => ['-p5932 dave@wax', "", "oberon/mingw/voc", "export CC=i686-w64-mingw32-gcc && make full;" . "cd ~;" . "sh start64.sh \\\"cd oberon/mingw/voc && git reset --hard && git clean -dfx &&" - . "git pull && git checkout $branch && git pull;" + . "git pull && git checkout -f $branch && git pull;" . "export CC=x86_64-w64-mingw32-gcc && make full;\\\""], "android" => ['-p8022 root@and', "", "vishap/voc", "export CC=gcc && make full"], "lub64" => ['dave@vim', "sudo", "oberon/voc", "make full"], @@ -62,8 +62,7 @@ unlink glob "log/*"; for my $machine (sort keys %machines) { my ($login, $sudo, $dir, $mkcmd) = @{$machines{$machine}}; - my $cmd = "ssh $login \"cd $dir && $sudo git reset --hard && $sudo git clean -dfx &&" - . "$sudo git pull && $sudo git checkout -f $branch && $sudo git pull && $sudo $mkcmd\" "; + my $cmd = "ssh $login \"cd $dir && src/tools/make/getbranch $branch && $sudo $mkcmd\" "; logged($cmd, $machine); } diff --git a/src/tools/make/getbranch.pl b/src/tools/make/getbranch.pl new file mode 100644 index 00000000..32ff1927 --- /dev/null +++ b/src/tools/make/getbranch.pl @@ -0,0 +1,14 @@ +#!perl -w +use strict; +use warnings; + +# Exit with a clean enlistrment in the named branch. + +my $branch = "master"; +if (defined($ARGV[0]) && ($ARGV[0] ne "")) {$branch = $ARGV[0]} + +set -x +git reset --hard # Clear the staging area +git clean -dfx # Remove all untracked files +git pull # Update the local repository +git checkout -f $branch # Switch to requested branch