#!/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) BUILDFOLDER="$2" BUILDSCRIPT="$BUILDFOLDER/PKGBUILD" OUTPUTDIR="$1/$BUILDFOLDER" err() { echo "$1" exit 1 } [ "$#" -ne "2" ] && err "Usage: $0 " if [ -r "$BUILDSCRIPT" ]; then . $BUILDSCRIPT mkdir -p $OUTPUTDIR for file in ${source[@]};do egrep '^ftp://|^http://' <<<"$file" && cp -r $file $OUTPUTDIR done cp $BUILDSCRIPT $OUTPUTDIR else err "No PKGBUILD present in $BUILDFOLDER" fi