1.11 backport: buildenv: Read muliple lines in propagated-user-env-packages#1482
Closed
Ericson2314 wants to merge 1 commit intoNixOS:1.11-maintenancefrom
Closed
Conversation
8 tasks
edolstra
reviewed
Jul 24, 2017
corepkgs/buildenv.pl
Outdated
| my @propagated = split ' ', $propagated; | ||
| foreach my $p (@propagated) { | ||
| $postponed{$p} = 1 unless defined $done{$p}; | ||
| while (my $propagated = <DATA>) { |
Member
There was a problem hiding this comment.
I think you meant <PROP> here instead of <DATA>.
Slightly simpler is to read the whole file and split it on arbitrary whitespace:
local $/;
foreach my $p (split " ", <PROP>) {
$postponed{$p} = 1 unless defined $done{$p};
}
Member
Author
There was a problem hiding this comment.
@edolstra sounds good to me. That exactly mirrors what stdenv/setup.sh did before my changes.
For compatability with current and future nixpkgs, either ' ' or '\n' can serve as a delimiter between entries. Trailing empty entries are skipped.
f99fc6f to
971f82e
Compare
Member
Author
|
@edolstra Updated per your suggestion. |
8 tasks
Member
|
This ship has sailed |
Member
Author
|
Indeed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For compatability with current and future nixpkgs, either
' 'or'\n'can serve as a delimiter between entries. Trailing empty entries are also skipped.See NixOS/nixpkgs#27427 for background, and #1480 for the master version.
I tested the parsing logic in a standalone script, but not buildenv yet.