Add HEADERGET_RAW flag to disable i18n lookups
This commit is contained in:
parent
89b8f53621
commit
7fedc20570
22
lib/header.c
22
lib/header.c
|
@ -1359,16 +1359,20 @@ static int intGetTdEntry(Header h, rpmTag tag, rpmtd td, headerGetFlags flags)
|
|||
return 0;
|
||||
}
|
||||
|
||||
switch (entry->info.type) {
|
||||
case RPM_I18NSTRING_TYPE:
|
||||
rc = 1;
|
||||
td->type = RPM_STRING_TYPE;
|
||||
td->count = 1;
|
||||
td->data = headerFindI18NString(h, entry);
|
||||
break;
|
||||
default:
|
||||
if (flags & HEADERGET_RAW) {
|
||||
rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM));
|
||||
break;
|
||||
} else {
|
||||
switch (entry->info.type) {
|
||||
case RPM_I18NSTRING_TYPE:
|
||||
rc = 1;
|
||||
td->type = RPM_STRING_TYPE;
|
||||
td->count = 1;
|
||||
td->data = headerFindI18NString(h, entry);
|
||||
break;
|
||||
default:
|
||||
rc = copyTdEntry(entry, td, (flags & HEADERGET_MINMEM));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* XXX 1 on success */
|
||||
|
|
|
@ -183,6 +183,7 @@ typedef enum headerGetFlags_e {
|
|||
HEADERGET_DEFAULT = 0,
|
||||
HEADERGET_MINMEM = (1 << 0), /* string pointers refer to header memory */
|
||||
HEADERGET_EXT = (1 << 1), /* lookup extension types too */
|
||||
HEADERGET_RAW = (1 << 2), /* return raw contents (no i18n lookups) */
|
||||
} headerGetFlags;
|
||||
|
||||
/** \ingroup header
|
||||
|
|
Loading…
Reference in New Issue