Date: Sunday, October 2, 2022 @ 17:37:16
  Author: shibumi
Revision: 1320684

upgpkg: caddy 2.6.1-1

Modified:
  caddy/trunk/PKGBUILD
  caddy/trunk/override-main-module-version.patch

------------------------------------+
 PKGBUILD                           |   19 +++++----
 override-main-module-version.patch |   71 +++++++++++++++++++++--------------
 2 files changed, 55 insertions(+), 35 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2022-10-02 17:27:00 UTC (rev 1320683)
+++ PKGBUILD    2022-10-02 17:37:16 UTC (rev 1320684)
@@ -7,10 +7,10 @@
 # Contributor: Akshay S Dinesh <asdofindia at gmail dot com>
 
 pkgname=caddy
-pkgver=2.5.2
-_gitcommit=v2.5.2
-_distcommit=093d76bdd6ecacd8aeb21de3aa0c35b82a0eb064
-pkgrel=2
+pkgver=2.6.1
+_gitcommit=v2.6.1
+_distcommit=b1b186cc2722b7ccecb0a44dc82f81bac52470c4
+pkgrel=1
 pkgdesc='Fast web server with automatic HTTPS'
 url='https://caddyserver.com'
 arch=('x86_64')
@@ -35,7 +35,7 @@
             
'c893d88fec89e37da6596030c8dce7103e7e575371e8542a24d2a0741e877358d85219f2d8ade9d6aa0f515efe1156a4badd9fef5f65f553a5b0c72330c4728f'
             
'716da3f4edeb3561243aeaf5c32b01ff7a4ac810b6deba8364fb12a1f71b6a5278c34a97b289bcfdc48784679b942bf780f1f36d416a575791168c94b0d59fe0'
             
'563d6b45e91fc584fb5a27caaa382f59c140cb0a1b28b8d8faced4f7c7cad86d8671eb6ac10056f41518a842c8f606130d7e0c71df2b731d5eb0b4c868ea5d41'
-            
'b06369dd976cfcc9b519782c088efa5fba25db61663112fcc4e20b108d5165cbebcf63b6fe6d1e36119a55271374bac0037a4d07af412241d6a4d2b4f4efda0b')
+            
'0fedec714604566fb0da995cdfb2dd2cb8f3995bfa1d6c2e9a38ddd1da11634c3e37f2da381f715df4fc9ebd9653c3aa4806de47ae5094ea1fc19b7f5b795a30')
 validpgpkeys=(
   29D0817A67156E4F25DC24782A349DD577D586A5 # Matthew Holt 
<[email protected]>
 )
@@ -65,6 +65,10 @@
   export CGO_CXXFLAGS="${CXXFLAGS}"
   export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external 
-mod=readonly -modcacherw"
   go build .
+
+  for i in zsh bash fish; do
+    ./caddy completion $i >caddy.$i
+  done
 }
 
 check() {
@@ -91,8 +95,9 @@
 
   install -Dm 644 index.html "${pkgdir}/usr/share/caddy/index.html"
 
-  install -Dm 644 "${srcdir}/caddy-dist/scripts/completions/_caddy" -t 
"${pkgdir}/usr/share/zsh/site-functions"
-  install -Dm 644 "${srcdir}/caddy-dist/scripts/completions/bash-completion" 
"${pkgdir}/usr/share/bash-completion/completions/caddy"
+  install -Dm 644 "${srcdir}/caddy/cmd/caddy/caddy.zsh" 
"${pkgdir}/usr/share/zsh/site-functions/_caddy"
+  install -Dm 644 "${srcdir}/caddy/cmd/caddy/caddy.bash" 
"${pkgdir}/usr/share/bash-completion/completions/caddy"
+  install -Dm 644 "${srcdir}/caddy/cmd/caddy/caddy.fish" -t 
"${pkgdir}/usr/share/fish/vendor_completions.d"
 }
 
 # vim: ts=2 sw=2 et:

Modified: override-main-module-version.patch
===================================================================
--- override-main-module-version.patch  2022-10-02 17:27:00 UTC (rev 1320683)
+++ override-main-module-version.patch  2022-10-02 17:37:16 UTC (rev 1320684)
@@ -1,28 +1,43 @@
-From 56eacff9fa3a84b19ac9b8bb7072d9b7d96755e7 Mon Sep 17 00:00:00 2001
-From: anthraxx <[email protected]>
-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)" {

Reply via email to