From 120736a7fa443a29661781f706a859a827fb8948 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 22 Jun 2011 22:20:59 -0700 Subject: [PATCH] build: update .last_go_version and handle nnn+ format in last_go_version Change-Id: I8631d062375d14bc83ad2d07399e7902fca8daed --- .last_go_version | 2 +- build.pl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.last_go_version b/.last_go_version index da36c22fe..93f164194 100644 --- a/.last_go_version +++ b/.last_go_version @@ -1 +1 @@ -6g version weekly.2011-06-16 8788 +6g version weekly.2011-06-16 8838+ diff --git a/build.pl b/build.pl index 6222a0153..a546a5611 100755 --- a/build.pl +++ b/build.pl @@ -176,10 +176,11 @@ sub update_go { my $last = do { open(my $fh, ".last_go_version") or die; local $/; <$fh> }; $last =~ s!^[68]g version weekly.[0-9]{4}-[0-9]{2}-[0-9]{2} !!; chomp $last; - if ($last !~ /^[0-9]+$/) { + unless ($last =~ /^(\d+)\+?\s*$/) { print "Failed to obtain maintainer's go revision\n"; return; } + my $maintainer_version = $1; print "Updating go to revision: $last\n"; my $prev_cwd = getcwd; @@ -190,7 +191,7 @@ sub update_go { chdir $ENV{'GOROOT'} or die "Chdir to $ENV{'GOROOT'} failed\n"; system("hg", "pull") and die "Hg pull failed\n"; - system("hg", "update", $last) and die "Hg update failed\n"; + system("hg", "update", $maintainer_version) and die "Hg update failed\n"; print "Building...\n"; chdir "$ENV{'GOROOT'}/src" or die "Chdir to $ENV{'GOROOT'}/src failed\n"; system("./all.bash") and die "Go build failed\n";