summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-06-14 18:01:25 +0000
committerjbj <devnull@localhost>2004-06-14 18:01:25 +0000
commit62599080b8e340816154b63801e026d32032378b (patch)
treeba74794d39bff516e045873b787459a30d57cd20 /tools
parent43c795b188af63fd2e98d6cb135f932e7d2ee6ed (diff)
downloadrpm-62599080b8e340816154b63801e026d32032378b.tar.gz
rpm-62599080b8e340816154b63801e026d32032378b.tar.bz2
rpm-62599080b8e340816154b63801e026d32032378b.zip
ndle new-fangled empty tags.
CVS patchset: 7328 CVS date: 2004/06/14 18:01:25
Diffstat (limited to 'tools')
-rw-r--r--tools/rpmtool.c47
-rw-r--r--tools/rpmxp.c10
-rw-r--r--tools/time.xml88
3 files changed, 90 insertions, 55 deletions
diff --git a/tools/rpmtool.c b/tools/rpmtool.c
index 6621ffa84..af95fbedc 100644
--- a/tools/rpmtool.c
+++ b/tools/rpmtool.c
@@ -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);
diff --git a/tools/rpmxp.c b/tools/rpmxp.c
index ab5fde99d..1755c2310 100644
--- a/tools/rpmxp.c
+++ b/tools/rpmxp.c
@@ -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)
diff --git a/tools/time.xml b/tools/time.xml
index 4fde1b1f3..f565c3a52 100644
--- a/tools/time.xml
+++ b/tools/time.xml
@@ -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>