Introduce struct xbps_handle and use it for xbps_init().
This structure sets up function callbacks for fetching files and unpacking binary packages, as well as setting the debug boolean. This way the affected functions (xbps_fetch_file() and xbps_unpack_binary_pkg()) do not need to accept the fn cb pointers and data as arguments. Bump XBPS_RELVER.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*-
|
||||
* Copyright (c) 2009 Juan Romero Pardines.
|
||||
* Copyright (c) 2009-2011 Juan Romero Pardines.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -82,9 +82,7 @@ xbps_get_remote_repo_string(const char *uri)
|
||||
* size and/or mtime match) and 1 if downloaded successfully.
|
||||
*/
|
||||
int
|
||||
xbps_repository_sync_pkg_index(const char *uri,
|
||||
void (*progress_cb)(void *),
|
||||
struct xbps_fetch_progress_data *xfpd)
|
||||
xbps_repository_sync_pkg_index(const char *uri)
|
||||
{
|
||||
struct url *url = NULL;
|
||||
struct utsname un;
|
||||
@ -163,8 +161,7 @@ xbps_repository_sync_pkg_index(const char *uri,
|
||||
/*
|
||||
* Download pkg-index.plist file from repository.
|
||||
*/
|
||||
rv = xbps_fetch_file(rpidx, fetch_outputdir, true, NULL,
|
||||
progress_cb, xfpd);
|
||||
rv = xbps_fetch_file(rpidx, fetch_outputdir, true, NULL);
|
||||
if (rv == -1) {
|
||||
(void)remove(tmp_metafile);
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user