xbps-bin: add a simple unpack cb that mimics the 'check' target.

This commit is contained in:
Juan RP 2011-02-24 10:18:24 +01:00
parent e4c24e5fea
commit 0a84799ac7

View File

@ -164,6 +164,20 @@ unpack_progress_cb_verbose(void *data)
xpd->entry_size); xpd->entry_size);
} }
static void
unpack_progress_cb(void *data)
{
struct xbps_unpack_progress_data *xpd = data;
if (xpd->entry == NULL || xpd->entry_is_metadata)
return;
else if (xpd->entry_size <= 0)
return;
printf("Extracting `%s'...\n", xpd->entry);
printf("\033[1A\033[K");
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
@ -248,6 +262,8 @@ 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;
xh.xupd = &xupd; xh.xupd = &xupd;
xh.rootdir = rootdir; xh.rootdir = rootdir;
xh.cachedir = cachedir; xh.cachedir = cachedir;