From 1789e527a99462a11641ed9e4b3b6f7c6cef0ff0 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 21 Nov 2014 09:51:57 +0100 Subject: [PATCH] Gratuitous ABI break: xbps_binpkg_get_xxx() -> xbps_archive_fetch_xxx(). --- bin/xbps-query/ownedby.c | 2 +- bin/xbps-query/show-info-files.c | 2 +- bin/xbps-rindex/index-add.c | 2 +- include/xbps.h.in | 14 +++++++------- lib/plist_fetch.c | 8 ++++---- lib/repo.c | 2 +- lib/rpool.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/bin/xbps-query/ownedby.c b/bin/xbps-query/ownedby.c index 9395daff..0def81a0 100644 --- a/bin/xbps-query/ownedby.c +++ b/bin/xbps-query/ownedby.c @@ -136,7 +136,7 @@ repo_match_cb(struct xbps_handle *xhp, bfile = xbps_repository_pkg_path(xhp, obj); assert(bfile); - filesd = xbps_binpkg_get_plist(bfile, "/files.plist"); + filesd = xbps_archive_fetch_plist(bfile, "/files.plist"); if (filesd == NULL) { xbps_dbg_printf(xhp, "%s: couldn't fetch files.plist from %s: %s\n", pkgver, bfile, strerror(errno)); diff --git a/bin/xbps-query/show-info-files.c b/bin/xbps-query/show-info-files.c index 4875bc92..6f94ec5d 100644 --- a/bin/xbps-query/show-info-files.c +++ b/bin/xbps-query/show-info-files.c @@ -323,7 +323,7 @@ repo_cat_file(struct xbps_handle *xhp, const char *pkg, const char *file) return EINVAL; xbps_dbg_printf(xhp, "matched pkg at %s\n", url); - rv = xbps_binpkg_get_file_into_fd(url, file, STDOUT_FILENO); + rv = xbps_archive_fetch_file_into_fd(url, file, STDOUT_FILENO); free(url); return rv; } diff --git a/bin/xbps-rindex/index-add.c b/bin/xbps-rindex/index-add.c index 3289b7ad..2ceff4dc 100644 --- a/bin/xbps-rindex/index-add.c +++ b/bin/xbps-rindex/index-add.c @@ -80,7 +80,7 @@ index_add(struct xbps_handle *xhp, int args, int argmax, char **argv, bool force /* * Read metadata props plist dictionary from binary package. */ - binpkgd = xbps_binpkg_get_plist(pkg, "/props.plist"); + binpkgd = xbps_archive_fetch_plist(pkg, "/props.plist"); if (binpkgd == NULL) { fprintf(stderr, "index: failed to read %s metadata for " "`%s', skipping!\n", XBPS_PKGPROPS, pkg); diff --git a/include/xbps.h.in b/include/xbps.h.in index a0b51557..95acdbe2 100644 --- a/include/xbps.h.in +++ b/include/xbps.h.in @@ -48,7 +48,7 @@ * * This header documents the full API for the XBPS Library. */ -#define XBPS_API_VERSION "20141120" +#define XBPS_API_VERSION "20141121" #ifndef XBPS_VERSION #define XBPS_VERSION "UNSET" @@ -1145,7 +1145,7 @@ int xbps_transaction_commit(struct xbps_handle *xhp); /*@{*/ /** - * Returns a buffer of a file stored in a binary package locally or + * Returns a buffer of a file stored in an archive locally or * remotely as specified in the url \a url. * * @param[in] url Full URL to binary package file (local or remote path). @@ -1154,10 +1154,10 @@ int xbps_transaction_commit(struct xbps_handle *xhp); * @return A malloc(3)ed buffer with the contents of \a fname, NULL otherwise * and errno is set appropiately. */ -char *xbps_binpkg_get_file(const char *url, const char *fname); +char *xbps_archive_fetch_file(const char *url, const char *fname); /** - * Returns a file stored in a binary package locally or + * Returns a file stored in an archive locally or * remotely as specified in the url \a url and stores it into the * file descriptor \a fd. * @@ -1167,10 +1167,10 @@ char *xbps_binpkg_get_file(const char *url, const char *fname); * * @return 0 on success, an errno value otherwise. */ -int xbps_binpkg_get_file_into_fd(const char *url, const char *fname, int fd); +int xbps_archive_fetch_file_into_fd(const char *url, const char *fname, int fd); /** - * Internalizes a plist file in a binary package file stored locally or + * Internalizes a plist file in an archive stored locally or * remotely as specified in the url \a url. * * @param[in] url Full URL to binary package file (local or remote path). @@ -1179,7 +1179,7 @@ int xbps_binpkg_get_file_into_fd(const char *url, const char *fname, int fd); * @return An internalized proplib dictionary, otherwise NULL and * errno is set appropiately. */ -xbps_dictionary_t xbps_binpkg_get_plist(const char *url, const char *p); +xbps_dictionary_t xbps_archive_fetch_plist(const char *url, const char *p); /*@}*/ diff --git a/lib/plist_fetch.c b/lib/plist_fetch.c index 7dd13075..3cb231c7 100644 --- a/lib/plist_fetch.c +++ b/lib/plist_fetch.c @@ -140,7 +140,7 @@ open_archive(const char *url) } char * -xbps_binpkg_get_file(const char *url, const char *fname) +xbps_archive_fetch_file(const char *url, const char *fname) { struct archive *a; struct archive_entry *entry; @@ -169,7 +169,7 @@ xbps_binpkg_get_file(const char *url, const char *fname) } int -xbps_binpkg_get_file_into_fd(const char *url, const char *fname, int fd) +xbps_archive_fetch_file_into_fd(const char *url, const char *fname, int fd) { struct archive *a; struct archive_entry *entry; @@ -202,12 +202,12 @@ xbps_binpkg_get_file_into_fd(const char *url, const char *fname, int fd) } xbps_dictionary_t -xbps_binpkg_get_plist(const char *url, const char *plistf) +xbps_archive_fetch_plist(const char *url, const char *plistf) { xbps_dictionary_t d; char *buf; - if ((buf = xbps_binpkg_get_file(url, plistf)) == NULL) + if ((buf = xbps_archive_fetch_file(url, plistf)) == NULL) return NULL; d = xbps_dictionary_internalize(buf); diff --git a/lib/repo.c b/lib/repo.c index 855de1dd..93ed732d 100644 --- a/lib/repo.c +++ b/lib/repo.c @@ -277,7 +277,7 @@ xbps_repo_get_pkg_plist(struct xbps_handle *xhp, xbps_dictionary_t pkgd, if (url == NULL) return NULL; - bpkgd = xbps_binpkg_get_plist(url, plist); + bpkgd = xbps_archive_fetch_plist(url, plist); free(url); return bpkgd; } diff --git a/lib/rpool.c b/lib/rpool.c index 566d71e5..e73ac2f2 100644 --- a/lib/rpool.c +++ b/lib/rpool.c @@ -321,7 +321,7 @@ xbps_rpool_get_pkg_plist(struct xbps_handle *xhp, errno = EINVAL; goto out; } - plistd = xbps_binpkg_get_plist(url, plistf); + plistd = xbps_archive_fetch_plist(url, plistf); free(url); out: