about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2018-02-02 13:00:55 +0100
committeraszlig <aszlig@nix.build>2018-02-02 13:00:55 +0100
commit46698f1b9b3a323231e7058f866d088bd605531b (patch)
tree18e0b62ad19c88923ae0fa1e32678e38f0d3f604 /pkgs/build-support
parent7c00466354e674c2ec7f30f1f79f9b6f8041f090 (diff)
pkgs/build-sandbox: Zero-pad minor Nix version
In order to do integer comparisons on the Nix version, we need to
zero-pad the minor version, so that we always have two digits.

Since the change of Nix version 1.12 to 2.0 the minor version no longer
has two digits, so we get 20 instead of 112 and when compared the former
is smaller than the latter but it has to be the opposite.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-sandbox/src/Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/build-support/build-sandbox/src/Makefile b/pkgs/build-support/build-sandbox/src/Makefile
index cd642b8e..199e025a 100644
--- a/pkgs/build-support/build-sandbox/src/Makefile
+++ b/pkgs/build-support/build-sandbox/src/Makefile
@@ -2,7 +2,8 @@ BINARIES = $(wildcard $(BINDIR)/*)
 WRAPPERS = $(subst $(BINDIR),$(out)/bin,$(BINARIES))
 
 NIX_VERSION = `pkg-config --modversion nix-main | \
-               sed -e 's/^\([0-9]\+\)\.\([0-9]\+\).*/\1\2/'`
+               sed -e 's/^\([0-9]\+\)\.\([0-9][0-9]\).*/\1\2/' \
+                   -e 's/^\([0-9]\+\)\.\([0-9]\).*/\10\2/'`
 
 OBJECTS = nix-query.o path-cache.o params.o setup.o