From 67b314273adc4668b3bd19eeece7408d8bc2bf08 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 21 Feb 2008 15:24:25 +0000 Subject: [PATCH] It's important that mediafile doesn't contain the directory part. --- tools/repo_rpmmd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/repo_rpmmd.c b/tools/repo_rpmmd.c index fc90a04..e38a42a 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); -- 2.7.4