Browse Source

We now check dem sums

master
mid-kid 10 years ago
parent
commit
9bbbcbcaea
  1. 10
      astronaut
  2. 3
      hello.sat

10
astronaut

@ -54,9 +54,13 @@ msg() {
download() { download() {
local name=$(basename "$1") local name=$(basename "$1")
local path="$dir_source/$name" local path="$dir_source/$name"
if [ ! -f "$path" ]; then local checksum=""
if [ "$2" -a -f "$path" ]; then
checksum="$(md5sum ""$path"" 2> /dev/null | cut -d' ' -f1)"
fi
if [ ! -f "$path" -o "$checksum" != "$2" ]; then
msg "Downloading $name" msg "Downloading $name"
if [ "$2" ]; then if [ "$3" ]; then
local cmd="$(echo "$2" | sed -e 's@{dst}@'"$path"'@g' -e 's@{source}@'"$1"'@g')" local cmd="$(echo "$2" | sed -e 's@{dst}@'"$path"'@g' -e 's@{source}@'"$1"'@g')"
$cmd $cmd
else else
@ -76,7 +80,7 @@ extract() {
} }
dlextract() { dlextract() {
download "$1" download "$1" "$2"
extract "$(basename ""$1"")" extract "$(basename ""$1"")"
} }

3
hello.sat

@ -3,7 +3,8 @@
name=hello name=hello
version=2.9 version=2.9
dlextract "http://ftp.gnu.org/pub/gnu/$name/$name-$version.tar.gz" dlextract "http://ftp.gnu.org/pub/gnu/$name/$name-$version.tar.gz" \
"67607d2616a0faaf5bc94c59dca7c3cb"
cd "$name-$version" cd "$name-$version"
./configure ./configure

Loading…
Cancel
Save