]> code.delx.au - monosys/blob - aur-install
Fixed partition type
[monosys] / aur-install
1 #!/bin/bash
2
3 set -e
4
5 PKGNAME="$1"
6 if [ -z "$PKGNAME" ]; then
7 echo "Usage: $0 pkgname"
8 exit 1
9 fi
10
11 function enter_directory {
12 mkdir -p "$1"
13 cd "$1"
14 }
15
16 function fetch_latest_changes {
17 if [ ! -d .git ]; then
18 git init
19 git remote add origin "https://aur.archlinux.org/${PKGNAME}"
20 fi
21 git fetch
22 git reset origin/master
23 }
24
25 function show_diff {
26 git diff -R
27 }
28
29 function ask_user_to_continue {
30 read -p "Ok? (y/n) " ok
31 if [ "$ok" != "y" ]; then
32 return 1
33 fi
34 }
35
36 function build_and_install {
37 git clean -xf
38 git checkout .
39 makepkg -sri
40 }
41
42 enter_directory "/var/abs/aur/${PKGNAME}"
43 fetch_latest_changes
44 show_diff
45 ask_user_to_continue
46 build_and_install