summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.h
diff options
context:
space:
mode:
authorAnatol Pomozov <anatol.pomozov@gmail.com>2020-04-19 11:12:01 +0200
committerAllan McRae <allan@archlinux.org>2020-06-26 07:59:08 +0200
commit16d98d657748fdbf32ab24db56d3cd4a23447673 (patch)
treeee8398b06af9c96afa68fd8d6ac3aeb6d712c6f6 /lib/libalpm/alpm.h
parent59e751f72d09390067045168ac45a09a89419389 (diff)
downloadpacman-16d98d657748fdbf32ab24db56d3cd4a23447673.tar.gz
pacman-16d98d657748fdbf32ab24db56d3cd4a23447673.tar.xz
Convert '-U pkg1 pkg2' codepath to parallel download
Installing remote packages using its URL is an interesting case for ALPM API. Unlike package sync ('pacman -S pkg1 pkg2') '-U' does not deal with server mirror list. Thus _alpm_multi_download() should be able to handle file download for payloads that either have 'fileurl' field or pair of fields ('servers' and 'filepath') set. Signature for alpm_fetch_pkgurl() has changed and it accepts an output list that is populated with filepaths to fetched packages. Signed-off-by: Anatol Pomozov <anatol.pomozov@gmail.com>
Diffstat (limited to 'lib/libalpm/alpm.h')
-rw-r--r--lib/libalpm/alpm.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 3ea66ccc..977c292c 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -755,12 +755,17 @@ typedef void (*alpm_cb_totaldl)(off_t total);
typedef int (*alpm_cb_fetch)(const char *url, const char *localpath,
int force);
-/** Fetch a remote pkg.
+/** Fetch a list of remote packages.
* @param handle the context handle
- * @param url URL of the package to download
- * @return the downloaded filepath on success, NULL on error
- */
-char *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url);
+ * @param urls list of package URLs to download
+ * @param fetched list of filepaths to the fetched packages, each item
+ * corresponds to one in `urls` list. This is an output parameter,
+ * the caller should provide a pointer to an empty list
+ * (*fetched === NULL) and the callee fills the list with data.
+ * @return 0 on success or -1 on failure
+ */
+int alpm_fetch_pkgurl(alpm_handle_t *handle, const alpm_list_t *urls,
+ alpm_list_t **fetched);
/** @addtogroup alpm_api_options Options
* Libalpm option getters and setters