2009-08-26 16:22:20 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && {
|
|
|
|
echo "Use $0 expression-basename download-page package-base-name"
|
|
|
|
echo "Like:"
|
|
|
|
echo "$0 default http://example.com/downloads hello"
|
|
|
|
exit 1;
|
|
|
|
} >&2
|
|
|
|
|
|
|
|
own_dir="$(cd "$(dirname "$0")"; sh -c pwd)"
|
|
|
|
|
2010-06-23 04:50:03 +00:00
|
|
|
cp "$own_dir/../builder-defs/template-auto-callable.nix" "$1.nix"
|
2009-08-26 16:22:20 +00:00
|
|
|
sed -e "s@src-for-default.nix@src-for-$1.nix@g" -i "$1.nix"
|
|
|
|
echo '{}' > "src-for-$1.nix"
|
|
|
|
cat << EOF > src-info-for-$1.nix
|
|
|
|
{
|
|
|
|
downloadPage = "$2";
|
|
|
|
baseName = "$3";
|
|
|
|
}
|
|
|
|
EOF
|