Skip to content

Commit

Permalink
common: patch txt2man in Docker images
Browse files Browse the repository at this point in the history
Patch txt2man with:
mvertes/txt2man#18
to fix the following bug:
mvertes/txt2man#21
ldorau committed May 29, 2020
1 parent 7a8374e commit 6dcbf0f
Showing 4 changed files with 69 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/docker/images/Dockerfile.fedora-31
Original file line number Diff line number Diff line change
@@ -59,6 +59,11 @@ RUN ./install-cmocka.sh
COPY patch-src2man.sh patch-src2man.sh
RUN ./patch-src2man.sh

# Patch txt2man
COPY patch-txt2man.sh patch-txt2man.sh
COPY txt2man.patch txt2man.patch
RUN ./patch-txt2man.sh

# Add user
ENV USER user
ENV USERPASS pass
5 changes: 5 additions & 0 deletions utils/docker/images/Dockerfile.ubuntu-19.10
Original file line number Diff line number Diff line change
@@ -65,6 +65,11 @@ RUN ./install-cmocka.sh
COPY patch-src2man.sh patch-src2man.sh
RUN ./patch-src2man.sh

# Patch txt2man
COPY patch-txt2man.sh patch-txt2man.sh
COPY txt2man.patch txt2man.patch
RUN ./patch-txt2man.sh

# Add user
ENV USER user
ENV USERPASS pass
25 changes: 25 additions & 0 deletions utils/docker/images/patch-txt2man.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2020, Intel Corporation
#

#
# patch-txt2man.sh - patch txt2man to fix the following bug:
# https://github.com/mvertes/txt2man/issues/21
#

set -e

FILE=$(which txt2man)

if [ "$FILE" == "" ]; then
echo "Error: txt2man not found"
exit 1
fi

echo "Patching $FILE ..."
cp $FILE .
# apply the patch: https://github.com/mvertes/txt2man/pull/18
patch < ./txt2man.patch
sudo mv ./txt2man $FILE
34 changes: 34 additions & 0 deletions utils/docker/images/txt2man.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 4cd9ba2cea5b54d472bd00f41ee0d38ef7497521 Mon Sep 17 00:00:00 2001
From: Jorge Luis Martinez Gomez <[email protected]>
Date: Tue, 17 Sep 2019 23:23:58 -0700
Subject: [PATCH] remove redundant escapes causing gawk warnings

---
txt2man | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/txt2man b/txt2man
index 64d0a4c..abc1c43 100755
--- a/txt2man
+++ b/txt2man
@@ -242,7 +242,7 @@ BEGIN {
pnzls = ls
match($0, /[^ ]/)
ls = RSTART
- if (pls == 0 && pnzls > 0 && ls > pnzls && $1 !~ /^[0-9\-\*\o]\.*$/) {
+ if (pls == 0 && pnzls > 0 && ls > pnzls && $1 !~ /^[0-9\-\*o]\.*$/) {
# example display block
if (prevblankline == 1) {
print ".PP"
@@ -300,7 +300,7 @@ section == "SYNOPSIS" {
} else if ($1 == "#define")
subwords["\\<" $2 "\\>"] = "\\fI" $2 "\\fP"
for (i = 1; i <= NF; i++) {
- if ($i ~ /[\,\)]\;*$/) {
+ if ($i ~ /[,\)];*$/) {
a = $i
sub(/.*\(/, "", a)
gsub(/\W/, "", a)
--
2.26.2

0 comments on commit 6dcbf0f

Please sign in to comment.