Skip to content

Commit b7047c2

Browse files
authored
Rollup merge of #95234 - ben0x539:nixquotes, r=Dylan-DPC
bootstrap.py: nixos check in /etc/os-release with quotes Per https://www.freedesktop.org/software/systemd/man/os-release.html, > Variable assignment values must be enclosed in double or single quotes > if they include spaces, semicolons or other special characters outside > of A–Z, a–z, 0–9. (Assignments that do not include these special > characters may be enclosed in quotes too, but this is optional.) So, past `ID=nixos`, let's also check for `ID='nixos'` and `ID="nixos"`. One of these is necessary between NixOS/nixpkgs#162168 and NixOS/nixpkgs#164068, but this seems more correct either way.
2 parents 949b98c + 76756cc commit b7047c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bootstrap/bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def fix_bin_or_dylib(self, fname):
678678
# The latter one does not exist on NixOS when using tmpfs as root.
679679
try:
680680
with open("/etc/os-release", "r") as f:
681-
if not any(line.strip() == "ID=nixos" for line in f):
681+
if not any(l.strip() in ["ID=nixos", "ID='nixos'", 'ID="nixos"'] for l in f):
682682
return
683683
except FileNotFoundError:
684684
return

0 commit comments

Comments
 (0)