pm2ml

2024-05-17 22:37 UTC
  • Xyne

Metadata

Description: Generate metalinks for downloading Pacman packages and databases.
Latest Version: 2021.11.20.1
Source Code: src/
Architecture:
  • any
Dependencies:
Build Dependencies:
  • python-setuptools
Optional Dependencies:
Arch Repositories:
  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]
AUR Page: pm2ml
Arch Forum Thread: 138020
Tags:

About

edit: The following description is no longer complete. The package now includes a Python module that can be used to extract generic download queues in addition to generating metalinks. It can therefore be used to write download scripts and Pacman-wrapper scripts. See Parisync for an example. Powerpill is also based on the pm2ml backend.

pm2ml (pacman2metalink) generates metalinks for Pacman database and package downloads. It can also include source tarballs from the AUR. The metalinks can be used for parallel and segmented downloads, which speeds up the overall download considerably if you have a good connection.

Speeding up downloads isn’t the only use of pm2ml. If you have a slow or data-capped connection at home, you can use it to generate metalinks for downloading packages on another computer with a better connection.1

pm2ml is similar to pacman2aria2, but instead of parsing pacman’s output directly, it uses pyalpm internally. It also supports AUR downloads.

ppl

Note: This is left here as a usage example for now. For a full Pacman wrapper and download accelerator, use the re-released Powerpill.

ppl (powerpill-light) is an alternative to the powerpill-light script provided by pacman2aria2. It’s just a convenience wrapper for pm2ml and can be edited as needed. The script does not actually invoke pacman, so it’s similar to pacman -Sw ....

Aria2 options for ppl can be configured using /etc/ppl.conf.

The package also includes pplsyu that is equivalent to pacman -Syu, and ppls that is equivalent to pacman -S. Both can accept package and group names to download and install as arguments. These also use the ppl.conf configuration file.

pm2ml Help Message

$ pm2ml --help

usage: pm2ml [-h] [--all-deps] [-a] [--select] [--arch <architecture>]
             [--aur-only] [-c <path>] [--noconfirm] [-d] [--debug] [--files]
             [--ignore <pkgname>] [--ignoregroup <grpname>] [--needed]
             [-o <path>] [-p] [-r ...] [-s] [-u] [-v] [-y]
             [<pkgname> ...]

Generate metalinks for parallel and segmented package downloads.

positional arguments:
  <pkgname>             Packages or groups to download.

options:
  -h, --help            show this help message and exit
  --all-deps            Include all dependencies even if they are already
                        installed.
  -a, --aur             Enable AUR support.
  --select              Present a package selection dialogue for package
                        groups. This may be overridden by --noconfirm.
  --arch <architecture>
                        Override the architecture in the Pacman configuration
                        file.
  --aur-only            Only download AUR archives. Use with "-u" to only
                        download tarballs for upgradable AUR packages.
  -c <path>, --conf <path>
                        Set the pacman.conf file. Default: /etc/pacman.conf
  --noconfirm           Suppress user prompts.
  -d, --nodeps          Skip dependencies.
  --debug               Display debugging information.
  --files               Download Pacman "files" databases.
  --ignore <pkgname>    Ignore designated package.
  --ignoregroup <grpname>
                        Ignore packages belonging to designated groups.
  --needed              Skip packages if they already exist in the cache.
  -o <path>, --output-dir <path>
                        Set the output directory.
  -p, --preference      Use preference attributes in URL elements in the
                        metalink.
  -r ..., --reflector ...
                        Enable Reflector support and treat remaining arguments
                        as Reflector arguments. E.g. "-r --latest 50
  -s, --sigs            Include signature files for repos with optional and
                        required SigLevels. Pass this flag twice to attempt to
                        download signature for all databases and packages.
  -u, --sysupgrade      Download upgradable packages.
  -v, --verbose         Verbose output.
  -y, --databases, --refresh
                        Download databases.

ppl Help Message

$ ppl -h

DESCRIPTION
  /usr/bin/ppl is a convenience wrapper for pm2ml. It is just a simple Bash script.
  Use it to download database and package files, or edit it to suit your needs.

USAGE
  /usr/bin/ppl [-y] [-u] [pkgnames]

  -y    download database files to Pacman sync database
  -u    download upgradable packages

  [pkgnames] may be package names or group names

CONFIGURATION
  Aria2 options are read from /etc/ppl.conf

README

Example Scripts

The ppl* scripts are included as examples. Use them as a starting point to write your own scripts. Of course, of the scripts already do what you want, use them.

CHANGELOG

2016-01-14

  • Support downgrades with -uu.

2015-11-21

  • Changed “–ask” option to “–select” to avoid overlap with unrelated “–ask” option in pacman.

2014-12-30

  • Handle comma-separated arguments to –ignore and –ignoregroup.

2014-08-14

  • changed Metalink preference step size
  • added run_main()

2013-02-03

  • added --preference option

2012-07-10

  • converted code to a Python module
  • added hooks to extract generic download queues

2012-06-10

  • added “–all-deps” option

2012-04-07

  • added --ignore and --ignoregroup options
Contact
echo xyne.archlinux.org | sed 's/\./@/'
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0