Add %_i18ndomains configuration.
CVS patchset: 3583 CVS date: 2000/02/23 22:40:53
This commit is contained in:
parent
fba7de185d
commit
ace35961e8
|
@ -1,6 +1,7 @@
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include <rpmlib.h>
|
#include <rpmlib.h>
|
||||||
|
#include <rpmmacro.h> /* XXX for %_i18ndomains */
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
static char * permsString(int mode)
|
static char * permsString(int mode)
|
||||||
|
@ -352,15 +353,16 @@ static int filenamesTag(Header h, /*@out@*/ int_32 * type,
|
||||||
|
|
||||||
/* I18N look aside diversions */
|
/* I18N look aside diversions */
|
||||||
|
|
||||||
char * i18ndomains = NULL;
|
|
||||||
|
|
||||||
int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
|
int _nl_msg_cat_cntr; /* XXX GNU gettext voodoo */
|
||||||
static const char * language = "LANGUAGE";
|
static const char * language = "LANGUAGE";
|
||||||
|
|
||||||
|
static char * _macro_i18ndomains = "%{?_i18ndomains:%{_i18ndomains}}";
|
||||||
|
|
||||||
static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
|
static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
|
||||||
/*@out@*/ const void ** data, /*@out@*/ int_32 * count,
|
/*@out@*/ const void ** data, /*@out@*/ int_32 * count,
|
||||||
/*@out@*/ int * freeData)
|
/*@out@*/ int * freeData)
|
||||||
{
|
{
|
||||||
|
char * dstring = rpmExpand(_macro_i18ndomains, NULL);
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
*type = RPM_STRING_TYPE;
|
*type = RPM_STRING_TYPE;
|
||||||
|
@ -368,8 +370,8 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
|
||||||
*count = 0;
|
*count = 0;
|
||||||
*freeData = 0;
|
*freeData = 0;
|
||||||
|
|
||||||
if (i18ndomains) {
|
if (dstring && *dstring) {
|
||||||
char * dstring, *domain, *de;
|
char *domain, *de;
|
||||||
const char * langval;
|
const char * langval;
|
||||||
const char * msgkey;
|
const char * msgkey;
|
||||||
const char * msgid;
|
const char * msgid;
|
||||||
|
@ -389,7 +391,6 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
|
||||||
++_nl_msg_cat_cntr;
|
++_nl_msg_cat_cntr;
|
||||||
|
|
||||||
msgid = NULL;
|
msgid = NULL;
|
||||||
dstring = xstrdup(i18ndomains);
|
|
||||||
for (domain = dstring; domain != NULL; domain = de) {
|
for (domain = dstring; domain != NULL; domain = de) {
|
||||||
de = strchr(domain, ':');
|
de = strchr(domain, ':');
|
||||||
if (de) *de++ = '\0';
|
if (de) *de++ = '\0';
|
||||||
|
@ -409,12 +410,14 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type,
|
||||||
*count = 1;
|
*count = 1;
|
||||||
*freeData = 1;
|
*freeData = 1;
|
||||||
}
|
}
|
||||||
xfree(dstring);
|
xfree(dstring); dstring = NULL;
|
||||||
if (*data) {
|
if (*data) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dstring) xfree(dstring);
|
||||||
|
|
||||||
rc = headerGetEntry(h, tag, type, (void **)data, count);
|
rc = headerGetEntry(h, tag, type, (void **)data, count);
|
||||||
|
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
|
|
@ -702,7 +702,6 @@ int showMatches(QVA_t *qva, rpmdb db, dbiIndexSet matches, QVF_t showPackage);
|
||||||
|
|
||||||
/*@observer@*/ const char *const tagName(int tag);
|
/*@observer@*/ const char *const tagName(int tag);
|
||||||
extern int specedit;
|
extern int specedit;
|
||||||
extern char * i18ndomains;
|
|
||||||
extern struct poptOption rpmQueryPoptTable[];
|
extern struct poptOption rpmQueryPoptTable[];
|
||||||
|
|
||||||
void rpmDisplayQueryTags(FILE * f);
|
void rpmDisplayQueryTags(FILE * f);
|
||||||
|
|
514
po/rpm.pot
514
po/rpm.pot
File diff suppressed because it is too large
Load Diff
4
rpm.c
4
rpm.c
|
@ -131,9 +131,6 @@ static struct poptOption optionsTable[] = {
|
||||||
{ "httpport", '\0', POPT_ARG_STRING, &httpPort, 0, NULL, NULL},
|
{ "httpport", '\0', POPT_ARG_STRING, &httpPort, 0, NULL, NULL},
|
||||||
{ "httpproxy", '\0', POPT_ARG_STRING, &httpProxy, 0, NULL, NULL},
|
{ "httpproxy", '\0', POPT_ARG_STRING, &httpProxy, 0, NULL, NULL},
|
||||||
{ NULL, 'i', 0, 0, 'i', NULL, NULL},
|
{ NULL, 'i', 0, 0, 'i', NULL, NULL},
|
||||||
{ "i18ndomains", '\0', POPT_ARG_STRING, &i18ndomains, 0,
|
|
||||||
N_("i18n catalogue domains to search for package text"),
|
|
||||||
"DOMAIN1[:DOMAIN2...]" },
|
|
||||||
{ "ignorearch", '\0', 0, &ignoreArch, 0, NULL, NULL},
|
{ "ignorearch", '\0', 0, &ignoreArch, 0, NULL, NULL},
|
||||||
{ "ignoreos", '\0', 0, &ignoreOs, 0, NULL, NULL},
|
{ "ignoreos", '\0', 0, &ignoreOs, 0, NULL, NULL},
|
||||||
{ "ignoresize", '\0', 0, &ignoreSize, 0, NULL, NULL},
|
{ "ignoresize", '\0', 0, &ignoreSize, 0, NULL, NULL},
|
||||||
|
@ -625,7 +622,6 @@ int main(int argc, const char ** argv)
|
||||||
/* XXX Eliminate query linkage loop */
|
/* XXX Eliminate query linkage loop */
|
||||||
parseSpecVec = parseSpec;
|
parseSpecVec = parseSpec;
|
||||||
freeSpecVec = freeSpec;
|
freeSpecVec = freeSpec;
|
||||||
i18ndomains = NULL;
|
|
||||||
|
|
||||||
/* set up the correct locale */
|
/* set up the correct locale */
|
||||||
setlocale(LC_ALL, "" );
|
setlocale(LC_ALL, "" );
|
||||||
|
|
|
@ -73,5 +73,11 @@ rpm alias -F --freshen
|
||||||
rpm alias --redhatprovides -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatprovides
|
rpm alias --redhatprovides -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatprovides
|
||||||
rpm alias --redhatrequires -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatrequires
|
rpm alias --redhatrequires -q --define '_dbpath /usr/lib/rpmdb/%{_arch}-%{_vendor}-%{_os}/redhat' --whatrequires
|
||||||
|
|
||||||
|
# colon separated i18n domains to use as PO catalogue lookaside for
|
||||||
|
* retrieving header group/description/summary.
|
||||||
|
#
|
||||||
|
# For Red Hat, value should be "redhat-dist:redhat-powertools".
|
||||||
|
rpm alias --i18ndomains --define '_i18ndomains !#:+'
|
||||||
|
|
||||||
# Build policies enabled from command line. Last policy applies.
|
# Build policies enabled from command line. Last policy applies.
|
||||||
rpm alias --buildpolicy --define '__spec_install_post @RPMCONFIGDIR@/brp-!#:+'
|
rpm alias --buildpolicy --define '__spec_install_post @RPMCONFIGDIR@/brp-!#:+'
|
||||||
|
|
Loading…
Reference in New Issue