pm2ml

2014-08-14 11:55 UTC
  • Xyne

Metadata

Description:

Generate metalinks for downloading Pacman packages and databases.

Latest Version:

2014

Architecture:

  • any

Dependencies:

  • python3
  • pyalpm

Optional Dependencies:

Arch Repositories:

  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]

AUR ID:

57804

Arch Forum ID:

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] [--ask] [--aur-only] [-c <path>]
             [--noconfirm] [-d] [--ignore <pkgname>] [--ignoregroup <grpname>]
             [--needed] [-o <path>] [-p] [-r ...] [-s] [-u] [-y]
             [<pkgname> [<pkgname> ...]]

Download packages using parallel downloads.

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

optional arguments:
  -h, --help            show this help message and exit
  --all-deps            Include all dependencies even if they are already
                        installed.
  -a, --aur             Enable AUR support.
  --ask                 Present a package selection dialogue for package
                        groups. This may be overridden by --noconfirm.
  --aur-only            Only download AUR archives. Use with "-u" to only
                        download tarballs for upgradable AUR packages.
  -c <path>, --conf <path>
                        Use a different pacman.conf file.
  --noconfirm           Suppress user prompts.
  -d, --nodeps          Skip dependencies.
  --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, --upgrade, --sysupgrade
                        Download upgradable packages.
  -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

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

  1. If you download AUR source tarballs on another computer, make sure that you also download the remote sources for those packages. pm2ml will not generate a metalink for files specified in the PKGBUILD source array.

Contact
echo xyne.archlinux.ca | sed 's/\./@/'
Feeds
Blog News
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0