Skip to content

Commit b8568a4

Browse files
committed
Merge branch 'add-to-store' of github.com:haskell-nix/hnix-store into add-to-store
2 parents 547165d + 34f2ad0 commit b8568a4

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

hnix-store-remote/app/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import qualified Data.ByteString.Lazy as LBS
33
import qualified Data.HashSet as HS
44
import Data.Maybe
5-
import Data.Proxy
65
import Control.Monad.Reader
76
import Text.Pretty.Simple
7+
import Data.Proxy
88

99
import qualified System.Nix.GC as GC
1010
import System.Nix.Path (PathHashAlgo)

hnix-store-remote/src/System/Nix/Store/Remote.hs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ type Source = () -- abstract binary source
175175
addToStoreNar :: ValidPathInfo -> Source -> RepairFlag -> CheckSigsFlag -> MonadStore ()
176176
addToStoreNar = undefined -- XXX
177177

178-
179178
-- class BaseHashAlgorithm (a :: HashAlgorithm) where
180179
-- baseHashAlgorithm :: Bool
181180

@@ -197,48 +196,6 @@ printHashType SHA1 = "SHA1"
197196
printHashType SHA256 = "SHA256"
198197
printHashType (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-
242199
type PathFilter = Path -> Bool
243200

244201
addToStore

0 commit comments

Comments
 (0)