Skip to content

Instantly share code, notes, and snippets.

@smaknsk
Last active October 29, 2015 15:26
Show Gist options
  • Save smaknsk/923029d2fc7fb2940283 to your computer and use it in GitHub Desktop.
Save smaknsk/923029d2fc7fb2940283 to your computer and use it in GitHub Desktop.
function aurinstall() {
local PKGNAME
echo "install = $@"
return
for PKGNAME in $@; do
echo "Installing ${PKGNAME}..."
local PKGDEST=/tmp/makepkg_${PKGNAME}
/usr/bin/mkdir ${PKGDEST}
cd ${PKGDEST}
/usr/bin/curl -s https://aur.archlinux.org/packages/${PKGNAME:0:2}/${PKGNAME}/${PKGNAME}.tar.gz | /usr/bin/tar -zx
cd ${PKGNAME}
/usr/bin/chown nobody:nobody -R ${PKGDEST}
/usr/bin/sudo -u nobody /usr/bin/sh -c "/usr/bin/makepkg -s --noconfirm PKGDEST=${PKGDEST}" &>/dev/null
/usr/bin/pacman -U --needed --noconfirm `/usr/bin/find ${PKGDEST}/${PKGNAME}/*pkg.tar.xz`
rm -r ${PKGDEST}
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment