#7 Revert to 0.37.1 and fix FTBFS
Merged 5 years ago by qulogic. Opened 5 years ago by qulogic.
rpms/ qulogic/hugo f29  into  f29

file modified
-1
@@ -7,4 +7,3 @@ 

  /hugo-0.36.1.tar.gz

  /hugo-0.37.tar.gz

  /hugo-0.37.1.tar.gz

- /hugo-0.38.tar.gz

file added
+57
@@ -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 {

file modified
+13 -9
@@ -40,17 +40,19 @@ 

  # https://github.com/gohugoio/hugo

  %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}

  %global import_path     %{provider_prefix}

- # This commit is the 0.38 tag

- %global commit          f7bc28c5291bda85e8d63433121dc903a6f7bf80

+ # This commit is the 0.37 tag

+ %global commit          f414966b942b5aad75565bee6c644782a07f0658

  %global shortcommit     %(c=%{commit}; echo ${c:0:7})

  

  Name:           hugo

- Version:        0.38

+ Version:        0.37.1

  Release:        2%{?dist}

  Summary:        A Fast and Flexible Static Site Generator built with love in GoLang

  License:        ASL 2.0 and MIT

  URL:            https://%{provider_prefix}

  Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{version}.tar.gz

+ # Call rst2html directly instead of via 'python'.

+ Patch0001:      https://github.com/gohugoio/hugo/pull/5285.patch

  

  # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required

  ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
@@ -140,7 +142,7 @@ 

  BuildRequires: golang(github.com/mitchellh/mapstructure)

  BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/bundle)

  BuildRequires: golang(github.com/nicksnyder/go-i18n/i18n/language)

- BuildRequires: golang(github.com/russross/blackfriday)

+ BuildRequires: golang(gopkg.in/russross/blackfriday.v1)

  BuildRequires: golang(github.com/spf13/afero)

  BuildRequires: golang(github.com/spf13/cast)

  BuildRequires: golang(github.com/spf13/cobra)
@@ -299,6 +301,10 @@ 

  

  %prep

  %setup -q -n %{repo}-%{commit}

+ %patch0001 -p1

+ 

+ # Replace blackfriday import path to avoid conflict with v2

+ sed -i 's|"github.com/russross/blackfriday|"gopkg.in/russross/blackfriday.v1|' $(find . -name '*.go')

  

  %build

  mkdir -p src/%{provider}.%{provider_tld}/%{project}
@@ -441,11 +447,9 @@ 

  %endif

  

  %changelog

- * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.38-2

- - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

- 

- * Wed Apr 04 2018 Pierre-Alain TORET <pierre-alain.toret@protonmail.com> - 0.38-1

- - Update version

+ * Fri Mar 01 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.37.1-2

+ - Fix FTBFS from mass rebuild (#1604348)

+ - Fix rst2html conversion

  

  * Thu Mar 08 2018 Athos Ribeiro <athoscr@fedoraproject.org> - 0.37.1-1

  - Update version

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (hugo-0.38.tar.gz) = 232c193612130f894e12514e5cb7a9a8e66f98e55440ea2a6667692d6eada5cdafd0e11dcfacc174f42aae9af68b37592f45cea18a4a1ba5a779956780923df7

+ SHA512 (hugo-0.37.1.tar.gz) = 7830d1c2a18b58cc29d03f571794820c32afb12415fb873b53513447a10440d7419acc0924258e0a9faf1c8c00c66cc0663629234e28af3ea6701da2de9f0a5b

The git repo was updated to 0.38.0, but a build was never completed with it. The mass rebuild attempted to do it again, but also failed. We could build the fixed 0.38, but in order to not mess with existing releases too much, this just reverts back to the existing 0.37.1 and fixes its FTBFS (which are the same as 0.38).

Whether F29 should or should not be bumped to a new version can be investigated at a later date.

4 new commits added

  • Update changelog.
  • Fix or skip failing tests.
  • Patch in Blackfriday v1 paths.
  • Revert "Update version to Hugo 0.38"
5 years ago

Pull-Request has been merged by qulogic

5 years ago