#!/bin/sh # # set -x # author: Toralf Foerster, Hamburg, Germany # category C=$1 cd /usr/portage || exit 1 [[ -d $C ]] || exit 2 # result file for this category L=$HOME/$C.BadHomepages.txt rm -f $L # loop over all packages of the category for P in $C/* do # get all _different_ home pages from all ebuilds of this package grep "^HOMEPAGE=\"http://" $P/*.ebuild 2>/dev/null |\ grep -v '{' | cut -f3- -d '/' | sed 's/"//g' | sort -u |\ while read H do wget --spider --quiet --no-check-certificate --connect-timeout 20 --timeout 10 --tries=2 --user-agent=foo.bar $H -O /dev/null [[ $? -ne 0 ]] && grep -H "^HOMEPAGE=\"http://$H" $P/*.ebuild >> $L done done