script: Remove build date in genassets.go
The build date prevented the builds from being reproducible. Debian bug: https://bugs.debian.org/828994 GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3363
This commit is contained in:
@@ -15,12 +15,10 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"go/format"
|
"go/format"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var tpl = template.Must(template.New("assets").Parse(`package auto
|
var tpl = template.Must(template.New("assets").Parse(`package auto
|
||||||
@@ -29,10 +27,6 @@ import (
|
|||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
AssetsBuildDate = "{{.BuildDate}}"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Assets() map[string][]byte {
|
func Assets() map[string][]byte {
|
||||||
var assets = make(map[string][]byte, {{.Assets | len}})
|
var assets = make(map[string][]byte, {{.Assets | len}})
|
||||||
{{range $asset := .Assets}}
|
{{range $asset := .Assets}}
|
||||||
@@ -86,7 +80,6 @@ func walkerFor(basePath string) filepath.WalkFunc {
|
|||||||
|
|
||||||
type templateVars struct {
|
type templateVars struct {
|
||||||
Assets []asset
|
Assets []asset
|
||||||
BuildDate string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@@ -96,7 +89,6 @@ func main() {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
tpl.Execute(&buf, templateVars{
|
tpl.Execute(&buf, templateVars{
|
||||||
Assets: assets,
|
Assets: assets,
|
||||||
BuildDate: time.Now().UTC().Format(http.TimeFormat),
|
|
||||||
})
|
})
|
||||||
bs, err := format.Source(buf.Bytes())
|
bs, err := format.Source(buf.Bytes())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user