Improve informative messages when installing binpkgs.
This now looks like: $ xbps-bin -r /raid/random/xbps/test install initramfs-tools Installing dependency xbps-base-dirs: found xbps-base-dirs-0.2 ... done. Installing dependency glibc: found glibc-2.9 ... done. Installing dependency e2fsprogs: found e2fsprogs-1.41.3 ... done. Installing dependency zlib: found zlib-1.2.3 ... done. Installing dependency gawk: found gawk-3.1.6 ... done. Installing dependency findutils: found findutils-4.4.0 ... done. Installing dependency sed: found sed-4.1.5 ... done. Installing dependency grep: found grep-2.5.3 ... done. Installing dependency gzip: found gzip-1.3.12 ... done. Installing dependency cpio: found cpio-2.9 ... done. ... ... Installing initramfs-tools-0.92o ... done. Package initramfs-tools installed successfully. $ --HG-- extra : convert_revision : 79df585206c9ddc7f1267bc89bfd431ab572e527
This commit is contained in:
parent
82a9667049
commit
91291d5aec
2 changed files with 13 additions and 19 deletions
|
@ -57,8 +57,14 @@ xbps_install_binary_pkg_fini(prop_dictionary_t repo, prop_dictionary_t pkg,
|
|||
assert(version != NULL);
|
||||
assert(desc != NULL);
|
||||
|
||||
if (repo == false)
|
||||
if (repo == false) {
|
||||
automatic = true;
|
||||
printf("Installing dependency %s: found %s-%s ... ",
|
||||
pkgname, pkgname, version);
|
||||
} else {
|
||||
printf("Installing %s-%s ... ", pkgname, version);
|
||||
}
|
||||
(void)fflush(stdout);
|
||||
|
||||
rv = xbps_unpack_binary_pkg(repo, pkg, destdir, NULL);
|
||||
if (rv == 0) {
|
||||
|
@ -67,6 +73,11 @@ xbps_install_binary_pkg_fini(prop_dictionary_t repo, prop_dictionary_t pkg,
|
|||
rv = 0;
|
||||
}
|
||||
|
||||
if (rv == 0)
|
||||
printf("done.\n");
|
||||
else
|
||||
printf("failed!\n");
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
|
19
lib/unpack.c
19
lib/unpack.c
|
@ -38,19 +38,6 @@
|
|||
static int unpack_archive_init(prop_dictionary_t, const char *, const char *);
|
||||
static int unpack_archive_fini(struct archive *, const char *,
|
||||
prop_dictionary_t);
|
||||
static void unpack_defcb_print(prop_dictionary_t);
|
||||
|
||||
static void
|
||||
unpack_defcb_print(prop_dictionary_t pkg)
|
||||
{
|
||||
const char *pkgname, *version;
|
||||
assert(pkg != NULL);
|
||||
|
||||
prop_dictionary_get_cstring_nocopy(pkg, "pkgname", &pkgname);
|
||||
prop_dictionary_get_cstring_nocopy(pkg, "version", &version);
|
||||
|
||||
printf(" Unpacking %s-%s...\n", pkgname, version);
|
||||
}
|
||||
|
||||
int
|
||||
xbps_unpack_binary_pkg(prop_dictionary_t repo, prop_dictionary_t pkg,
|
||||
|
@ -85,9 +72,7 @@ xbps_unpack_binary_pkg(prop_dictionary_t repo, prop_dictionary_t pkg,
|
|||
}
|
||||
free(path);
|
||||
|
||||
if (!cb_print)
|
||||
unpack_defcb_print(pkg);
|
||||
else
|
||||
if (cb_print)
|
||||
(*cb_print)(pkg);
|
||||
|
||||
rv = unpack_archive_init(pkg, destdir, binfile);
|
||||
|
@ -205,9 +190,7 @@ unpack_archive_fini(struct archive *ar, const char *destdir,
|
|||
|
||||
rv = stat(path, &st);
|
||||
if (rv == 0) {
|
||||
rv = EEXIST;
|
||||
free(path);
|
||||
printf(" Not overwriting %s\n", archive_entry_pathname(entry));
|
||||
continue;
|
||||
}
|
||||
free(path);
|
||||
|
|
Loading…
Reference in a new issue