From 3bd59fcf0a72c8a29c2c1c3107e98a55eca5ecae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 19 Oct 2010 14:14:29 -0500 Subject: Use XDG_CONFIG_HOME and downloads blacklist only if it's newer than saved one, exits with 15 if a package has nonfree dependencies --- pkgbuild-check-nonfree | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pkgbuild-check-nonfree b/pkgbuild-check-nonfree index 8b04733..53338b3 100755 --- a/pkgbuild-check-nonfree +++ b/pkgbuild-check-nonfree @@ -18,20 +18,19 @@ # You should have received a copy of the GNU General Public License # along with Parabola. If not, see . - + +ev=0 dir=$(pwd) -tempdir=$(mktemp -d) -cd $tempdir +config_dir=$XDG_CONFIG_HOME/libretools +if [-d $config_dir]; then + mkdir -p $config_dir +fi -# Run a sanity check -which pacman wget >/dev/null 2>/dev/null || { - echo "Cannot find pacman or wget, exiting"; - exit 1 -} +cd $config_dir echo "Downloading the blacklist of proprietary software packages." echo "" -wget http://www.parabolagnulinux.org/docs/blacklist.txt 2>/dev/null || { +wget -N http://www.parabolagnulinux.org/docs/blacklist.txt 2>/dev/null || { echo "Download failed, exiting" exit 1 } @@ -45,6 +44,7 @@ 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 @@ -52,10 +52,11 @@ done echo "Found in «makedepends»:" for item in ${makedepends[@]}; do if in_array $item ${a[@]}; then + ev=15 echo $item fi done -rm -rf $tempdir -exit 0 +cd $dir +exit $ev \ No newline at end of file -- cgit v1.2.3