-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuget-to-nix: sort output not the input #162187
Conversation
8546a3e
to
9f9f50a
Compare
Idea sounds good but I'm not familiar with nuget2nix.sh |
I am dyslexic and it could be that below commit message would be better:
|
9f9f50a
to
6ae7250
Compare
commit message updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one suggestion, otherwise the code looks good!
done < <(find $1 -name '*.nuspec') | ||
|
||
LC_ALL=C sort --ignore-case ${tmpfile} | ||
rm ${tmpfile} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rm ${tmpfile} |
Not needed anymore with the trap
Thank you, this fixes a pretty big issue with #162548 I never noticed :) |
It is the package list output that should be sorted. The current output sequence is not logical because '.' is sorted in front of '/' with input sorting and is not deterministic for different language environments. To get a deterministic and logical sorting in environments with different language configured, env "LC_ALL=C" is set and the produced strings is that is sorted. To get alphabetic sorting and not a pure ASCII value sort "--ignore-case" is added.
6ae7250
to
bbcb7d3
Compare
@@ -8,6 +8,8 @@ if [ $# -eq 0 ]; then | |||
fi | |||
|
|||
pkgs=$1 | |||
tmpfile=$(mktemp /tmp/nuget-to-nix.XXXXXX) | |||
trap 'rm -f "$tmpfile" EXIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a quote was missed here, breaking the program: nuget-to-nix: line 25: unexpected EOF while looking for matching ''
trap 'rm -f "$tmpfile" EXIT | |
trap 'rm -f "$tmpfile"' EXIT |
It is the package list output that should be sorted. The file input
sorting do not produce stable output lists.
Motivation for this change
Sorting of input files do not produce stable output list across machines with version changes for some reason.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes