Last active
July 26, 2020 23:44
-
-
Save jp-hoehmann/fc15eb998c305f8fc8123bf471971e79 to your computer and use it in GitHub Desktop.
Fetch all manpages available in packages into the current directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S bash -euo pipefail | |
# | |
# Fetch all available manpages. | |
# | |
n=$(apt-cache pkgnames | wc -l) | |
i=0 | |
for e in $(apt-cache pkgnames) | |
do | |
echo "Fetching $e ($((++i)) of $n)" >&2 | |
apt-get --print-uris download $e \ | |
| perl -ne 'print "$1\n" if /^'"'"'(.*?)'"'"'/' \ | |
| xargs -r curl -sL -o- \ | |
| dpkg-deb --fsys-tarfile /dev/stdin \ | |
|| : | |
done \ | |
| tar xv --ignore-zeros ./usr/share/man \ | |
| perl -pe 's/^/+ /' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quickstart:
As
/usr/local/share/extra-manpages/usr/share/man
is usually configured to automatically be included in the manpath, this should be all that is needed.