summaryrefslogtreecommitdiffstats
path: root/arch-pkgs-update
blob: 64bb757ffd948e8a8bb3e1a240b99694fb697d75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

[ $# -lt 1 ] && echo "usage $0 pkg_list (generated with pacman -Q)" && exit 1

tmp=/tmp/__pkgs
[ -e $tmp ] && rm $tmp

echo " * read packages list"
pkgs=`cat $1 | gawk '{ print $1 }'`
echo " * search packages to install"
for pkg in $pkgs; do
    pacman -Q $pkg >/dev/null 2>&1 || echo $pkg >> $tmp
done
if [ -e $tmp ]; then
    echo " * install packages"
    pkgs=$(cat $tmp)
    pacman -S $pkgs || exit 1
    echo " * done"
else
    echo " * nothing todo"
fi