2012-03-14 10:52:21 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
usage() {
|
2012-06-13 09:09:15 +02:00
|
|
|
echo "$0 version|directory"
|
2012-03-14 10:52:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
download() {
|
2012-06-13 09:09:15 +02:00
|
|
|
URL=ftp://ftp.kde.org/pub/kde/unstable/kde-telepathy/$1/src
|
|
|
|
destdir=$2
|
|
|
|
if test -n "$KDE_FULL_SESSION"; then
|
|
|
|
kioclient copy $URL $destdir
|
|
|
|
else
|
|
|
|
mkdir $destdir
|
|
|
|
lftp -c "open $URL; lcd $destdir; mget -c *"
|
|
|
|
fi
|
2012-03-14 10:52:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if [[ -d $1 ]]; then
|
2012-06-13 09:09:15 +02:00
|
|
|
directory=$1
|
|
|
|
version=$(ls $directory/* | head -n1 |
|
|
|
|
sed -e "s,$directory/[^0-9.]*\\([0-9.]\\+\\)\\.tar.*,\\1,")
|
|
|
|
echo "Version $version"
|
2012-03-14 10:52:21 +01:00
|
|
|
else
|
2012-06-13 09:09:15 +02:00
|
|
|
version=$1
|
|
|
|
directory=src-$version
|
|
|
|
download $version $directory
|
2012-03-14 10:52:21 +01:00
|
|
|
fi
|
|
|
|
|
2012-06-13 09:09:15 +02:00
|
|
|
packages=$(ls $directory/* | sed -e "s,$directory/\\(.*\\)-$version.*,\\1,")
|
2012-03-14 10:52:21 +01:00
|
|
|
echo $packages
|
|
|
|
exec >$version.nix
|
|
|
|
echo "["
|
2012-06-13 09:09:15 +02:00
|
|
|
for name in $packages; do
|
|
|
|
hash=$(nix-hash --flat --type sha256 --base32 $directory/$name-$version.*)
|
|
|
|
key=${name#ktp-}
|
|
|
|
echo "{name=\"${name}\";key=\"${key//-/_}\";sha256=\"${hash}\";}"
|
2012-03-14 10:52:21 +01:00
|
|
|
done
|
2012-06-13 09:09:15 +02:00
|
|
|
echo "]"
|