summaryrefslogtreecommitdiff
path: root/pkgbuild-check-nonfree
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-30 03:29:17 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-04-30 03:45:04 -0500
commitf33f1f0ed91fb33e7681291f7f6b260447fcfb86 (patch)
tree56a07fd8649f9ab50f705cd764c71af1e0a2efba /pkgbuild-check-nonfree
parenta3204e055fb538cdca56fc477d264c6d46e72ca3 (diff)
pkgbuild-check-nonfree can check if a nonfree has a -libre replacement
Diffstat (limited to 'pkgbuild-check-nonfree')
-rwxr-xr-xpkgbuild-check-nonfree14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree
index c55e7f6..67c562d 100755
--- a/pkgbuild-check-nonfree
+++ b/pkgbuild-check-nonfree
@@ -23,7 +23,7 @@ source /etc/libretools.conf
[[ -f $XDG_CONFIG_HOME/libretools/libretools.conf ]] && \
source $XDG_CONFIG_HOME/libretools/libretools.conf
-pushd /tmp >/dev/null
+pushd $(mktemp -d) >/dev/null
# This is the exit status.
ev=0
@@ -44,6 +44,7 @@ wget -N -q -O blacklist.txt "${BLACKLIST}" 2>/dev/null || {
# Get everything before the `:' in the blacklist (that's the names of the
# packages).
unfree=($(cut -d: -f1 blacklist.txt))
+freerep=($(cut -d: -f2 blacklist.txt))
popd >/dev/null
@@ -59,10 +60,15 @@ msg "Looking for unfree dependencies"
for item in ${pkgname[@]} ${depends[@]} ${makedepends[@]} ; do
# We cycle through all of the programs in the array (if any), and check if
# they are in the `unfree' array.
- if in_array $item ${unfree[@]}
- then
- ev=15
+ if in_array $item ${unfree[@]} ; then
+ # if item has a free replacement, use error 16.
+ if in_array $item-libre ${freerep[@]} and [[ $ev -ne 15 ]] ; then
+ ev=16
+ warning "$item -> $item-libre"
+ else
+ ev=15
msg2 "found $item"
+ fi
fi
done