aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-25 17:06:12 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-03-25 17:06:12 +0100
commit7ea6ecf855dee69a1cd938c3fe7e4e132be00b24 (patch)
tree0607f4f32d9c764f7df324e81e733ca84c991936 /src/nix-store
parent5114a07d9578e06c66862270a3d624fc0944f33a (diff)
addToStore(): Take explicit name argument
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 7baaa80ef..60080f253 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -163,8 +163,8 @@ static void opAdd(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty()) throw UsageError("unknown flag");
- for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i)
- cout << format("%1%\n") % store->addToStore(*i);
+ for (auto & i : opArgs)
+ cout << format("%1%\n") % store->addToStore(baseNameOf(i), i);
}
@@ -185,8 +185,8 @@ static void opAddFixed(Strings opFlags, Strings opArgs)
HashType hashAlgo = parseHashType(opArgs.front());
opArgs.pop_front();
- for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i)
- cout << format("%1%\n") % store->addToStore(*i, recursive, hashAlgo);
+ for (auto & i : opArgs)
+ cout << format("%1%\n") % store->addToStore(baseNameOf(i), i, recursive, hashAlgo);
}