2013-03-02 23:00:38 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# This file is not supposed to be executed directly. It is a common resource file
|
|
|
|
# for all pacman functions.
|
|
|
|
|
2013-04-07 16:41:52 +02:00
|
|
|
# Support: pacman 4.1
|
|
|
|
|
2013-03-02 23:00:38 +01:00
|
|
|
if [ -z "$(command -v pacman)" ]; then
|
|
|
|
echo "You need to have the pacman package manager installed."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$(command -v makepkg)" ]; then
|
|
|
|
echo "You need to have makepkg (the pacman package builder) installed."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2013-04-13 20:23:47 +02:00
|
|
|
## We use tzdata as reference for the output fields, because it is almost always
|
|
|
|
## installed. This let's us access the entry of pacman's output independently of
|
|
|
|
## the current locale.
|
2013-03-02 23:00:38 +01:00
|
|
|
pacman_var_list="$(pacman -Qi tzdata | cut -f1 -d':')"
|
|
|
|
if [ -z "$pacman_var_list" ]; then
|
|
|
|
echo "Could not get pacman's variables."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
pacman_name="$(echo "$pacman_var_list" | sed -n '1{p;q}')"
|
2013-04-07 16:41:52 +02:00
|
|
|
pacman_deps="$(echo "$pacman_var_list" | sed -n '9{p;q}')"
|
|
|
|
pacman_deps_none="$(pacman -Qi tzdata | sed -n '9{s/.*: //;p;q}')"
|
|
|
|
pacman_optdeps="$(echo "$pacman_var_list" | sed -n '10{p;q}')"
|
|
|
|
pacman_size="$(echo "$pacman_var_list" | sed -n '15{p;q}')"
|
2013-04-13 20:23:47 +02:00
|
|
|
|