scylladb: fix build access to /etc/os-release

Co-authored-by: Justin Humm <justin.humm@posteo.de>
This commit is contained in:
Florian Peter 2019-10-07 10:48:22 +08:00
parent 837cc0767d
commit b932511029
2 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,28 @@
diff --git a/configure.py b/configure.py
index 25ca951ac..454140420 100755
--- a/configure.py
+++ b/configure.py
@@ -36,13 +36,16 @@ tempfile.tempdir = "./build/tmp"
configure_args = str.join(' ', [shlex.quote(x) for x in sys.argv[1:]])
-for line in open('/etc/os-release'):
- key, _, value = line.partition('=')
- value = value.strip().strip('"')
- if key == 'ID':
- os_ids = [value]
- if key == 'ID_LIKE':
- os_ids += value.split(' ')
+try:
+ for line in open('/etc/os-release'):
+ key, _, value = line.partition('=')
+ value = value.strip().strip('"')
+ if key == 'ID':
+ os_ids = [value]
+ if key == 'ID_LIKE':
+ os_ids += value.split(' ')
+except FileNotFoundError:
+ os_ids = ["linux"]
# distribution "internationalization", converting package names.

View file

@ -41,7 +41,7 @@ gcc8Stdenv.mkDerivation {
fetchSubmodules = true;
};
patches = [ ./seastar-configure-script-paths.patch ];
patches = [ ./seastar-configure-script-paths.patch ./configure-etc-osrelease.patch ];
nativeBuildInputs = [
pkgconfig