aboutsummaryrefslogtreecommitdiff
path: root/repos/extra/squashfs-tools/0002-generate-manpages-Workaround-busybox-sed.patch
blob: a2ce7f04a54b50bf34b75b38bef97da9c707e93a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
From 7e7a26b1f975396c36351ea661efc8b06777cb42 Mon Sep 17 00:00:00 2001
From: Yao Zi <ziyao@disroot.org>
Date: Mon, 9 Jun 2025 11:56:45 +0000
Subject: [PATCH] generate-manpages: Workaround busybox sed

Busybox SED doesn't support \U in replacement pattern, which is used to
turning option arugments into uppercase in manpage-generation scripts.

Let's remove the sed-compatibility check and simply don't do the
case-conversion. A less well-formatted documentation is better than
nothing.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 squashfs-tools/generate-manpages/functions.sh | 26 +------------------
 .../generate-manpages/mksquashfs-manpage.sh   |  5 ----
 .../generate-manpages/sqfscat-manpage.sh      |  5 ----
 .../generate-manpages/unsquashfs-manpage.sh   |  5 ----
 4 files changed, 1 insertion(+), 40 deletions(-)

diff --git a/squashfs-tools/generate-manpages/functions.sh b/squashfs-tools/generate-manpages/functions.sh
index 5e31d9cdc32c..efbc00000b85 100755
--- a/squashfs-tools/generate-manpages/functions.sh
+++ b/squashfs-tools/generate-manpages/functions.sh
@@ -53,28 +53,4 @@ if ! which echo > /dev/null 2>&1; then
 fi
 
 ECHO=$(which echo)
-
-# The manpage generation scripts rely on sed being GNU sed.  Check whether
-# 'sed' looks like GNU sed, and if not try gsed which is often what GNU sed is
-# named on BSD systems.
-#
-# If SED has been already defined on the command line then use that, but,
-# check that it looks like GNU sed too.
-if [ -n "${SED}" ]; then
-	if ! check_sed "${SED}"; then
-		error "$0: SED set to ${SED}, but this doesn't seem to be GNU sed!"
-		error "$0: Fix variable or install GNU sed before running this script!"
-		exit 1
-	fi
-elif check_sed sed; then
-	SED=sed;
-elif check_sed gsed; then
-	SED=gsed
-else
-	error "$0: You don't seem to have GNU sed installed, either as sed or gsed."
-	error "$0: Fix PATH or install GNU sed before running this script!"
-	error "$0: If GNU sed is not named sed or gsed on your system"
-	error "$0: use SED=xxx on command line"
-
-	exit 1
-fi
+SED=sed
diff --git a/squashfs-tools/generate-manpages/mksquashfs-manpage.sh b/squashfs-tools/generate-manpages/mksquashfs-manpage.sh
index fbbbf9610fef..4ba36b8d3239 100755
--- a/squashfs-tools/generate-manpages/mksquashfs-manpage.sh
+++ b/squashfs-tools/generate-manpages/mksquashfs-manpage.sh
@@ -120,11 +120,6 @@ ${SED} -i -e "s/expr> as/expr>  as/" -e "s/exp> as/exp>  as/" \
 
 ${SED} -i -e "s/act@/action@/g" -e "s/expr>/expression>/g" -e "s/exp>/expression>/" -e "s/<f>/<file>/g" $tmp/mksquashfs.help
 
-# Uppercase the options operands (between < and > ) to make it conform
-# more to man page standards
-
-${SED} -i "s/<[^>]*>/\U&/g" $tmp/mksquashfs.help
-
 # Undo the above for the -pd option, where the case actually matters!  Also
 # expand the truncated uid and gid in help text due to lack of space.
 # Also put quotes around the above pseudo definitions
diff --git a/squashfs-tools/generate-manpages/sqfscat-manpage.sh b/squashfs-tools/generate-manpages/sqfscat-manpage.sh
index 76940fb2239a..71eab52a7c6a 100755
--- a/squashfs-tools/generate-manpages/sqfscat-manpage.sh
+++ b/squashfs-tools/generate-manpages/sqfscat-manpage.sh
@@ -115,11 +115,6 @@ ${SED} -i "s/\([^ ][^ \[]*\)\[\([a-z-]*\)\]/\1, \1\2/" $tmp/sqfscat.help
 
 ${SED} -i "s/\t/  /g" $tmp/sqfscat.help
 
-# Uppercase the options operands (between < and > ) to make it conform
-# more to man page standards
-
-${SED} -i "s/<[^>]*>/\U&/g" $tmp/sqfscat.help
-
 # Remove the "<" and ">" around options operands to make it conform
 # more to man page standards
 
diff --git a/squashfs-tools/generate-manpages/unsquashfs-manpage.sh b/squashfs-tools/generate-manpages/unsquashfs-manpage.sh
index e2c25bd88e0d..55e0abbd948a 100755
--- a/squashfs-tools/generate-manpages/unsquashfs-manpage.sh
+++ b/squashfs-tools/generate-manpages/unsquashfs-manpage.sh
@@ -115,11 +115,6 @@ ${SED} -i "s/\([^ ][^ \[]*\)\[\([a-z-]*\)\]/\1, \1\2/" $tmp/unsquashfs.help
 
 ${SED} -i "s/\t/  /g" $tmp/unsquashfs.help
 
-# Uppercase the options operands (between < and > ) to make it conform
-# more to man page standards
-
-${SED} -i "s/<[^>]*>/\U&/g" $tmp/unsquashfs.help
-
 # Remove the "<" and ">" around options operands to make it conform
 # more to man page standards
 
-- 
2.49.0