From b34da8a6fa6a3f8fff3803c62a6f6dd98deec569 Mon Sep 17 00:00:00 2001 From: vapier Date: Sun, 30 Apr 2006 15:39:09 +0000 Subject: add a sanity check to make sure localedef --help worked #131780 --- locale-gen | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/locale-gen b/locale-gen index 724db03..0623067 100755 --- a/locale-gen +++ b/locale-gen @@ -41,7 +41,7 @@ show_usage() { exit 1 } show_version() { - local cvsver="$Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/locale/locale-gen,v 1.8 2006/04/25 01:17:03 vapier Exp $" + local cvsver="$Header: /var/cvsroot/gentoo/src/patchsets/glibc/extra/locale/locale-gen,v 1.9 2006/04/30 15:39:09 vapier Exp $" cvsver=${cvsver##*locale-gen-} echo "locale-gen-${cvsver%%,v *}" exit 0 @@ -105,6 +105,11 @@ ALIAS=${DESTDIR}usr/share/locale/locale.alias # Extract the location of the locale dir on the fly as `localedef --help` has: # locale path : /usr/lib64/locale:/usr/share/i18n LOCALEDIR=${DESTDIR}$(localedef --help | sed -n -e '/locale path/{s|.* : ||;s|:.*||;p}') +if [[ $? -ne 0 ]] || [[ -z ${LOCALEDIR} ]] || [[ ${LOCALEDIR} != ${DESTDIR}/usr/lib*/locale ]] ; then + eerror "Unable to parse the output of your localedef utility." 1>&2 + eerror "File a bug about this issue and include the output of 'localedef --help'." 1>&2 + exit 1 +fi -- cgit v1.2.3