2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2022-01-03 19:44:05 +00:00
|
|
|
|
|
|
|
// The printdep command is a build system tool for printing out information
|
|
|
|
// about dependencies.
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"flag"
|
|
|
|
"fmt"
|
2022-01-06 16:38:26 +00:00
|
|
|
"log"
|
|
|
|
"runtime"
|
2022-01-03 19:44:05 +00:00
|
|
|
"strings"
|
|
|
|
|
|
|
|
ts "tailscale.com"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2022-01-06 16:38:26 +00:00
|
|
|
goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)")
|
|
|
|
goToolchainURL = flag.Bool("go-url", false, "print the URL to the tarball of the Tailscale Go toolchain")
|
2022-06-29 18:45:33 +00:00
|
|
|
alpine = flag.Bool("alpine", false, "print the tag of alpine docker image")
|
2022-01-03 19:44:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
flag.Parse()
|
2022-06-29 18:45:33 +00:00
|
|
|
if *alpine {
|
|
|
|
fmt.Println(strings.TrimSpace(ts.AlpineDockerTag))
|
|
|
|
return
|
|
|
|
}
|
2022-01-03 19:44:05 +00:00
|
|
|
if *goToolchain {
|
|
|
|
fmt.Println(strings.TrimSpace(ts.GoToolchainRev))
|
|
|
|
}
|
2022-01-06 16:38:26 +00:00
|
|
|
if *goToolchainURL {
|
|
|
|
switch runtime.GOOS {
|
|
|
|
case "linux", "darwin":
|
|
|
|
default:
|
|
|
|
log.Fatalf("unsupported GOOS %q", runtime.GOOS)
|
|
|
|
}
|
2023-02-11 17:54:34 +00:00
|
|
|
fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s-%s.tar.gz\n", strings.TrimSpace(ts.GoToolchainRev), runtime.GOOS, runtime.GOARCH)
|
2022-01-06 16:38:26 +00:00
|
|
|
}
|
2022-01-03 19:44:05 +00:00
|
|
|
}
|