#!/bin/bash## ABS Purifier script for filtering all unneeded files from ABS build folders.# Released under the General Public License (GPL)# By: Teran McKinney (sega01)OUTPUTROOT="$1"err() { echo "$1" exit 1}[ "$#" -lt "2" ] && err "Usage: $0 <output directory> <ABS build folders>"#Get rid of first parametershiftfor BUILDFOLDER in $@; do BUILDSCRIPT="$BUILDFOLDER/PKGBUILD" if [ -r "$BUILDSCRIPT" ]; then . $BUILDSCRIPT OUTPUTDIR="$OUTPUTROOT/$pkgname" mkdir -p $OUTPUTDIR for file in ${source[@]};do [ -z $(egrep '^ftp://|^http://' <<<"$file") ] && cp -r $BUILDFOLDER/$file $OUTPUTDIR done cp $BUILDSCRIPT $OUTPUTDIR else err "No PKGBUILD present in $BUILDFOLDER" fidone