summaryrefslogtreecommitdiffstats
path: root/fetch-sources.sh
blob: aead3a8a351573c5a162af32b83ea5dd00c20d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#/bin/sh

EGG_NAME="silex"

if ! [ -x "$(command -v chicken-install)" ]; then
  echo 'Error: chicken-install is not installed.' >&2
  exit 1
fi

# Download source files
/usr/bin/chicken-install -r $EGG_NAME

# Build an archive from the source files
version=$(cat $EGG_NAME/$EGG_NAME.setup | egrep -o '([0-9]+.[0-9]+)')
mv $EGG_NAME chicken-$EGG_NAME-$version
/usr/bin/tar -cvzf chicken-$EGG_NAME-$version.tar.gz chicken-$EGG_NAME-$version

# Clean the downloaded file
rm -r chicken-$EGG_NAME-$version