mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 03:09:35 +01:00
Merge commit '46d86e06ba' into progress-bar
This commit is contained in:
commit
2f5a4df00c
25 changed files with 137 additions and 67 deletions
|
|
@ -197,13 +197,14 @@ extern Verbosity verbosity; /* suppress msgs > this */
|
|||
/* Print a string message if the current log level is at least the specified
|
||||
level. Note that this has to be implemented as a macro to ensure that the
|
||||
arguments are evaluated lazily. */
|
||||
#define printMsg(level, args...) \
|
||||
#define printMsgUsing(loggerParam, level, args...) \
|
||||
do { \
|
||||
auto __lvl = level; \
|
||||
if (__lvl <= nix::verbosity) { \
|
||||
logger->log(__lvl, fmt(args)); \
|
||||
loggerParam->log(__lvl, fmt(args)); \
|
||||
} \
|
||||
} while (0)
|
||||
#define printMsg(level, args...) printMsgUsing(logger, level, args)
|
||||
|
||||
#define printError(args...) printMsg(lvlError, args)
|
||||
#define notice(args...) printMsg(lvlNotice, args)
|
||||
|
|
|
|||
|
|
@ -93,9 +93,16 @@ static void extract_archive(TarArchive & archive, const Path & destDir)
|
|||
else
|
||||
archive.check(r);
|
||||
|
||||
archive_entry_set_pathname(entry,
|
||||
archive_entry_copy_pathname(entry,
|
||||
(destDir + "/" + name).c_str());
|
||||
|
||||
// Patch hardlink path
|
||||
const char *original_hardlink = archive_entry_hardlink(entry);
|
||||
if (original_hardlink) {
|
||||
archive_entry_copy_hardlink(entry,
|
||||
(destDir + "/" + original_hardlink).c_str());
|
||||
}
|
||||
|
||||
archive.check(archive_read_extract(archive.archive, entry, flags));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue