#!/bin/bash

ORIGPATH="$( pwd )"
cd ${ORIGPATH}

mkdir source 2>/dev/null
cd source

function grab_sourceball () {
local URL="$1"
local file="$( echo ${URL} | rev | cut -d/ -f1 | rev )"
if [ ! -f ${file}* ]; then
   echo "Downloading ${URL}"
   wget -N ${URL}
 else
   echo "Already have ${file}, skipping.."
fi
}

grab_sourceball http://ftp.debian.org/debian/pool/main/g/grep/grep_2.5.1.ds1.orig.tar.gz
grab_sourceball http://ftp.debian.org/debian/pool/main/g/grep/grep_2.5.1.ds1-2.diff.gz
