This commit is contained in:
Stephen Simpson
2025-01-04 08:18:27 -06:00
commit 2287678798
16 changed files with 1534 additions and 0 deletions

28
old_scripts/extract_man.sh Executable file
View File

@@ -0,0 +1,28 @@
#! /bin/bash
ROCKY_VERSION=8.10
MAN_OUTPUT=./export/${ROCKY_VERSION}/
DIRECTORY=$1
if [ -z "$DIRECTORY" ]; then
echo "Please provide the directory containing the RPM files"
exit 1
fi
mkdir -p "$MAN_OUTPUT"
extract_man_pages() {
local rpm=$1
local man_output=$2
MANCOUNT=$(rpm2cpio "$rpm" | cpio -itv --quiet | grep -c "/man/")
RPMNAME=$(rpm -qp --qf "%{NAME}\n" "$rpm")
if [ "$MANCOUNT" -ne 0 ]; then
mkdir -p "${man_output}/${RPMNAME}"
rpm2cpio "$rpm" | cpio -idmv --quiet -D "${man_output}/${RPMNAME}/" '*/man/*'
fi
}
export -f extract_man_pages
find "$DIRECTORY" -type f -name "*.rpm" | parallel --will-cite -j+0 extract_man_pages {} "$MAN_OUTPUT"