summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe <joe@joelightning.com>2011-02-12 16:56:23 +0000
committerJoe <joe@joelightning.com>2011-02-12 16:56:23 +0000
commit28bf2e7374b2c9fa4fb66920a31152d20dc95285 (patch)
tree16b96dbd858ff0582381b1cace290fcecefe978e
parent12ba3b273db883ce153e3c591b572605faadf20d (diff)
Added comments to pkgbuild-check-nonfree so that people can understand it.
-rwxr-xr-xpkgbuild-check-nonfree22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree
index 0ac6c6e..418a0bf 100755
--- a/pkgbuild-check-nonfree
+++ b/pkgbuild-check-nonfree
@@ -1,6 +1,6 @@
#!/bin/bash
# pkgbuild-check-nonfree
-# Copyright 2010 Joshua Ismael Haase Hernández
+# Copyright 2010 Joshua Ismael Haase Hernández, Joseph Graham
# ---------- GNU General Public License 3 ----------
@@ -25,31 +25,45 @@ source /etc/libretools.conf
pushd /tmp >/dev/null
+# This is the exit status.
ev=0
+# Check if the blacklist variable is empty, and if so error.
[[ ${#BLACKLIST} -eq 0 ]] && {
echo "Please set up the BLACKLIST variable in your libretools.conf file"
exit 1
}
+# Download the blacklist.
echo "Downloading the blacklist of proprietary software packages."
wget -N -q -O blacklist.txt "${BLACKLIST}" 2>/dev/null || {
echo "Download failed, exiting"
exit 1
}
+# Get everything before the `:' in the blacklist (that's the names of the
+# packages).
unfree=($(cut -d: -f1 blacklist.txt))
popd >/dev/null
-source /etc/rc.d/functions
+source /etc/rc.d/functions # We want the `in_array' function.
source ./PKGBUILD
+# The following piece of code will check whether a package is, or depends on;
+# any non free package(s).
+
+# The `pkgname', `depends', `makedepends' arrays have been sourced from
+# ./PKGBUILD.
echo "Looking for unfree dependencies"
-for where in pkgname depends makedepends; do
+for where in pkgname depends makedepends ; do
echo " Found in «${where}»:"
+
+ # We cycle through all of the programs in the array (if any), and check if
+ # they are in the `unfree' array.
for item in ${!where[@]} ; do
- if in_array $item ${unfree[@]}; then
+ if in_array $item ${unfree[@]}
+ then
ev=15
echo $item
fi