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:
		
							
								
								
									
										5
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								NEWS
									
									
									
									
									
								
							| @@ -70,9 +70,8 @@ xbps-0.8.0 (???): | |||||||
|  |  | ||||||
|  * Merged the `progress_callback' branch that makes possible to specify a |  * Merged the `progress_callback' branch that makes possible to specify a | ||||||
|    function callback to update progress while unpacking binary packages |    function callback to update progress while unpacking binary packages | ||||||
|    and while fetching files. xbps-bin(8) now reports a percentage while |    and while fetching files. xbps-bin(8) now lists current extract files | ||||||
|    unpacking package files if -v not set, otherwise it will list the |    with its size in bytes if -v flag is set. | ||||||
|    current extracted file with its size in bytes. |  | ||||||
|  |  | ||||||
|  * Improved package dependency resolution in repositories by using a new |  * Improved package dependency resolution in repositories by using a new | ||||||
|    function, xbps_repository_pool_find_pkg() that returns a package dictionary |    function, xbps_repository_pool_find_pkg() that returns a package dictionary | ||||||
|   | |||||||
| @@ -526,14 +526,12 @@ exec_transaction(struct transaction *trans) | |||||||
| 		/* | 		/* | ||||||
| 		 * Unpack binary package. | 		 * 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) { | 		if ((rv = xbps_unpack_binary_pkg(obj)) != 0) { | ||||||
| 			xbps_error_printf("xbps-bin: error unpacking %s " | 			xbps_error_printf("xbps-bin: error unpacking %s " | ||||||
| 			    "(%s)\n", pkgver, strerror(rv)); | 			    "(%s)\n", pkgver, strerror(rv)); | ||||||
| 			return rv; | 			return rv; | ||||||
| 		} | 		} | ||||||
| 		if ((xhp->flags & XBPS_FLAG_VERBOSE) == 0) |  | ||||||
| 			printf("\n"); |  | ||||||
| 		/* | 		/* | ||||||
| 		 * Register binary package. | 		 * Register binary package. | ||||||
| 		 */ | 		 */ | ||||||
|   | |||||||
| @@ -164,24 +164,6 @@ unpack_progress_cb_verbose(void *data) | |||||||
| 	    xpd->entry_size); | 	    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 | int | ||||||
| main(int argc, char **argv) | main(int argc, char **argv) | ||||||
| { | { | ||||||
| @@ -266,8 +248,6 @@ main(int argc, char **argv) | |||||||
| 	xh.xfpd = &xfpd; | 	xh.xfpd = &xfpd; | ||||||
| 	if (flags & XBPS_FLAG_VERBOSE) | 	if (flags & XBPS_FLAG_VERBOSE) | ||||||
| 		xh.xbps_unpack_cb = unpack_progress_cb_verbose; | 		xh.xbps_unpack_cb = unpack_progress_cb_verbose; | ||||||
| 	else |  | ||||||
| 		xh.xbps_unpack_cb = unpack_progress_cb_percentage; |  | ||||||
| 	xh.xupd = &xupd; | 	xh.xupd = &xupd; | ||||||
| 	xh.rootdir = rootdir; | 	xh.rootdir = rootdir; | ||||||
| 	xh.cachedir = cachedir; | 	xh.cachedir = cachedir; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user