• Gustavo Niemeyer's avatar
    cmd/dist: prevent race on VERSION creation · c2fe6634
    Gustavo Niemeyer authored
    Commands such as "dist version > VERSION" will cause
    the shell to create an empty VERSION file and set dist's
    stdout to its fd. dist in turn looks at VERSION and uses
    its content if available, which is empty at this point.
    
    Fix that by ignoring VERSION if it's empty.
    
    Also prevent cmdversion from running findgoversion a
    second time. It was already loaded by init.
    
    R=adg, gustavo, rsc
    CC=golang-dev
    https://golang.org/cl/5639044
    c2fe6634
build.c 28.5 KB