nix-copy-closure: Add -v flag

And make exportPath() less spammy by default.
This commit is contained in:
Eelco Dolstra 2015-07-20 01:52:07 +02:00
parent db55940d9e
commit ccf31dbc25
4 changed files with 15 additions and 3 deletions

View file

@ -30,6 +30,7 @@
<arg><option>--include-outputs</option></arg>
<arg><option>--use-substitutes</option></arg>
<arg><option>-s</option></arg>
<arg><option>-v</option></arg>
<arg choice='plain'>
<replaceable>user@</replaceable><replaceable>machine</replaceable>
</arg>
@ -138,6 +139,12 @@ those paths. If this bothers you, use
</varlistentry>
<varlistentry><term><option>-v</option></term>
<listitem><para>Show verbose output.</para></listitem>
</varlistentry>
</variablelist>
</refsection>

View file

@ -16,8 +16,6 @@ binmode STDERR, ":encoding(utf8)";
my $debug = defined $ENV{NIX_DEBUG_HOOK};
setVerbosity(0); # make exportPath() less verbose
# General operation:
#

View file

@ -25,6 +25,7 @@ my $toMode = 1;
my $includeOutputs = 0;
my $dryRun = 0;
my $useSubstitutes = 0;
my $verbosity = 1;
# !!! Copied from nix-pack-closure, should put this in a module.
@ -61,6 +62,10 @@ while (@ARGV) {
elsif ($arg eq "--use-substitutes" || $arg eq "-s") {
$useSubstitutes = 1;
}
elsif ($arg eq "-v") {
$verbosity++;
setVerbosity($verbosity);
}
elsif (!defined $sshHost) {
$sshHost = $arg;
}

View file

@ -1510,7 +1510,7 @@ void LocalStore::exportPath(const Path & path, bool sign,
{
assertStorePath(path);
printMsg(lvlInfo, format("exporting path %1%") % path);
printMsg(lvlTalkative, format("exporting path %1%") % path);
if (!isValidPath(path))
throw Error(format("path %1% is not valid") % path);
@ -1613,6 +1613,8 @@ Path LocalStore::importPath(bool requireSignature, Source & source)
Path dstPath = readStorePath(hashAndReadSource);
printMsg(lvlTalkative, format("importing path %1%") % dstPath);
PathSet references = readStorePaths<PathSet>(hashAndReadSource);
Path deriver = readString(hashAndReadSource);