File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -217,12 +217,13 @@ fn fix_bin_or_dylib(builder: &Builder<'_>, fname: &Path) {
217
217
if !builder. config . patch_binaries_for_nix {
218
218
// Use `/etc/os-release` instead of `/etc/NIXOS`.
219
219
// The latter one does not exist on NixOS when using tmpfs as root.
220
+ const NIX_IDS : & [ & str ] = & [ "ID=nixos" , "ID='nixos'" , "ID=\" nixos\" " ] ;
220
221
let os_release = match File :: open ( "/etc/os-release" ) {
221
222
Err ( e) if e. kind ( ) == ErrorKind :: NotFound => return ,
222
223
Err ( e) => panic ! ( "failed to access /etc/os-release: {}" , e) ,
223
224
Ok ( f) => f,
224
225
} ;
225
- if !BufReader :: new ( os_release) . lines ( ) . any ( |l| t ! ( l) . trim ( ) == "ID=nixos" ) {
226
+ if !BufReader :: new ( os_release) . lines ( ) . any ( |l| NIX_IDS . contains ( & t ! ( l) . trim ( ) ) ) {
226
227
return ;
227
228
}
228
229
if Path :: new ( "/lib" ) . exists ( ) {
You can’t perform that action at this time.
0 commit comments