about summary refs log tree commit diff
path: root/tests/substitutes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/substitutes.sh')
-rw-r--r--tests/substitutes.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/substitutes.sh b/tests/substitutes.sh
index ea214a8a8a43..7b236249b190 100644
--- a/tests/substitutes.sh
+++ b/tests/substitutes.sh
@@ -10,13 +10,17 @@ echo "output path is $outPath"
 subExpr=$($TOP/src/nix-instantiate/nix-instantiate substituter.nix)
 echo "store expr is $subExpr"
 
+regSub() {
+    (echo $1 && echo $2 && echo "/substituter" && echo 3 && echo $outPath && echo Hallo && echo Wereld) | $TOP/src/nix-store/nix-store --substitute
+}
+
 # Register a fake successor, and a substitute for it.
 suc=$NIX_STORE_DIR/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-s.store
-(echo $suc && echo $subExpr && echo "/substituter" && echo 3 && echo $outPath && echo Hallo && echo Wereld) | $TOP/src/nix-store/nix-store --substitute
+regSub $suc $subExpr
 $TOP/src/nix-store/nix-store --successor $storeExpr $suc
 
 # Register a substitute for the output path.
-(echo $outPath && echo $subExpr && echo "/substituter" && echo 3 && echo $outPath && echo Hallo && echo Wereld) | $TOP/src/nix-store/nix-store --substitute
+regSub $outPath $subExpr
 
 
 $TOP/src/nix-store/nix-store -rvvvvv "$storeExpr"