Bug 246020 - www/gitea: Fix repo/wiki/view.tmpl template
Summary: www/gitea: Fix repo/wiki/view.tmpl template
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-29 07:35 UTC by Sascha Biberhofer
Modified: 2020-05-10 09:04 UTC (History)
2 users (show)

See Also:
stb: maintainer-feedback+


Attachments
gitea: Add patch for repo/wiki/view.tmpl (1.57 KB, patch)
2020-04-29 07:35 UTC, Sascha Biberhofer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha Biberhofer 2020-04-29 07:35:53 UTC
Created attachment 213903 [details]
gitea: Add patch for repo/wiki/view.tmpl

Right now, the version of gitea shipped in ports fails to display wiki pages. Any wiki page opened results in the following error:

template: repo/wiki/view:48:14: executing "repo/wiki/view" at <(not $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned $.ExposeAnonSSH))>: can't give argument to non-function not $.DisableHTTP

This is due to extra parentheses in templates/repo/wiki/view.tmpl and has already been fixed upstream in [1], [2]. 

I've pulled the single line template fix from upstream and added the patch to our port. As a workaround, users can also fix the problem by placing the corrected template in /usr/local/etc/gitea/templates/repo/wiki/view.tmpl.

Port builds and runs fine for me. :)

Cheers,
Sascha

[1] https://github.com/go-gitea/gitea/issues/10552
[2] https://github.com/zeripath/gitea/commit/1830d0ed5f4a67e3360ecbb55933b5540b6affce
Comment 1 Stefan Bethke 2020-05-04 18:04:02 UTC
(In reply to Sascha Biberhofer from comment #0)

Let's do this. I have no idea when Gitea 1.12 will come around, which I would assume has full compatibility with go 1.14, but in the meantime, let's fix this.

Alternatively, we could try to adjust the dependency to build Gitea with Go 1.13, but I don't think it's worth the hassle.
Comment 2 commit-hook freebsd_committer freebsd_triage 2020-05-04 18:17:21 UTC
A commit references this bug:

Author: adamw
Date: Mon May  4 18:16:38 UTC 2020
New revision: 533935
URL: https://svnweb.freebsd.org/changeset/ports/533935

Log:
  gitea: Fix wiki page display

  From the PR:

  Right now, the version of gitea shipped in ports fails to display wiki
  pages. Any wiki page opened results in the following error:

  template: repo/wiki/view:48:14: executing "repo/wiki/view" at <(not
  $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned
  $.ExposeAnonSSH))>: can't give argument to non-function not
  $.DisableHTTP

  This is due to extra parentheses in templates/repo/wiki/view.tmpl and
  has already been fixed upstream in [1], [2].

  I've pulled the single line template fix from upstream and added the
  patch to our port. As a workaround, users can also fix the problem by
  placing the corrected template in
  /usr/local/etc/gitea/templates/repo/wiki/view.tmpl.

  Cheers,
  Sascha

  [1] https://github.com/go-gitea/gitea/issues/10552
  [2] https://github.com/zeripath/gitea/commit/1830d0ed5f4a67e3360ecbb55933b5540b6affce

  PR:		246020
  Submitted by:	Sascha Biberhofer
  Approved by:	maintainer

Changes:
  head/www/gitea/Makefile
  head/www/gitea/files/patch-templates_repo_wiki_view.tmpl
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2020-05-04 18:19:17 UTC
This is committed. Does it only affect 1.11.4, or 1.11.3 (in quarterly) as well? IOW, does this need an MFH (with bump to 1.11.4)?
Comment 4 Stefan Bethke 2020-05-04 18:21:17 UTC
(In reply to Adam Weinberger from comment #3)

Since the bug is exposed only in Go 1.14, it would depend what version of Go is used to build quarterly packages.
Comment 5 Stefan Bethke 2020-05-04 18:24:56 UTC
It looks like 2020Q2 has Go 1.14, so the fix definitely applies. I think it's good to do an MFH.
Comment 6 commit-hook freebsd_committer freebsd_triage 2020-05-04 20:39:39 UTC
A commit references this bug:

Author: adamw
Date: Mon May  4 20:39:13 UTC 2020
New revision: 533984
URL: https://svnweb.freebsd.org/changeset/ports/533984

Log:
  MFH: r531612 r531613 r533935

  gitea: Update to 1.1.4

  Update Gitea to 1.11.4

  This release fixes ten bugs.

  Release notes: https://blog.gitea.io/2020/04/gitea-1.11.4-is-released/

  PR:		245602
  Submitted by:	maintainer

  gitea: Add GIT_LFS option

  Add a GIT_LFS option (on by default) for environments that don't want to
  make LFS available.

  While here, change the pkg-message UCL to only show when upgrading from
  < 1.8.0.

  Approved by:	maintainer

  gitea: Fix wiki page display

  From the PR:

  Right now, the version of gitea shipped in ports fails to display wiki
  pages. Any wiki page opened results in the following error:

  template: repo/wiki/view:48:14: executing "repo/wiki/view" at <(not
  $.DisableHTTP) (and (not $.DisableSSH) (or $.IsSigned
  $.ExposeAnonSSH))>: can't give argument to non-function not
  $.DisableHTTP

  This is due to extra parentheses in templates/repo/wiki/view.tmpl and
  has already been fixed upstream in [1], [2].

  I've pulled the single line template fix from upstream and added the
  patch to our port. As a workaround, users can also fix the problem by
  placing the corrected template in
  /usr/local/etc/gitea/templates/repo/wiki/view.tmpl.

  Cheers,
  Sascha

  [1] https://github.com/go-gitea/gitea/issues/10552
  [2] https://github.com/zeripath/gitea/commit/1830d0ed5f4a67e3360ecbb55933b5540b6affce

  PR:		246020
  Submitted by:	Sascha Biberhofer
  Approved by:	maintainer

  Approved by:	portmgr (with hat)

Changes:
_U  branches/2020Q2/
  branches/2020Q2/www/gitea/Makefile
  branches/2020Q2/www/gitea/distinfo
  branches/2020Q2/www/gitea/files/patch-templates_repo_wiki_view.tmpl
  branches/2020Q2/www/gitea/pkg-message
Comment 7 Adam Weinberger freebsd_committer freebsd_triage 2020-05-04 20:40:44 UTC
Ok, this has been merged to quarterly. Thanks for the work on this!