upgpkg: 2.6.1-1

This commit is contained in:
Christian Rebischke
2022-10-02 17:37:16 +00:00
parent f720021855
commit 4f256c8f99
2 changed files with 55 additions and 35 deletions

View File

@ -1,28 +1,43 @@
From 56eacff9fa3a84b19ac9b8bb7072d9b7d96755e7 Mon Sep 17 00:00:00 2001
From: anthraxx <levente@leventepolyak.net>
Date: Sat, 13 Feb 2021 04:56:30 +0100
Subject: [PATCH] override main module version which we can be filled with the
correct version
Go BuildInfo only works if we build from a module, however we simply
want to build in tree. Therefor override the main module version with
something that we can dynamically replace.
---
caddy.go | 1 +
1 file changed, 1 insertion(+)
diff --git a/caddy.go b/caddy.go
index 70135ffb..04d95716 100644
--- a/caddy.go
+++ b/caddy.go
@@ -679,6 +679,7 @@ func goModule(mod *debug.Module) *debug.Module {
mod.Version = "unknown"
bi, ok := debug.ReadBuildInfo()
if ok {
+ bi.Main.Version = "unknown"
mod.Path = bi.Main.Path
// The recommended way to build Caddy involves
// creating a separate main module, which
--
2.30.0
--- a/caddy.go~ 2022-10-02 18:58:35.059343203 +0200
+++ b/caddy.go 2022-10-02 18:58:21.125992368 +0200
@@ -875,39 +875,7 @@
}
if full == "" {
- var vcsRevision string
- var vcsTime time.Time
- var vcsModified bool
- for _, setting := range bi.Settings {
- switch setting.Key {
- case "vcs.revision":
- vcsRevision = setting.Value
- case "vcs.time":
- vcsTime, _ = time.Parse(time.RFC3339, setting.Value)
- case "vcs.modified":
- vcsModified, _ = strconv.ParseBool(setting.Value)
- }
- }
-
- if vcsRevision != "" {
- var modified string
- if vcsModified {
- modified = "+modified"
- }
- full = fmt.Sprintf("%s%s (%s)", vcsRevision, modified, vcsTime.Format(time.RFC822))
- simple = vcsRevision
-
- // use short checksum for simple, if hex-only
- if _, err := hex.DecodeString(simple); err == nil {
- simple = simple[:8]
- }
-
- // append date to simple since it can be convenient
- // to know the commit date as part of the version
- if !vcsTime.IsZero() {
- simple += "-" + vcsTime.Format("20060102")
- }
- }
+ full = "unknown"
}
if simple == "" || simple == "(devel)" {