ndle new-fangled empty tags.

CVS patchset: 7328
CVS date: 2004/06/14 18:01:25
This commit is contained in:
jbj 2004-06-14 18:01:25 +00:00
parent 43c795b188
commit 62599080b8
3 changed files with 90 additions and 55 deletions

View File

@ -39,6 +39,41 @@ static rpmtoolIOBits obits = RPMIOBITS_NONE;
static int _rpmtool_debug = 0;
typedef struct rpmavi_s * rpmavi;
struct rpmavi_s {
const char ** av;
int flags;
};
static rpmavi rpmaviFree(rpmavi avi)
{
if (avi) {
memset(avi, 0, sizeof(*avi));
avi = _free(avi);
}
return NULL;
}
static rpmavi rpmaviNew(const char ** av, int flags)
{
rpmavi avi = xcalloc(1, sizeof(*avi));
if (avi) {
avi->av = av;
avi->flags = flags;
}
return avi;
}
static const char * rpmaviNext(rpmavi avi)
{
const char * a = NULL;
if (avi && avi->av && *avi->av)
a = *avi->av++;
return a;
}
static struct iobits_s {
const char * name;
rpmtoolIOBits bits;
@ -157,37 +192,30 @@ static void initTool(const char * argv0)
if (!strcmp(__progname, "rpmlead")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_LEAD;
ofmt = NULL;
}
if (!strcmp(__progname, "rpmsignature")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_SHEADER;
ofmt = NULL;
}
if (!strcmp(__progname, "rpmheader")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_HEADER;
ofmt = NULL;
}
if (!strcmp(__progname, "rpm2cpio")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_PAYLOAD | RPMIOBITS_UNCOMPRESS;
ofmt = NULL;
}
if (!strcmp(__progname, "rpmarchive")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_PAYLOAD;
ofmt = NULL;
}
if (!strcmp(__progname, "dump")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_HEADER | RPMIOBITS_DUMP;
ofmt = NULL;
}
if (!strcmp(__progname, "rpmdump")) {
ibits = _RPMIOBITS_PKGMASK;
obits = RPMIOBITS_HEADER | RPMIOBITS_DUMP;
ofmt = NULL;
}
}
@ -200,6 +228,7 @@ main(int argc, char *const argv[])
FD_t fdi = NULL;
FD_t fdo = NULL;
const char ** av = NULL;
rpmavi avi = NULL;
const char * ifn = NULL;
const char * ofn = NULL;
const char * s;
@ -244,7 +273,8 @@ fprintf(stderr, "*** av %p av[0] %p av[1] %p\n", av,
goto bottom;
}
while ((ifn = *av++) != NULL) {
avi = rpmaviNew(av, 0);
while ((ifn = rpmaviNext(avi)) != NULL) {
/* Open input file. */
if (fdi == NULL) {
@ -421,6 +451,7 @@ bottom:
fdo = NULL;
}
}
avi = rpmaviFree(avi);
exit:
sigh = headerFree(sigh);

View File

@ -94,9 +94,13 @@ printf("%d %d %s %d\n", xp->depth, xp->nodeType, xp->name, xp->isEmptyElement);
}
xmlFree(attrN);
}
printf(">");
if (xp->depth < 2)
printf("\n");
if (xp->isEmptyElement)
printf("/>\n");
else {
printf(">");
if (xp->depth < 2)
printf("\n");
}
break;
case XML_READER_TYPE_END_ELEMENT:
if (xp->depth < 2)

View File

@ -74,11 +74,11 @@ fi</string>
<integer>33188</integer>
</rpmTag>
<rpmTag name="Filerdevs">
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer/>
<integer/>
<integer/>
</rpmTag>
<rpmTag name="Filemtimes">
<integer>1081809659</integer>
@ -89,21 +89,21 @@ fi</string>
</rpmTag>
<rpmTag name="Filemd5s">
<string>a811f210128c11dddbbbe069fe6df5d2</string>
<string></string>
<string/>
<string>0ad5e82cfb2ac82b2bfc3bb998150ed6</string>
<string>44e9fc77c32600526ed39343511914a1</string>
<string>b0f6f713c3249dc4f31a6715dc893d44</string>
</rpmTag>
<rpmTag name="Filelinktos">
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string/>
<string/>
<string/>
<string/>
<string/>
</rpmTag>
<rpmTag name="Fileflags">
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer>2</integer>
<integer>2</integer>
<integer>2</integer>
@ -127,9 +127,9 @@ fi</string>
</rpmTag>
<rpmTag name="Fileverifyflags">
<integer>4294967295</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer/>
<integer>4294967295</integer>
</rpmTag>
<rpmTag name="Providename">
@ -156,12 +156,12 @@ fi</string>
<string>rpmlib(PayloadFilesHavePrefix)</string>
</rpmTag>
<rpmTag name="Requireversion">
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string/>
<string/>
<string/>
<string/>
<string/>
<string/>
<string>3.0.4-1</string>
<string>4.0-1</string>
</rpmTag>
@ -257,11 +257,11 @@ instead.</string>
<integer>4194947</integer>
</rpmTag>
<rpmTag name="Filelangs">
<string></string>
<string></string>
<string></string>
<string></string>
<string></string>
<string/>
<string/>
<string/>
<string/>
<string/>
</rpmTag>
<rpmTag name="Prefixes">
<string>/usr</string>
@ -273,7 +273,7 @@ instead.</string>
<string>1.7-22</string>
</rpmTag>
<rpmTag name="Dirindexes">
<integer>0</integer>
<integer/>
<integer>1</integer>
<integer>2</integer>
<integer>2</integer>
@ -312,37 +312,37 @@ instead.</string>
</rpmTag>
<rpmTag name="Filecolors">
<integer>1</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer/>
<integer/>
</rpmTag>
<rpmTag name="Fileclass">
<integer>2</integer>
<integer>3</integer>
<integer>1</integer>
<integer>1</integer>
<integer>0</integer>
<integer/>
</rpmTag>
<rpmTag name="Classdict">
<string></string>
<string/>
<string>ASCII English text</string>
<string>ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped</string>
<string>directory</string>
</rpmTag>
<rpmTag name="Filedependsx">
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer/>
<integer/>
<integer/>
</rpmTag>
<rpmTag name="Filedependsn">
<integer>3</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer>0</integer>
<integer/>
<integer/>
<integer/>
<integer/>
</rpmTag>
<rpmTag name="Dependsdict">
<integer>1375731715</integer>
@ -350,7 +350,7 @@ instead.</string>
<integer>1375731717</integer>
</rpmTag>
<rpmTag name="Sourcepkgid">
<base64>8vaKpUrEkvma6oCg0Z/otm==</base64>
<base64>8vaKpUrEkvma6oCg0Z/oti==</base64>
</rpmTag>
<rpmTag name="Filecontexts">
<string>system_u:object_r:bin_t</string>