#!/bin/sh

# (c) 2001-2003 Piotr Roszatycki <dexter@debian.org> GPL

# This utility fetch original source

set -e

if [ -f ../debian/changelog ]; then
    cd ..
elif [ ! -f debian/changelog ]; then
    echo "can't find changelog file"
    exit 1
fi

SRCNAME=apache2

srcversion=`head -n 1 debian/changelog | sed -e 's/.*(//' -e 's/-[^-]*).*//'`

cd ..

echo "N: Fetching source package..."

apt-get source -d $SRCNAME=$srcversion

echo "N: Done."
