diff options
-rwxr-xr-x | pkgbuild-check-nonfree | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree index d4e999a..6c6f0db 100755 --- a/pkgbuild-check-nonfree +++ b/pkgbuild-check-nonfree @@ -19,53 +19,41 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see <http://www.gnu.org/licenses/>. +source /etc/libretools.conf +[[ -f $XDG_CONFIG_HOME/libretools/libretools.conf ]] && \ + source $XDG_CONFIG_HOME/libretools/libretools.conf + +pushd /tmp >/dev/null + ev=0 -dir=$(pwd) -config_dir=$XDG_CONFIG_HOME/libretools -if [ -d $config_dir ]; then - mkdir -p $config_dir -fi -cd $config_dir +[[ ${#BLACKLIST} -eq 0 ]] && { + echo "Please set up the BLACKLIST variable in your libretools.conf file" + exit 1 +} -echo "" echo "Downloading the blacklist of proprietary software packages." -echo "" -wget -N http://www.parabolagnulinux.org/docs/blacklist.txt 2>/dev/null || { +wget -N -q -O blacklist.txt "${BLACKLIST}" 2>/dev/null || { echo "Download failed, exiting" exit 1 } -a=($(cut -d: -f1 blacklist.txt)) -source /etc/rc.d/functions -source $dir/PKGBUILD +unfree=($(cut -d: -f1 blacklist.txt)) -for item in ${pkgname[@]}; do - if in_array $item ${a[@]}; then - echo "$item itself is non free" - ev=15 - fi -done +popd >/dev/null -echo "Looking for non-free dependancies" - -echo " Found in «depends»:" -for item in ${depends[@]} ; do - if in_array $item ${a[@]}; then - ev=15 - echo $item - fi -done - -echo " Found in «makedepends»:" -for item in ${makedepends[@]}; do - if in_array $item ${a[@]}; then - ev=15 - echo $item - fi +source /etc/rc.d/functions +source ./PKGBUILD + +echo "Looking for unfree dependencies" +for where in pkgname depends makedepends; do + echo " Found in «${where}»:" + for item in ${!where[@]} ; do + if in_array $item ${a[@]}; then + ev=15 + echo $item + fi + done done -cd $dir -echo "" - -exit $ev
\ No newline at end of file +exit $ev |