It's important that mediafile doesn't contain the directory part.
authorMichael Matz <matz@suse.de>
Thu, 21 Feb 2008 15:24:25 +0000 (15:24 +0000)
committerMichael Matz <matz@suse.de>
Thu, 21 Feb 2008 15:24:25 +0000 (15:24 +0000)
tools/repo_rpmmd.c

index fc90a04..e38a42a 100644 (file)
@@ -608,7 +608,19 @@ startElement(void *userData, const char *name, const char **atts)
     case STATE_LOCATION:
       str = find_attr("href", atts);
       if (str)
-        repodata_set_str(pd->data, entry, id_mediafile, str);
+       {
+         const char *str2 = strrchr(str, '/');
+         if (str2)
+           {
+             char *str3 = strdup (str);
+             str3[str2 - str] = 0;
+             repodata_set_poolstr(pd->data, entry, id_mediadir, str3);
+             free(str3);
+              repodata_set_str(pd->data, entry, id_mediafile, str2 + 1);
+           }
+         else
+            repodata_set_str(pd->data, entry, id_mediafile, str);
+       }
       break;
     case STATE_CHECKSUM:
       pd->tmpattr = find_attr("type", atts);