@@ -175,7 +175,6 @@ type Source = () -- abstract binary source
175175addToStoreNar :: ValidPathInfo -> Source -> RepairFlag -> CheckSigsFlag -> MonadStore ()
176176addToStoreNar = undefined -- XXX
177177
178-
179178-- class BaseHashAlgorithm (a :: HashAlgorithm) where
180179-- baseHashAlgorithm :: Bool
181180
@@ -197,48 +196,6 @@ printHashType SHA1 = "SHA1"
197196printHashType SHA256 = " SHA256"
198197printHashType (Truncated _ a) = printHashType a
199198
200-
201- -- **********************************************************
202- -- ** This is the c++ code we are porting for `addToStore` **
203- -- **********************************************************
204- --
205- -- Path RemoteStore::addToStore(const string & name, const Path & _srcPath,
206- -- bool recursive, HashType hashAlgo, PathFilter & filter, RepairFlag repair)
207- -- {
208- -- if (repair) throw Error("repairing is not supported when building through the Nix daemon");
209-
210- -- auto conn(getConnection());
211-
212- -- Path srcPath(absPath(_srcPath));
213-
214- -- conn->to << wopAddToStore << name
215- -- << ((hashAlgo == htSHA256 && recursive) ? 0 : 1) /* backwards compatibility hack */
216- -- << (recursive ? 1 : 0)
217- -- << printHashType(hashAlgo);
218-
219- -- try {
220- -- conn->to.written = 0;
221- -- conn->to.warn = true;
222- -- connections->incCapacity();
223- -- {
224- -- Finally cleanup([&]() { connections->decCapacity(); });
225- -- dumpPath(srcPath, conn->to, filter);
226- -- }
227- -- conn->to.warn = false;
228- -- conn.processStderr();
229- -- } catch (SysError & e) {
230- -- /* Daemon closed while we were sending the path. Probably OOM
231- -- or I/O error. */
232- -- if (e.errNo == EPIPE)
233- -- try {
234- -- conn.processStderr();
235- -- } catch (EndOfFile & e) { }
236- -- throw;
237- -- }
238-
239- -- return readStorePath(*this, conn->from);
240- -- }
241-
242199type PathFilter = Path -> Bool
243200
244201addToStore
0 commit comments