From efefa000b29e3519f83c28b07dcf6f46ca733808 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 5 Jun 2012 20:53:15 +0200 Subject: [PATCH] xbps_dictionary_metadata_plist_by_url: only accept exact matches. --- bin/xbps-repo/index-files.c | 2 +- bin/xbps-repo/index.c | 2 +- bin/xbps-repo/main.c | 3 ++- include/xbps_api.h | 2 +- lib/plist_fetch.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/xbps-repo/index-files.c b/bin/xbps-repo/index-files.c index bf3dd053..b3b340e1 100644 --- a/bin/xbps-repo/index-files.c +++ b/bin/xbps-repo/index-files.c @@ -98,7 +98,7 @@ genindex_files_cb(prop_object_t obj, void *arg, bool *done) return ENOMEM; /* internalize files.plist from binary package archive */ - pkg_filesd = xbps_dictionary_metadata_plist_by_url(file, XBPS_PKGFILES); + pkg_filesd = xbps_dictionary_metadata_plist_by_url(file, "./files.plist"); if (pkg_filesd == NULL) { free(file); return EINVAL; diff --git a/bin/xbps-repo/index.c b/bin/xbps-repo/index.c index 4853173b..13e784af 100644 --- a/bin/xbps-repo/index.c +++ b/bin/xbps-repo/index.c @@ -150,7 +150,7 @@ add_binpkg_to_index(prop_array_t idx, goto out; } - newpkgd = xbps_dictionary_metadata_plist_by_url(file, XBPS_PKGPROPS); + newpkgd = xbps_dictionary_metadata_plist_by_url(file, "./props.plist"); if (newpkgd == NULL) { xbps_error_printf("failed to read %s metadata for `%s'," " skipping!\n", XBPS_PKGPROPS, file); diff --git a/bin/xbps-repo/main.c b/bin/xbps-repo/main.c index 2514d5b6..2212e6e0 100644 --- a/bin/xbps-repo/main.c +++ b/bin/xbps-repo/main.c @@ -232,7 +232,8 @@ main(int argc, char **argv) if (argc != 2) usage(true); - pkgd = xbps_rpool_dictionary_metadata_plist(argv[1], XBPS_PKGFILES); + pkgd = xbps_rpool_dictionary_metadata_plist(argv[1], + "./files.plist"); if (pkgd == NULL) { if (errno == ENOTSUP) { xbps_error_printf("xbps-repo: no repositories " diff --git a/include/xbps_api.h b/include/xbps_api.h index d09d9ce0..4ff2425e 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -56,7 +56,7 @@ */ #define XBPS_PKGINDEX_VERSION "1.5" -#define XBPS_API_VERSION "20120605-1" +#define XBPS_API_VERSION "20120605-2" #define XBPS_VERSION "0.16" /** diff --git a/lib/plist_fetch.c b/lib/plist_fetch.c index 567f4cf3..d6e94260 100644 --- a/lib/plist_fetch.c +++ b/lib/plist_fetch.c @@ -175,7 +175,7 @@ xbps_dictionary_metadata_plist_by_url(const char *url, const char *plistf) while ((archive_read_next_header(a, &entry)) == ARCHIVE_OK) { curpath = archive_entry_pathname(entry); - if (strstr(curpath, plistf) == 0) { + if (strcmp(curpath, plistf)) { archive_read_data_skip(a); if (i >= 3) { /*