xbps-bin: remove the unpack callback with a percentage.
It messes up some xbps_*printf()s, and removing it makes it look like previous versions (<=0.7.3).
This commit is contained in:
parent
a306cebc96
commit
12cdc7c242
5
NEWS
5
NEWS
@ -70,9 +70,8 @@ xbps-0.8.0 (???):
|
||||
|
||||
* Merged the `progress_callback' branch that makes possible to specify a
|
||||
function callback to update progress while unpacking binary packages
|
||||
and while fetching files. xbps-bin(8) now reports a percentage while
|
||||
unpacking package files if -v not set, otherwise it will list the
|
||||
current extracted file with its size in bytes.
|
||||
and while fetching files. xbps-bin(8) now lists current extract files
|
||||
with its size in bytes if -v flag is set.
|
||||
|
||||
* Improved package dependency resolution in repositories by using a new
|
||||
function, xbps_repository_pool_find_pkg() that returns a package dictionary
|
||||
|
@ -526,14 +526,12 @@ exec_transaction(struct transaction *trans)
|
||||
/*
|
||||
* Unpack binary package.
|
||||
*/
|
||||
printf("Unpacking `%s' (from ../%s) ... ", pkgver, filen);
|
||||
printf("Unpacking `%s' (from ../%s) ...\n", pkgver, filen);
|
||||
if ((rv = xbps_unpack_binary_pkg(obj)) != 0) {
|
||||
xbps_error_printf("xbps-bin: error unpacking %s "
|
||||
"(%s)\n", pkgver, strerror(rv));
|
||||
return rv;
|
||||
}
|
||||
if ((xhp->flags & XBPS_FLAG_VERBOSE) == 0)
|
||||
printf("\n");
|
||||
/*
|
||||
* Register binary package.
|
||||
*/
|
||||
|
@ -164,24 +164,6 @@ unpack_progress_cb_verbose(void *data)
|
||||
xpd->entry_size);
|
||||
}
|
||||
|
||||
static void
|
||||
unpack_progress_cb_percentage(void *data)
|
||||
{
|
||||
struct xbps_unpack_progress_data *xpd = data;
|
||||
double percent = 0;
|
||||
|
||||
if (xpd->entry_is_metadata)
|
||||
return;
|
||||
|
||||
percent =
|
||||
(double)((xpd->entry_extract_count * 100.0) / xpd->entry_total_count);
|
||||
if (percent > 100.0 ||
|
||||
xpd->entry_extract_count >= xpd->entry_total_count)
|
||||
percent = 100.0;
|
||||
|
||||
printf("\033[s(%3.2f%%)\033[u", percent);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@ -266,8 +248,6 @@ main(int argc, char **argv)
|
||||
xh.xfpd = &xfpd;
|
||||
if (flags & XBPS_FLAG_VERBOSE)
|
||||
xh.xbps_unpack_cb = unpack_progress_cb_verbose;
|
||||
else
|
||||
xh.xbps_unpack_cb = unpack_progress_cb_percentage;
|
||||
xh.xupd = &xupd;
|
||||
xh.rootdir = rootdir;
|
||||
xh.cachedir = cachedir;
|
||||
|
Loading…
Reference in New Issue
Block a user