Main scripts.
[minipack.git] / mp-get-source
blob9acf7b24fc1b4367e0138f831aa4cadcba00fd54
1 #! /bin/sh
2 . mp-functions
4 get_source()
6 do_get_source
9 do_get_source()
11 : ${source_package_type:=tar.gz}
12 : ${source:=$name-$version.$source_package_type}
14 if [ -z "$force" -a -e $sourcedir/$source ]; then
15 exit 0
18 if [ -n "$origin" ]; then
19 case $origin in
20 gnu) pkg_download="http://ftp.gnu.org/pub/gnu/$name/$source";;
21 sf) pkg_download="http://downloads.sourceforge.net/sourceforge/$name/$source";;
22 *) echo >&2 "$name: Unknown origin."; exit 1;;
23 esac
26 if [ -n "$download" ]; then
27 pkg_download=$download/$source
30 if [ -z "$pkg_download" ]; then
31 echo >&2 "$name: download location not found."
32 exit 1
35 cd $sourcedir
36 echo Downloading $name from $pkg_download ...
37 wget -c $pkg_download
40 case $1 in
41 -f|--force) force=yes; shift;;
42 -*) echo "$0: unrecognized option"; exit 1;;
43 esac
45 if [ -z "$1" ]; then
46 echo "Usage: $0 package-name ..."
47 exit 1
49 name=$1
51 . $(get_recipe_name $name)
53 get_source