From: Michael Matz Date: Thu, 21 Feb 2008 15:24:25 +0000 (+0000) Subject: It's important that mediafile doesn't contain the directory part. X-Git-Tag: BASE-SuSE-Code-12_1-Branch~308^2~565 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67b314273adc4668b3bd19eeece7408d8bc2bf08;p=thirdparty%2Flibsolv.git It's important that mediafile doesn't contain the directory part. --- diff --git a/tools/repo_rpmmd.c b/tools/repo_rpmmd.c index fc90a048..e38a42ad 100644 --- a/tools/repo_rpmmd.c +++ b/tools/repo_rpmmd.c @@ -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);