From 1ae604fcf4cfa05f4bb0450fe48dd2d028b22f2f Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 20 Feb 2017 16:54:33 +0000 Subject: [PATCH] cross-compile: make rclone-beta-latest* for download #1047 --- Makefile | 6 ++---- bin/cross-compile.go | 7 +++++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a040067b8..09c4c0dd2 100644 --- a/Makefile +++ b/Makefile @@ -98,17 +98,15 @@ upload_github: ./bin/upload-github $(TAG) cross: doc - go run bin/cross-compile.go $(TAG) + go run bin/cross-compile.go -release current $(TAG) beta: go run bin/cross-compile.go $(TAG)β - rm build/*-current-* rclone -v copy build/ memstore:pub-rclone-org/$(TAG)β @echo Beta release ready at http://pub.rclone.org/$(TAG)%CE%B2/ travis_beta: - go run bin/cross-compile.go $(TAG)β - rm build/*-current-* + go run bin/cross-compile.go -release latest-beta $(TAG)β rclone --config bin/travis.rclone.conf -v copy build/ memstore:beta-rclone-org/$(TAG) @echo Beta release ready at $(BETA_URL) diff --git a/bin/cross-compile.go b/bin/cross-compile.go index 3fa65a669..febae5a6b 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -20,6 +20,7 @@ var ( // Flags debug = flag.Bool("d", false, "Print commands instead of running them.") parallel = flag.Int("parallel", runtime.NumCPU(), "Number of commands to run in parallel.") + copyAs = flag.String("release", "", "Make copies of the releases with this name") ) // GOOS/GOARCH pairs we build for @@ -99,8 +100,10 @@ func compileArch(version, goos, goarch, dir string) { run("cp", "-a", "../rclone.1", dir) zip := dir + ".zip" run("zip", "-r9", zip, dir) - currentZip := strings.Replace(zip, "-"+version, "-current", 1) - run("ln", zip, currentZip) + if *copyAs != "" { + copyAsZip := strings.Replace(zip, "-"+version, "-"+*copyAs, 1) + run("ln", zip, copyAsZip) + } run("rm", "-rf", dir) log.Printf("Done compiling %s/%s", goos, goarch) }