summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-11-21 13:56:26 +0100
committerMichael Schroeder <mls@suse.de>2013-11-21 13:56:26 +0100
commit4442b7f5c068328cf0e8c50e7859dd152960cfce (patch)
tree0b0bb4174bd89574f4cda6c39bb3119d9c17d615
parentc5b168f73b0add8cc66ada72f2e4be25b2fb33ed (diff)
downloadlibsolv-4442b7f5c068328cf0e8c50e7859dd152960cfce.tar.gz
libsolv-4442b7f5c068328cf0e8c50e7859dd152960cfce.tar.bz2
libsolv-4442b7f5c068328cf0e8c50e7859dd152960cfce.zip
support DELTA_LOCATION_BASE for completeness...
-rw-r--r--ext/repo_deltainfoxml.c12
-rw-r--r--src/knownid.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/repo_deltainfoxml.c b/ext/repo_deltainfoxml.c
index 69403e8..06df1a3 100644
--- a/ext/repo_deltainfoxml.c
+++ b/ext/repo_deltainfoxml.c
@@ -78,6 +78,7 @@ static struct stateswitch stateswitches[] = {
/* Cumulated info about the current deltarpm or patchrpm */
struct deltarpm {
char *location;
+ char *locbase;
unsigned int buildtime;
unsigned long long downloadsize;
char *filechecksum;
@@ -259,9 +260,13 @@ startElement(void *userData, const char *name, const char **atts)
pd->delta.bevr[pd->delta.nbevr++] = makeevr_atts(pool, pd, atts);
break;
case STATE_FILENAME:
+ if ((str = find_attr("xml:base", atts)))
+ pd->delta.locbase = solv_strdup(str);
break;
case STATE_LOCATION:
pd->delta.location = solv_strdup(find_attr("href", atts));
+ if ((str = find_attr("xml:base", atts)))
+ pd->delta.locbase = solv_strdup(str);
break;
case STATE_SIZE:
break;
@@ -325,7 +330,11 @@ endElement(void *userData, const char *name)
repodata_set_id(pd->data, handle, DELTA_PACKAGE_EVR, pd->newpkgevr);
repodata_set_id(pd->data, handle, DELTA_PACKAGE_ARCH, pd->newpkgarch);
if (d->location)
- repodata_set_deltalocation(pd->data, handle, 0, 0, d->location);
+ {
+ repodata_set_deltalocation(pd->data, handle, 0, 0, d->location);
+ if (d->locbase)
+ repodata_set_poolstr(pd->data, handle, DELTA_LOCATION_BASE, d->locbase);
+ }
if (d->downloadsize)
repodata_set_num(pd->data, handle, DELTA_DOWNLOADSIZE, d->downloadsize);
if (d->filechecksum)
@@ -344,6 +353,7 @@ endElement(void *userData, const char *name)
pd->delta.nbevr = 0;
pd->delta.seqnum = solv_free(pd->delta.seqnum);
pd->delta.location = solv_free(pd->delta.location);
+ pd->delta.locbase = solv_free(pd->delta.locbase);
break;
case STATE_FILENAME:
pd->delta.location = solv_strdup(pd->content);
diff --git a/src/knownid.h b/src/knownid.h
index e7d8ad5..d8a5e51 100644
--- a/src/knownid.h
+++ b/src/knownid.h
@@ -258,6 +258,8 @@ KNOWNID(SIGNATURE_DATA, "signature:data"),
KNOWNID(PUBKEY_SUBKEYOF, "pubkey:subkeyof"),
+KNOWNID(DELTA_LOCATION_BASE, "delta:locbase"), /* <location xml:base=... > */
+
KNOWNID(ID_NUM_INTERNAL, 0)
#ifdef KNOWNID_INITIALIZE