- added delta target package evra parsing
authorJan Kupec <jkupec@suse.cz>
Mon, 19 May 2008 17:53:52 +0000 (17:53 +0000)
committerJan Kupec <jkupec@suse.cz>
Mon, 19 May 2008 17:53:52 +0000 (17:53 +0000)
src/knownid.h
tools/repo_deltainfoxml.c

index 59f4c23..06bb435 100644 (file)
@@ -149,6 +149,8 @@ KNOWNID(PRODUCT_FLAGS,                      "product:flags"),
 KNOWNID(SUSETAGS_DATADIR,              "susetags:datadir"),
 
 KNOWNID(DELTA_PACKAGE_NAME,            "delta:pkgname"),
+KNOWNID(DELTA_PACKAGE_EVR,              "delta:pkgevr"),
+KNOWNID(DELTA_PACKAGE_ARCH,             "delta:pkgarch"),
 KNOWNID(DELTA_LOCATION_DIR,            "delta:locdir"),
 KNOWNID(DELTA_LOCATION_NAME,           "delta:locname"),
 KNOWNID(DELTA_LOCATION_EVR,            "delta:locevr"),
index 001ce28..b14bb9a 100644 (file)
@@ -116,6 +116,7 @@ struct parsedata {
   struct deltarpm delta;
   Id newpkgevr;
   Id newpkgname;
+  Id newpkgarch;
 };
 
 /*
@@ -313,11 +314,16 @@ startElement(void *userData, const char *name, const char **atts)
           break;
       case STATE_NEWPACKAGE:
           if ( (str = find_attr("name", atts)) )
-          {
+            {
               pd->newpkgname = str2id(pool, str, 1);
-          }
+            }
+          pd->newpkgevr = makeevr_atts(pool, pd, atts);
+          if ( (str = find_attr("arch", atts)) )
+            {
+              pd->newpkgarch = str2id(pool, str, 1);
+            }
           break;
-          
+
       case STATE_DELTA:
           memset(&pd->delta, 0, sizeof (pd->delta));
           *pd->tempstr = 0;
@@ -386,6 +392,8 @@ endElement(void *userData, const char *name)
           fprintf (stderr, "found deltarpm for %s:\n", id2str(pool, pd->newpkgname));
 #endif
           repo_set_id(pd->repo, pd->datanum, DELTA_PACKAGE_NAME, pd->newpkgname);
+          repo_set_id(pd->repo, pd->datanum, DELTA_PACKAGE_EVR, pd->newpkgevr);
+          repo_set_id(pd->repo, pd->datanum, DELTA_PACKAGE_ARCH, pd->newpkgarch);
           repo_set_id(pd->repo, pd->datanum, DELTA_LOCATION_NAME, d->locname);
           repo_set_id(pd->repo, pd->datanum, DELTA_LOCATION_DIR, d->locdir);
           repo_set_id(pd->repo, pd->datanum, DELTA_LOCATION_EVR, d->locevr);