xbps_unpack_binary_pkg: rename fn callback arg to be shorter.
--HG-- branch : progress_callback
This commit is contained in:
parent
724c4a6f0a
commit
9611f3e412
@ -149,10 +149,10 @@ remove_metafile(const char *file, const char *pkgname, const char *version)
|
|||||||
* archive_read_set_progress_callback() from libarchive(3) cannot be used
|
* archive_read_set_progress_callback() from libarchive(3) cannot be used
|
||||||
* here because sometimes it misses some entries by unknown reasons.
|
* here because sometimes it misses some entries by unknown reasons.
|
||||||
*/
|
*/
|
||||||
#define RUN_PROGRESS_CB() \
|
#define RUN_PROGRESS_CB() \
|
||||||
do { \
|
do { \
|
||||||
if (unpack_progress_cb != NULL && xupd != NULL) \
|
if (progress_cb != NULL && xupd != NULL) \
|
||||||
(*unpack_progress_cb)(xupd); \
|
(*progress_cb)(xupd); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -160,7 +160,7 @@ unpack_archive(prop_dictionary_t pkg_repod,
|
|||||||
struct archive *ar,
|
struct archive *ar,
|
||||||
const char *pkgname,
|
const char *pkgname,
|
||||||
const char *version,
|
const char *version,
|
||||||
void (*unpack_progress_cb)(void *),
|
void (*progress_cb)(void *),
|
||||||
struct xbps_unpack_progress_data *xupd)
|
struct xbps_unpack_progress_data *xupd)
|
||||||
{
|
{
|
||||||
prop_dictionary_t propsd, filesd, old_filesd;
|
prop_dictionary_t propsd, filesd, old_filesd;
|
||||||
@ -211,7 +211,7 @@ unpack_archive(prop_dictionary_t pkg_repod,
|
|||||||
while (archive_read_next_header(ar, &entry) == ARCHIVE_OK) {
|
while (archive_read_next_header(ar, &entry) == ARCHIVE_OK) {
|
||||||
entry_pname = archive_entry_pathname(entry);
|
entry_pname = archive_entry_pathname(entry);
|
||||||
set_extract_flags(&flags, update);
|
set_extract_flags(&flags, update);
|
||||||
if (unpack_progress_cb != NULL && xupd != NULL) {
|
if (progress_cb != NULL && xupd != NULL) {
|
||||||
xupd->entry = entry_pname;
|
xupd->entry = entry_pname;
|
||||||
xupd->entry_size = archive_entry_size(entry);
|
xupd->entry_size = archive_entry_size(entry);
|
||||||
xupd->entry_is_metadata = false;
|
xupd->entry_is_metadata = false;
|
||||||
@ -486,7 +486,7 @@ out:
|
|||||||
|
|
||||||
int
|
int
|
||||||
xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod,
|
xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod,
|
||||||
void (*unpack_progress_cb)(void *),
|
void (*progress_cb)(void *),
|
||||||
struct xbps_unpack_progress_data *xupd)
|
struct xbps_unpack_progress_data *xupd)
|
||||||
{
|
{
|
||||||
struct archive *ar;
|
struct archive *ar;
|
||||||
@ -527,7 +527,7 @@ xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod,
|
|||||||
/*
|
/*
|
||||||
* Set extract progress callback if specified.
|
* Set extract progress callback if specified.
|
||||||
*/
|
*/
|
||||||
if (unpack_progress_cb != NULL && xupd != NULL) {
|
if (progress_cb != NULL && xupd != NULL) {
|
||||||
xupd->entry_extract_count = 0;
|
xupd->entry_extract_count = 0;
|
||||||
xupd->entry_total_count = 0;
|
xupd->entry_total_count = 0;
|
||||||
}
|
}
|
||||||
@ -535,7 +535,7 @@ xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod,
|
|||||||
* Extract archive files.
|
* Extract archive files.
|
||||||
*/
|
*/
|
||||||
rv = unpack_archive(pkg_repod, ar, pkgname, version,
|
rv = unpack_archive(pkg_repod, ar, pkgname, version,
|
||||||
unpack_progress_cb, xupd);
|
progress_cb, xupd);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
xbps_error_printf("failed to unpack `%s' binpkg: %s\n",
|
xbps_error_printf("failed to unpack `%s' binpkg: %s\n",
|
||||||
bpkg, strerror(rv));
|
bpkg, strerror(rv));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user