;; (find-man "pacman")
;; (find-man "pacman" "-Q, --query")
;; (find-man "pacman" "QUERY OPTIONS (APPLY TO -Q)")
;; (find-man "pacman" "QUERY OPTIONS (APPLY TO -Q)" "-l, --list")

;; (find-sh "pacman -Ql gdal-ecw")
;; (find-sh "pacman -Ql gdal-ecw | grep \\\\.so")

; (find-html2pdf-links1 "pacman" "https://wiki.archlinux.org/title/Pacman")
(code-pdf-page  "pacman" "$S/https/wiki.archlinux.org/title/Pacman.pdf")
(code-pdf-text8 "pacman" "$S/https/wiki.archlinux.org/title/Pacman.pdf")
(page-utils-mode 1)
# (find-pacmantext 1 "combines a simple binary package format with an easy-\nto-use Arch build system")
# (find-pacmanpage 1 "keeps the system up-to-date by synchronizing package lists with the master server")
# (find-pacmantext 1 "written in the C programming language and uses the bsdtar(1) tar format for packaging.")
# (find-pacmantext 1 "Tip The pacman package contains tools such as makepkg and vercmp(8)")
; (find-man "vercmp" "version comparison utility")
# (find-pacmanpage 1 "Other useful tools such as pactree and checkupdates are found in\npacman-contrib")
; (find-~sh "pacman -Ql pacman pacman-contrib | grep -E 'bin/.+'")
; (find-~sh "pacman -Ql pacman pacman-contrib")

