diff options
author | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-05-16 19:14:47 -0300 |
---|---|---|
committer | Nicolás Reynolds <apoyosis@correo.inta.gob.ar> | 2011-05-16 19:14:47 -0300 |
commit | bf87a77517cb5d960865faaf820decaa338c4f63 (patch) | |
tree | 6c10ea4f2a80ae3d5df3ae08b40f6ad5c9195ed6 /aur | |
parent | 56e183631d6e4e12df4990d119456dd81423938e (diff) | |
parent | 76c75b8971e4ad2f6c336c9413088e6fd0e70f69 (diff) |
Merge branch 'master' of ssh://vparabola/srv/git/projects/libretools
Conflicts:
libremakepkg
Diffstat (limited to 'aur')
-rwxr-xr-x | aur | 72 |
1 files changed, 72 insertions, 0 deletions
@@ -0,0 +1,72 @@ +#!/bin/bash + +source /etc/libretools.conf +source /etc/abs.conf + +function usage { + echo "Usage: $0 pkgname-from-aur1 [pkgname-from-aur2 ...]" + echo + echo "This script will download packages from aur to the current dir" + echo "and check their license for nonfree issues." +} + +while getopts 'h' arg; do + case $arg in + h) usage; exit 0 ;; + *) usage; exit 1 ;; + esac +done + +missing_deps=() +for _pkg in ${@}; do + msg "Downloading $_pkg..." + wget -O - -q http://aur.archlinux.org/packages/$_pkg/$_pkg.tar.gz | \ + tar xzf - >/dev/null 2>&1 + + [[ $? -ne 0 ]] && { + error "Couldn't get $_pkg" + continue + } + + stdnull "pushd $_pkg" + + source PKGBUILD + + pkgbuild-check-nonfree || { + if [ $? -eq 15 ]; then + warning "This PKGBUILD links to known unfree packages" + fi + } + + msg2 "Checking license..." + free=0 + for _license in ${license[@]}; do + if [ ! -d /usr/share/licenses/common/$_license ]; then + warning "License $_license is not a common license" + free=1 + fi + done + + if [ $free -eq 1 ]; then + plain "Please check that the license is included in the package and + *specially* that it respects your freedom." + fi + + for _dep in ${depends[@]} ${makedepends[@]}; do + if ! is_built $_dep; then + if ! find ${ABSROOT} -maxdepth 2 -type d -name "$_dep" | egrep "*" >/dev/null ; then + missing_deps=(${missing_deps} $_dep) + fi + fi + done + + stdnull popd + +done + +[[ ${#missing_deps[*]} -gt 0 ]] && { + msg2 "Retrieving missing deps: ${missing_deps[@]}" + $0 ${missing_deps[@]} +} + +exit 0 |