#!/bin/sh
set -e

export MAKEPKG_DUMMY_BUILD=1
export PKGDEST="$PWD/pkg";

while read pkgs; do
	echo $pkgs
	rm -rf pkg/*

	for pkg in $pkgs; do
		git clone aur://$pkg || true

		cd $pkg
		makepkg -fs --needed --asdeps --noconfirm
		cd ..
	done

	sudo pacman -U pkg/* --noconfirm --needed --ask 255 --dbonly
done<../order3

