#!/bin/sh

# Archlinux package installation

# yay is a wrapper for pacman that adds automated access (substitute of yaourt)
# to the AUR.
# See:	https://wiki.archlinux.org/index.php/AUR_helpers
#	https://aur.archlinux.org/packages/yay/

# yay not support root to build package
# Use regular user to do this
. $LKP_SRC/distro/${DISTRO}
add_aur_helper

regular_user=$(grep 1090 /etc/passwd | awk -F':' '{ print $1 }')

sudo -u $regular_user yay -Sq --needed --noconfirm $* >/tmp/pacman_info 2>&1
[ -f /tmp/pacman_info ] && grep -v "warning: could not get file information for *" /tmp/pacman_info