# (find-pacmanpage 1 "Usage" "small sample of the operations that pacman can perform")
; (find-man "pacman")
# (find-pacmantext 2 "Installing packages")
# (find-pacmantext 2 "Installing packages" "A package is an archive containing:")
# (find-pacmantext 2 "Installing packages" "A package is an archive containing:" "(compiled) files of an application")
# (find-pacmantext 2 "Installing packages" "A package is an archive containing:" "metadata about the application")
# (find-pacmantext 2 "Installing packages" "A package is an archive containing:" "installation files and directives for pacman")
# (find-pacmantext 2 "Installing packages" "clean removal: pacman has a list of every file in a package")
# (find-pacmantext 2 "Installing packages" "When installing a package, pacman will list a package's optional dependencies, but they will not be found in" "pacman.log.")
# (find-pacmantext 2 "Installing packages" "avoid refreshing the package list without upgrading the system")
# (find-pacmantext 2 "Installing packages" "do not run pacman -Sy package_name instead of pacman -Syu package_name, as the former\ncould lead to dependency issues. See System maintenance#Partial upgrades are unsupported ")
# (find-pacmantext 2 "Installing specific packages" "pacman -S package_name1 package_name2")
# (find-pacmantext 2 "Installing specific packages" "Tip The same command can be used to reinstall a package.")
# (find-pacmantext 2 "Installing specific packages" "To install a list of packages with regex" "pacman -S $(pacman -Ssq package_regex)")
# (find-pacmantext 3                                "Sometimes there are multiple versions of a package in different repositories (e.g. extra and extra-testing)" "pacman -S extra/package_name")
# (find-pacmantext 3                                "To install a number of packages sharing similar patterns in their names" "pacman -S plasma-{desktop,mediacenter,nm}")
# (find-pacmantext 3                                "This can be expanded to however many levels needed" "pacman -S plasma-{workspace{,-wallpapers},pa}")
# (find-pacmantext 3 "Virtual packages" "A virtual package is a special package which does not exist by itself, but is provided by one or more other packages.")
# (find-pacmantext 3 "Installing package groups")
# (find-pacmantext 3 "Installing package groups" "Some packages belong to a group of packages that can all be installed simultaneously")
# (find-pacmantext 3 "Installing package groups" "pacman -S gnome" "prompt you to select the packages from the gnome group that you wish to install")
# (find-pacmantext 3 "Installing package groups" "Enter a selection (default=all): 1-10 15" "will select packages 1 through 10 and 15 for installation")
# (find-pacmantext 4                             "Enter a selection (default=all): ^5-8 ^2" "will select all packages except 5 through 8 and 2 for installation")
# (find-pacmantext 4                             "To see what packages belong to the gnome group" "pacman -Sg gnome")
# (find-pacmantext 4                             "pacman -Sg gnome" "Also visit https://archlinux.org/groups/ to see what package groups are available")
; (ff "https://archlinux.org/groups/")
# (find-pacmanpage 4                             "already installed on the system, it will be reinstalled even if it is already up-to-date. This behavior can be overridden\nwith the --needed option")
# (find-pacmantext 4 "Removing packages")
# (find-pacmantext 4 "Removing packages" "To remove a single package"                                                                           "pacman -R package_name")
# (find-pacmantext 4 "Removing packages" "remove a package and its dependencies which are not required by any other installed package"          "pacman -Rs package_name")
# (find-pacmantext 4 "Removing packages" "The above may sometimes refuse to run when removing a group which contains otherwise needed packages" "pacman -Rsu package_name")
# (find-pacmantext 4 "Removing packages" "remove a package, its dependencies and all the packages that depend on the target package"            "pacman -Rsc package_name")
# (find-pacmantext 4 "Removing packages" "Warning This operation is recursive, and must be used with care since it can remove many potentially needed packages.")
# (find-pacmanpage 4 "Removing packages" "remove a package, which is required by another package, without removing the dependent package"       "pacman -Rdd package_name")
# (find-pacmantext 4 "Removing packages" "pacman saves important configuration files when removing certain applications and names them with the extension: .pacsave. To prevent" "the -n option")
# (find-pacmantext 5 "Upgrading packages")
# (find-pacmantext 5 "Upgrading packages" "Warning")
# (find-pacmanpage 5 "Upgrading packages" "Warning" "follow the guidance in the System maintenance#Upgrading the system section to upgrade their systems regularly")
; https://wiki.archlinux.org/title/System_maintenance#Upgrading_the_system
# (find-pacmantext 5 "Upgrading packages" "Warning" "Arch only supports full system upgrades. See System maintenance#Partial upgrades are unsupported")
# (find-pacmantext 5 "Upgrading packages" "The following command synchronizes the repository databases and updates the system's packages, excluding \"local\" packages that are not in the\nconfigured repositories:" "pacman -Syu")
# (find-pacmantext 5 "Querying package databases")
# (find-pacmantext 5 "Querying package databases" "pacman queries the local package database with the -Q flag, the sync database with the -S flag and the files database with the -F flag")
; (find-~sh "pacman -Q --help")
; (find-~sh "pacman -S --help")
; (find-~sh "pacman -F --help")
# (find-pacmantext 5 "Querying package databases" "Sync the files database before querying it to get up-to-date results" "pacman -Fy")
# (find-pacmantext 5 "Querying package databases" "search for packages in the database, searching both in packages' names and descriptions" "pacman -Ss string1 string2")
# (find-pacmantext 5 "Querying package databases" "limited to match the package\nname only; not the description nor any other field"        "pacman -Ss '^vim-'")
# (find-pacmantext 5 "Querying package databases" "To search for already installed packages"                                                "pacman -Qs string1 string2")
# (find-pacmantext 6                              "search for package file names in remote packages"                                        "pacman -F string1 string2")
# (find-pacmantext 6                              "display extensive information about a given package"                                     "pacman -Si package_name")
# (find-pacmantext 6                              "display extensive information about a given package" "For locally installed packages"    "pacman -Qi package_name")
# (find-pacmantext 6                              "two -i flags will also display the list of backup files and their modification states"   "pacman -Qii package_name")
# (find-pacmantext 6                              "retrieve a list of the files installed by a package"                                     "pacman -Ql package_name")
# (find-pacmantext 6                              "retrieve a list of the files installed by a remote package:"                             "pacman -Fl package_name")
# (find-pacmantext 6                              "verify the presence of the files installed by a package"                                 "pacman -Qk package_name")
# (find-pacmantext 6                              "Passing the k flag twice will perform a more thorough check.")
; (find-~sh "pacman -Qk bluez")
; (find-~sh "pacman -Qkk bluez")
# (find-pacmanpage 6                              "query the database to know which package a file in the file system belongs to"           "pacman -Qo /path/to/ﬁle_name")
# (find-pacmantext 6                              "query the database to know which package a file in the file system belongs to"           "pacman -Qo /path/to/ﬁle_name")
# (find-pacmantext 6                                        "query the database to know which remote package a file belongs to" "pacman -F /path/to/ﬁle_name")
# (find-pacmantext 6                                        "packages no longer required as dependencies (orphans)" "pacman -Qdt")
# (find-pacmantext 7                                        "packages explicitly installed and not required as dependencies" "pacman -Qet")
# (find-pacmantext 7                                        "See pacman/Tips and tricks for more examples")
; https://wiki.archlinux.org/title/Pacman/Tips_and_tricks
# (find-pacmanpage 7                                        "For advanced functionality, install pkgfile," "separate database with all files and their associated packages")
# (find-pacmantext 7 "dependency tree of a package" "pactree package_name")
# (find-pacmanpage 7  "dependent tree of a package, pass the reverse flag -r to pactree")
; (find-~sh "pacman -Ss pacman-contrib")
; (find-~sh "pactree    bluez")
; (find-~sh "pactree -r bluez")
# (find-pacmantext 7  "Database structure")
# (find-pacmantext 7  "Database structure" "normally located at /var/lib/pacman/sync")
# (find-pacmantext 7  "Database structure" "For each repository specified in /etc/pacman.conf, there will be a\ncorresponding database file")
# (find-pacmantext 7  "Database structure" "gzipped tar archives containing one directory for each package")
; (find-fline "/var/lib/pacman/sync")
; (find-~sh "tar -tf /var/lib/pacman/sync/core.db")
; (find-~sh "tar -tf /var/lib/pacman/sync/core.db" "/desc")
# (find-pacmanpage 7  "Database structure" "The desc file contains meta data such as the package description, dependencies, file size and MD5 hash.")
# (find-pacmantext 7  "package cache\n")
# (find-pacmantext 7  "package cache\n" "Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically")
# (find-pacmantext 7  "package cache\n" "allows to downgrade a package without the need to retrieve the previous version through other means, such as the Arch Linux Archive")
# (find-pacmantext 7  "package cache\n" "package that has been uninstalled can easily be reinstalled directly from the cache")
# (find-pacmantext 7  "package cache\n" "necessary to deliberately clean up the cache periodically to prevent the directory to grow indefinitely in size")
# (find-pacmantext 8                    "paccache(8) script" "deletes all cached versions of installed and uninstalled packages, except for\nthe most recent three" "paccache -r")
# (find-pacmanpage 8                    "You can also define how many recent versions you want to keep." "paccache -rk1")
# (find-pacmanpage 8                    "-u/--uninstalled switch to limit the action of paccache to uninstalled packages" "paccache -ruk0")
# (find-pacmantext 8                    "remove all the cached packages that are not currently installed, and the unused sync databases" "pacman -Sc")
# (find-pacmanpage 8                    "remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache directory" "pacman -Scc")
# (find-pacmantext 8  "Additional commands" "Download a package without installing it" "pacman -Sw package_name")
# (find-pacmantext 9  "Additional commands" "Install a 'local' package that is not from a remote repository" "pacman -U /path/to/package/package_name-version.pkg.tar.zst")
# (find-pacmantext 9  "Additional commands" "keep a copy of the local package in pacman's cache, use" "pacman -U ﬁle:///path/to/package/package_name-version.pkg.tar.zst")
# (find-pacmanpage 9  "Additional commands" "Install a 'remote' package (not from a repository stated in pacman's configuration files)" "pacman -U http://www.example.com/repo/example.pkg.tar.zst")
