nixpkgs/pkgs/desktops/kde-4.5/l10n/l10n-manifest.sh
Eelco Dolstra a3fe61586c * Updated KDE to 4.5.5.
* Removed the KDE version number from all expressions except the
  top-level default.nix.  This makes it easier to upgrade.
* Deleted the old l10n versions since there doesn't seem to be a good
  reason to keep them around. 
* Don't use replaceChars (slow!) but do the name sanitization in
  l10n-manifest.sh.

svn path=/nixpkgs/trunk/; revision=25760
2011-02-02 13:54:35 +00:00

32 lines
734 B
Bash
Executable file

#!/bin/sh
# Usage: download kde-l10n to $dir, then run
# $0 $dir
dir=$1
if [[ ! -d "${dir}" ]]; then
echo "${dir} is not a directory (or doesn't exist)!" >&2
exit 1
fi
release=$(ls "${dir}"/kde-l10n-en_GB-*.tar.bz2 | \
sed -e 's/.*en_GB-//' -e 's/\.tar\.bz2//')
echo "Detected release ${release}" >&2
exec > "manifest-${release}.nix"
echo "["
for i in `cd "${dir}"; ls kde-l10n-*-${release}.tar.bz2`; do
lang=${i%-${release}.tar.bz2}
lang=${lang#kde-l10n-}
echo -n "${lang}.. " >&2
hash=$(nix-hash --type sha256 --flat --base32 "${dir}/${i}")
echo "{"
echo " lang = \"${lang}\";"
echo " saneName = \"$(echo $lang | sed s^@^_^g)\";"
echo " sha256 = \"${hash}\";"
echo "}"
echo $hash >&2
done
echo "]"