public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/hugo] epel8: Fix or skip failing tests.
Date: Fri, 06 Nov 2026 05:42:36 GMT [thread overview]
Message-ID: <179394375670.1.8809662782182764371.rpms-hugo-354aba701b22@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/hugo
Branch : epel8
Commit : 354aba701b22991392147e4e203a76cd5385273e
Author : Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date : 2019-02-28T02:13:39-05:00
Stats : +62/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/hugo/c/354aba701b22991392147e4e203a76cd5385273e?branch=epel8
Log:
Fix or skip failing tests.
---
diff --git a/5285.patch b/5285.patch
new file mode 100644
index 0000000..7d32e45
--- /dev/null
+++ b/5285.patch
@@ -0,0 +1,57 @@
+From b137ad4dbd6d14d0a9af68c044aaee61f2c87fe5 Mon Sep 17 00:00:00 2001
+From: Shreyansh Khajanchi <shreyansh_k@live.com>
+Date: Wed, 3 Oct 2018 19:45:54 +0530
+Subject: [PATCH] helpers/content.go: call rst2html directly on *nix but via
+ python on windows
+
+Initially, rst2html was called via the python interpreter which would
+fail if the script was wrapped in a launcher as on NixOS.
+Ideally, on *nix, binaries should be invoked directly to ensure that
+shebangs work properly as is being done now.
+Handle the case of windows as it doesn't do shebangs.
+---
+ helpers/content.go | 17 ++++++++++++++---
+ 1 file changed, 14 insertions(+), 3 deletions(-)
+
+diff --git a/helpers/content.go b/helpers/content.go
+index 55d8ce202..f8479cd1b 100644
+--- a/helpers/content.go
++++ b/helpers/content.go
+@@ -22,6 +22,7 @@ import (
+ "fmt"
+ "html/template"
+ "os/exec"
++ "runtime"
+ "unicode"
+ "unicode/utf8"
+
+@@ -678,7 +679,6 @@ func getPythonExecPath() string {
+ // getRstContent calls the Python script rst2html as an external helper
+ // to convert reStructuredText content to HTML.
+ func getRstContent(ctx *RenderingContext) []byte {
+- python := getPythonExecPath()
+ path := getRstExecPath()
+
+ if path == "" {
+@@ -688,8 +688,19 @@ func getRstContent(ctx *RenderingContext) []byte {
+
+ }
+ jww.INFO.Println("Rendering", ctx.DocumentName, "with", path, "...")
+- args := []string{path, "--leave-comments", "--initial-header-level=2"}
+- result := externallyRenderContent(ctx, python, args)
++ var result []byte
++ // certain *nix based OSs wrap executables in scripted launchers
++ // invoking binaries on these OSs via python interpreter causes SyntaxError
++ // invoke directly so that shebangs work as expected
++ // handle Windows manually because it doesn't do shebangs
++ if runtime.GOOS == "windows" {
++ python := getPythonExecPath()
++ args := []string{path, "--leave-comments", "--initial-header-level=2"}
++ result = externallyRenderContent(ctx, python, args)
++ } else {
++ args := []string{"--leave-comments", "--initial-header-level=2"}
++ result = externallyRenderContent(ctx, path, args)
++ }
+ // TODO(bep) check if rst2html has a body only option.
+ bodyStart := bytes.Index(result, []byte("<body>\n"))
+ if bodyStart < 0 {
diff --git a/hugo.spec b/hugo.spec
index 854c6c8..ea9cc58 100644
--- a/hugo.spec
+++ b/hugo.spec
@@ -10,6 +10,8 @@ Summary: A Fast and Flexible Static Site Generator built with love in GoL
License: ASL 2.0 and MIT
URL: %{gourl}
Source0: %{gosource}
+# Call rst2html directly instead of via 'python'.
+Patch0001: https://github.com/gohugoio/hugo/pull/5285.patch
%description
Hugo is a static HTML and CSS website generator written in Go. It is optimized
@@ -85,6 +87,9 @@ which use import path with %{goipath} prefix.
# Replace blackfriday import path to avoid conflict with v2
sed -i 's|"github.com/russross/blackfriday|"gopkg.in/russross/blackfriday.v1|' $(find . -name '*.go')
+# Skip test that assumes directory is in a git repository
+sed -i '/TestPageWithLastmodFromGitInfo/a t.Skip()' hugolib/page_test.go
+
%build
%gobuildroot
reply other threads:[~2026-11-06 5:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179394375670.1.8809662782182764371.rpms-hugo-354aba701b22@fedoraproject.org \
--to=quantum.analyst@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox