aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03 17:02:29 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03 17:02:29 +0000
commitcdee3174190c237bbf36955a5faa3896f564b7a1 (patch)
tree4d6a244888a690d3c5dc29ed0483de18a12c7139
parentd95b68fde32ab9f6b6aac052604b90b5ce4523d7 (diff)
* Backwards compatibility.
-rw-r--r--src/nix-worker/nix-worker.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc
index c956f839e..fd34bea67 100644
--- a/src/nix-worker/nix-worker.cc
+++ b/src/nix-worker/nix-worker.cc
@@ -288,12 +288,17 @@ static void performOp(unsigned int clientVersion,
}
case wopAddToStore: {
- /* !!! uberquick hack */
string baseName = readString(from);
- readInt(from); /* obsolete; was `fixed' flag */
+ bool fixed = readInt(from) == 1; /* obsolete */
bool recursive = readInt(from) == 1;
- HashType hashAlgo = parseHashType(readString(from));
-
+ string s = readString(from);
+ /* Compatibility hack. */
+ if (!fixed) {
+ s = "sha256";
+ recursive = true;
+ }
+ HashType hashAlgo = parseHashType(s);
+
Path tmp = createTempDir();
AutoDelete delTmp(tmp);
Path tmp2 = tmp + "/" + baseName;