From 672c479570772e5f0ee162a47330f9eba111490d Mon Sep 17 00:00:00 2001 From: Samuel Mansour Date: Wed, 3 Feb 2016 01:20:13 +0100 Subject: [PATCH] add the script --- aur.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 aur.sh diff --git a/aur.sh b/aur.sh new file mode 100644 index 0000000..1b1795b --- /dev/null +++ b/aur.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +echo -n "Enter your desired AUR package: " +read pkg + +aurpkgdir=/tmp/aurpkg +aurpkg="${pkg}.tar.gz" +pwd=$(pwd) + +mkdir -p "$aurpkgdir" && cd "$aurpkgdir" + +curl -o "$aurpkg" "https://aur.archlinux.org/cgit/aur.git/snapshot/${aurpkg}" + +if [ "$?" = "0" ]; then + tar xvf "${aurpkg}" + cd "${pkg}" + makepkg -si + cd "$pwd" +else + echo 'Package not found. Are you sure it is in the AUR?' + cd "$pwd" + exit 1 +fi