summaryrefslogtreecommitdiffstats
path: root/upstream/debian-bookworm/update-manpages.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:43:11 +0000
commitfc22b3d6507c6745911b9dfcc68f1e665ae13dbc (patch)
treece1e3bce06471410239a6f41282e328770aa404a /upstream/debian-bookworm/update-manpages.sh
parentInitial commit. (diff)
downloadmanpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.tar.xz
manpages-l10n-fc22b3d6507c6745911b9dfcc68f1e665ae13dbc.zip
Adding upstream version 4.22.0.upstream/4.22.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-bookworm/update-manpages.sh')
-rwxr-xr-xupstream/debian-bookworm/update-manpages.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/upstream/debian-bookworm/update-manpages.sh b/upstream/debian-bookworm/update-manpages.sh
new file mode 100755
index 00000000..a1c8c434
--- /dev/null
+++ b/upstream/debian-bookworm/update-manpages.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+#
+# Copyright © 2010-2019 Dr. Tobias Quathamer <toddy@debian.org>
+# © 2023 Dr. Helge Kreutzmann <debian@helgefjell.de>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Start with clean directories and no leftover links.txt
+rm -rf man* links.txt
+
+mkdir man1 man2 man3 man4 man5 man6 man7 man8
+
+# Process packages
+while read package; do
+ mkdir tmp
+
+ # Download HTML page and discover the correct link
+ echo "Downloading and updating package '$package'"
+ url=$(wget --quiet -O - "http://packages.debian.org/bookworm-backports/amd64/$package/download" |
+ grep "http://ftp.de.debian.org/debian/pool/" |
+ sed -e "s,.*\(http://ftp.de.debian.org/debian/pool/[^\"]*\).*,\1,")
+
+ if [ -z $url ]; then
+ url=$(wget --quiet -O - "http://packages.debian.org/bookworm/amd64/$package/download" |
+ grep "http://ftp.de.debian.org/debian/pool/" |
+ sed -e "s,.*\(http://ftp.de.debian.org/debian/pool/[^\"]*\).*,\1,")
+
+ if [ -z $url ]; then
+ url=$(wget --quiet -O - "http://packages.debian.org/bookworm/amd64/$package/download" |
+ grep "http://security.debian.org/debian-security/pool/updates/" |
+ sed -e "s,.*\(http://security.debian.org/debian-security/pool/updates/[^\"]*\).*,\1,")
+ wget --quiet --directory-prefix=tmp/downloads "$url"
+ fi
+ fi
+ # Update the manpages from the package
+ wget --quiet --directory-prefix=tmp/downloads "$url"
+ latest_deb=$(ls tmp/downloads/$package\_*.deb)
+ if [ -z $latest_deb ]; then
+ echo "Warning: Could not find .deb for package '$package'"
+ else
+ data_tar=$(ar t $latest_deb | grep data.tar)
+ ar x $latest_deb $data_tar
+ tar xaf $data_tar --directory=tmp 2>/dev/null
+ ./move-manpages.sh
+ fi
+ # Finally, remove the tarball, so that the regexp
+ # matching does not match the wrong tarball.
+ # See pacman and pacman-contrib for an example.
+ rm -rf tmp data.tar.*
+done < packages.txt
+
+if [ -f links.txt ]; then
+ LC_ALL=C sort links.txt > tmp.links
+ mv tmp.links links.txt
+fi
+
+ # Special case for grub-mknetdir.1. This file contains an unprintable
+ # character (detected as "\v") which po4a can't handle.
+ # See https://savannah.gnu.org/bugs/?58936
+ if [ -f ./man1/grub-mknetdir.1 ]; then
+ sed -i -e "s| Prepares|Prepares|" ./man1/grub-mknetdir.1
+ fi
+
+ # Remove some files due to licensing issues
+ rm -f ./man1/hpcdtoppm.1
+ rm -f ./man1/zipgrep.1