--- locale-gen.orig +++ locale-gen @@ -20,12 +20,6 @@ shift fi -if [ -z "$KEEP" ]; then - # Remove all old locale dir and locale-archive before generating new - # locale data. - rm -rf /usr/lib/locale/locale-archive || true -fi - umask 022 is_entry_ok() { @@ -43,12 +37,22 @@ else while [ -n "$1" ]; do if [ -f "$SUPPORTED/$1" ]; then - GENERATE="`cat $SUPPORTED/$1`" + GENERATE="$GENERATE\n`cat $SUPPORTED/$1`" + else + echo "Invalid argument: '$1' -- Operation interrupted." + echo "See the manual page via: man locale-gen" + exit 1 fi shift done fi +if [ -z "$KEEP" ]; then + # Remove all old locale dir and locale-archive before generating new + # locale data. + rm -rf /usr/lib/locale/locale-archive || true +fi + echo "Generating locales (this might take a while)..." /bin/echo -e "$GENERATE" | sort -u | while read locale charset; do \ case $locale in \#*) continue;; "") continue;; esac; \