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

View File

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

View File

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

View File

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