All pastes #740622 Raw Edit

Stuff

public shellscript v1 · immutable
·published 2007-10-18 02:29 UTC
rendered paste body
#!/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>"for dir in $@; do        BUILDFOLDER="$dir"        OUTPUTDIR="$OUTPUTROOT/$BUILDFOLDER"        BUILDSCRIPT="$dir/PKGBUILD"        if [ -r "$BUILDSCRIPT" ]; then                . $BUILDSCRIPT                mkdir -p $OUTPUTDIR                for file in ${source[@]};do                        [ -z $(egrep '^ftp://|^http://' <<<"$file") ] && cp -r $file $OUTPUTDIR                done                cp PKGBUILD $OUTPUTDIR        else                err "No PKGBUILD present in $BUILDFOLDER"        fidone