#!/bin/bash
set -e
cd /

# This is just an example of how pm2ml can be used in your own scripts.
# This will run the equivalent of "pacman -S [pkgnames]"

# Arguments for aria2c.
aria2_args=(
  --metalink-file=-
  --conf-path=/etc/ppl.conf
)
# download packages
pm2ml -o var/cache/pacman/pkg "$@" -r -p http -l 50 | aria2c "${aria2_args[@]}"
# invoke pacman
pacman -S "$@"
