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) {
217217 if !builder. config . patch_binaries_for_nix {
218218 // Use `/etc/os-release` instead of `/etc/NIXOS`.
219219 // The latter one does not exist on NixOS when using tmpfs as root.
220+ const NIX_IDS : & [ & str ] = & [ "ID=nixos" , "ID='nixos'" , "ID=\" nixos\" " ] ;
220221 let os_release = match File :: open ( "/etc/os-release" ) {
221222 Err ( e) if e. kind ( ) == ErrorKind :: NotFound => return ,
222223 Err ( e) => panic ! ( "failed to access /etc/os-release: {}" , e) ,
223224 Ok ( f) => f,
224225 } ;
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 ( ) ) ) {
226227 return ;
227228 }
228229 if Path :: new ( "/lib" ) . exists ( ) {
You can’t perform that action at this time.
0 commit comments