0002-generate-manpages-Workaround-busybox-sed.patch (4275B)
1 From 7e7a26b1f975396c36351ea661efc8b06777cb42 Mon Sep 17 00:00:00 2001 2 From: Yao Zi <ziyao@disroot.org> 3 Date: Mon, 9 Jun 2025 11:56:45 +0000 4 Subject: [PATCH] generate-manpages: Workaround busybox sed 5 6 Busybox SED doesn't support \U in replacement pattern, which is used to 7 turning option arugments into uppercase in manpage-generation scripts. 8 9 Let's remove the sed-compatibility check and simply don't do the 10 case-conversion. A less well-formatted documentation is better than 11 nothing. 12 13 Signed-off-by: Yao Zi <ziyao@disroot.org> 14 --- 15 squashfs-tools/generate-manpages/functions.sh | 26 +------------------ 16 .../generate-manpages/mksquashfs-manpage.sh | 5 ---- 17 .../generate-manpages/sqfscat-manpage.sh | 5 ---- 18 .../generate-manpages/unsquashfs-manpage.sh | 5 ---- 19 4 files changed, 1 insertion(+), 40 deletions(-) 20 21 diff --git a/squashfs-tools/generate-manpages/functions.sh b/squashfs-tools/generate-manpages/functions.sh 22 index 5e31d9cdc32c..efbc00000b85 100755 23 --- a/squashfs-tools/generate-manpages/functions.sh 24 +++ b/squashfs-tools/generate-manpages/functions.sh 25 @@ -53,28 +53,4 @@ if ! which echo > /dev/null 2>&1; then 26 fi 27 28 ECHO=$(which echo) 29 - 30 -# The manpage generation scripts rely on sed being GNU sed. Check whether 31 -# 'sed' looks like GNU sed, and if not try gsed which is often what GNU sed is 32 -# named on BSD systems. 33 -# 34 -# If SED has been already defined on the command line then use that, but, 35 -# check that it looks like GNU sed too. 36 -if [ -n "${SED}" ]; then 37 - if ! check_sed "${SED}"; then 38 - error "$0: SED set to ${SED}, but this doesn't seem to be GNU sed!" 39 - error "$0: Fix variable or install GNU sed before running this script!" 40 - exit 1 41 - fi 42 -elif check_sed sed; then 43 - SED=sed; 44 -elif check_sed gsed; then 45 - SED=gsed 46 -else 47 - error "$0: You don't seem to have GNU sed installed, either as sed or gsed." 48 - error "$0: Fix PATH or install GNU sed before running this script!" 49 - error "$0: If GNU sed is not named sed or gsed on your system" 50 - error "$0: use SED=xxx on command line" 51 - 52 - exit 1 53 -fi 54 +SED=sed 55 diff --git a/squashfs-tools/generate-manpages/mksquashfs-manpage.sh b/squashfs-tools/generate-manpages/mksquashfs-manpage.sh 56 index fbbbf9610fef..4ba36b8d3239 100755 57 --- a/squashfs-tools/generate-manpages/mksquashfs-manpage.sh 58 +++ b/squashfs-tools/generate-manpages/mksquashfs-manpage.sh 59 @@ -120,11 +120,6 @@ ${SED} -i -e "s/expr> as/expr> as/" -e "s/exp> as/exp> as/" \ 60 61 ${SED} -i -e "s/act@/action@/g" -e "s/expr>/expression>/g" -e "s/exp>/expression>/" -e "s/<f>/<file>/g" $tmp/mksquashfs.help 62 63 -# Uppercase the options operands (between < and > ) to make it conform 64 -# more to man page standards 65 - 66 -${SED} -i "s/<[^>]*>/\U&/g" $tmp/mksquashfs.help 67 - 68 # Undo the above for the -pd option, where the case actually matters! Also 69 # expand the truncated uid and gid in help text due to lack of space. 70 # Also put quotes around the above pseudo definitions 71 diff --git a/squashfs-tools/generate-manpages/sqfscat-manpage.sh b/squashfs-tools/generate-manpages/sqfscat-manpage.sh 72 index 76940fb2239a..71eab52a7c6a 100755 73 --- a/squashfs-tools/generate-manpages/sqfscat-manpage.sh 74 +++ b/squashfs-tools/generate-manpages/sqfscat-manpage.sh 75 @@ -115,11 +115,6 @@ ${SED} -i "s/\([^ ][^ \[]*\)\[\([a-z-]*\)\]/\1, \1\2/" $tmp/sqfscat.help 76 77 ${SED} -i "s/\t/ /g" $tmp/sqfscat.help 78 79 -# Uppercase the options operands (between < and > ) to make it conform 80 -# more to man page standards 81 - 82 -${SED} -i "s/<[^>]*>/\U&/g" $tmp/sqfscat.help 83 - 84 # Remove the "<" and ">" around options operands to make it conform 85 # more to man page standards 86 87 diff --git a/squashfs-tools/generate-manpages/unsquashfs-manpage.sh b/squashfs-tools/generate-manpages/unsquashfs-manpage.sh 88 index e2c25bd88e0d..55e0abbd948a 100755 89 --- a/squashfs-tools/generate-manpages/unsquashfs-manpage.sh 90 +++ b/squashfs-tools/generate-manpages/unsquashfs-manpage.sh 91 @@ -115,11 +115,6 @@ ${SED} -i "s/\([^ ][^ \[]*\)\[\([a-z-]*\)\]/\1, \1\2/" $tmp/unsquashfs.help 92 93 ${SED} -i "s/\t/ /g" $tmp/unsquashfs.help 94 95 -# Uppercase the options operands (between < and > ) to make it conform 96 -# more to man page standards 97 - 98 -${SED} -i "s/<[^>]*>/\U&/g" $tmp/unsquashfs.help 99 - 100 # Remove the "<" and ">" around options operands to make it conform 101 # more to man page standards 102 103 -- 104 2.49.0 105