From: jbj Date: Sun, 22 Aug 1999 04:17:12 +0000 (+0000) Subject: add %_install_langs to configure languages to be installed. X-Git-Tag: rpm-4.4-release~2679 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=279e4cc33839f46209224742fb0ce4ada6f03ec6;p=platform%2Fupstream%2Frpm.git add %_install_langs to configure languages to be installed. CVS patchset: 3245 CVS date: 1999/08/22 04:17:12 --- diff --git a/CHANGES b/CHANGES index 9dd00bc..0246fc0 100644 --- a/CHANGES +++ b/CHANGES @@ -31,6 +31,7 @@ - fix: use pgp5 rather than pgp-2.6.3 if both are in %_pgpbin (#4564). - match "de" when locale is specified as "de_DE.ISO-8859-1@Munich". - add versions to obsoletes. + - add %_install_langs to configure languages to be installed. 3.0.1 -> 3.0.2 - eliminate armv4 entries from rpmrc (Andrew E. Mileski). diff --git a/lib/transaction.c b/lib/transaction.c index 5ee6e99..284813d 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -883,8 +883,7 @@ static void skipFiles(struct fileInfo * fi, int noDocs) char ** netsharedPaths = NULL; const char ** fileLangs; const char ** languages; - const char * oneLang[2] = { NULL, NULL }; - int freeLanguages = 0; + const char *s; if (!noDocs) noDocs = rpmExpandNumeric("%{_excludedocs}"); @@ -899,15 +898,17 @@ static void skipFiles(struct fileInfo * fi, int noDocs) NULL)) fileLangs = NULL; - if ((oneLang[0] = getenv("LINGUAS"))) { - languages = (const char **) - splitString(oneLang[0], strlen(oneLang[0]), ':'); - freeLanguages = 1; - } else if ((oneLang[0] = getenv("LANG"))) { - languages = oneLang; - } else { - oneLang[0] = "en"; - languages = oneLang; + s = rpmExpand("%{_install_langs}", NULL); + if (!(s && *s != '%')) { + if (s) xfree(s); + s = NULL; + } + if (s) { + languages = (const char **) splitString(s, strlen(s), ':'); + xfree(s); + /* XXX LINGUAS/LANG is used by the installer so leave alone for now */ + } else if ((s = getenv("LINGUAS")) || (s = getenv("LANG")) || (s = "en")) { + languages = (const char **) splitString(s, strlen(s), ':'); } for (i = 0; i < fi->fc; i++) { @@ -945,15 +946,17 @@ static void skipFiles(struct fileInfo * fi, int noDocs) if (fileLangs && languages && *fileLangs[i]) { const char **lang, *l, *le; for (lang = languages; *lang; lang++) { + if (!strcmp(*lang, "all")) + break; for (l = fileLangs[i]; *l; l = le) { for (le = l; *le && *le != '|'; le++) ; if ((le-l) > 0 && !strncmp(*lang, l, (le-l))) - goto lingo; + break; if (*le == '|') le++; /* skip over | */ } + if (*l) break; } - lingo: if (*lang == NULL) { fi->actions[i] = FA_SKIPNSTATE; continue; @@ -969,7 +972,7 @@ static void skipFiles(struct fileInfo * fi, int noDocs) if (netsharedPaths) freeSplitString(netsharedPaths); if (fileLangs) free(fileLangs); - if (freeLanguages) freeSplitString((char **)languages); + if (languages) freeSplitString((char **)languages); } #define NOTIFY(_x) if (notify) notify _x diff --git a/macros.in b/macros.in index 151ad41..407d81f 100644 --- a/macros.in +++ b/macros.in @@ -1,4 +1,4 @@ -# $Id: macros.in,v 1.34 1999/08/18 16:29:53 jbj Exp $ +# $Id: macros.in,v 1.35 1999/08/22 04:17:12 jbj Exp $ #============================================================================== # Macro naming conventions (preliminary): # @@ -103,6 +103,7 @@ #%_gpg_path #%_httpport #%_httpproxy +#%_install_langs #%_langpatt #%_netsharedpath #%packager diff --git a/po/rpm.pot b/po/rpm.pot index 7ea7ec1..cedb5bf 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 1999-08-21 19:05-0400\n" +"POT-Creation-Date: 1999-08-21 23:33-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"