Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2017-03-19 | lib.readPathsFromFile: simplify, /cc #24036 | Orivej Desh | 1 | -3/+1 | |
This part isn't needed after 36de745e1b7. | |||||
2017-03-19 | readPathsFromFile: fixup after #23851 | Vladimír Čunát | 1 | -1/+1 | |
The final newline would produce an empty string; let's filter all empty lines as well. | |||||
2017-03-15 | libs: make splitString also split last separator (#23851) | Léo Gaspard | 1 | -1/+1 | |
* libs: make splitString also split last separator * libs: add tests for splitStrings | |||||
2016-08-13 | getVersion: first try drv.version before parsing drv.name | Domen Kožar | 1 | -1/+6 | |
2016-08-12 | fix documentation typo in lib/strings.nix (#17684) | Данило Глинський (Danylo Hlynskyi) | 1 | -1/+1 | |
2016-08-10 | hasSuffix: human readable inputs | Domen Kožar | 1 | -5/+5 | |
2016-08-01 | lib: add fileContents function | Eric Sagnes | 1 | -0/+10 | |
2016-06-20 | lib: Make escapeShellArg more robust | aszlig | 1 | -8/+7 | |
Quoting various characters that the shell *may* interpret specially is a very fragile thing to do. I've used something more robust all over the place in various Nix expression I've written just because I didn't trust escapeShellArg. Here is a proof of concept showing that I was indeed right in distrusting escapeShellArg: with import <nixpkgs> {}; let payload = runCommand "payload" {} '' # \x00 is not allowed for Nix strings, so let's begin at 1 for i in $(seq 1 255); do echo -en "\\x$(printf %02x $i)" done > "$out" ''; escapers = with lib; { current = escapeShellArg; better = arg: let backslashEscapes = stringToCharacters "\"\\ ';$`()|<>\r\t*[]&!~#"; search = backslashEscapes ++ [ "\n" ]; replace = map (c: "\\${c}") backslashEscapes ++ [ "'\n'" ]; in replaceStrings search replace (toString arg); best = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'"; }; testWith = escaper: let escaped = escaper (builtins.readFile payload); in runCommand "test" {} '' if ! r="$(bash -c ${escapers.best "echo -nE ${escaped}"} 2> /dev/null)" then echo bash eval error > "$out" exit 0 fi if echo -n "$r" | cmp -s "${payload}"; then echo success > "$out" else echo failed > "$out" fi ''; in runCommand "results" {} '' echo "Test results:" ${lib.concatStrings (lib.mapAttrsToList (name: impl: '' echo " ${name}: $(< "${testWith impl}")" '') escapers)} exit 1 '' The resulting output is the following: Test results: best: success better: success current: bash eval error I did the "better" implementation just to illustrate that the method of quoting only "harmful" characters results in madness in terms of implementation and performance. Signed-off-by: aszlig <aszlig@redmoonstudios.org> Cc: @edolstra, @zimbatm | |||||
2016-06-19 | Merge pull request #16180 from zimbatm/shell-escaping | zimbatm | 1 | -1/+10 | |
Escape all shell arguments uniformly | |||||
2016-06-17 | Remove unecessary branching on old nix versions | zimbatm | 1 | -5/+1 | |
All these builtins are available since 1.10 or earlier (1.10 being the lib/minver.nix) | |||||
2016-06-12 | Escape all shell arguments uniformly | zimbatm | 1 | -1/+10 | |
2016-05-19 | lib: revert my bogus comment fix | Nikolay Amiantov | 1 | -1/+1 | |
See https://github.com/NixOS/nixpkgs/commit/5445e521b6524587489c6968cc27347977b9b7b8#commitcomment-17531945 | |||||
2016-05-19 | firefox: restore gstreamer support for older firefox releases | Nikolay Amiantov | 1 | -1/+1 | |
2016-04-25 | make*Path: implement via makeSearchPathOutput | Nikolay Amiantov | 1 | -7/+3 | |
2016-04-25 | makeSearchPathOutputs: refactor to makeSearchPathOutput | Nikolay Amiantov | 1 | -5/+4 | |
2016-04-13 | makeSearchPath (and derivatives): check outputUnspecified | Nikolay Amiantov | 1 | -4/+4 | |
2016-04-13 | makePerlPath: try to guess outputs | Nikolay Amiantov | 1 | -1/+2 | |
2016-04-13 | makeSearchPathOutputs: init function | Nikolay Amiantov | 1 | -0/+10 | |
2016-04-13 | makeBinPath: guess outputs | Nikolay Amiantov | 1 | -1/+2 | |
2016-04-10 | Merge branch 'master' into closure-size | Vladimír Čunát | 1 | -1/+1 | |
Comparison to master evaluations on Hydra: - 1255515 for nixos - 1255502 for nixpkgs | |||||
2016-04-01 | Stronger warning against usage of splitString | Eelco Dolstra | 1 | -1/+1 | |
2016-04-01 | Merge branch 'master' into closure-size | Vladimír Čunát | 1 | -62/+274 | |
Beware that stdenv doesn't build. It seems something more will be needed than just resolution of merge conflicts. | |||||
2016-03-10 | lib/strings: document all the functions | zimbatm | 1 | -62/+274 | |
2016-01-19 | Merge branch 'staging' into closure-size | Vladimír Čunát | 1 | -3/+7 | |
2016-01-05 | lib.getVersion: extend the function to cope with strings as well as derivations | Peter Simons | 1 | -3/+7 | |
2015-12-31 | Merge branch 'master' into closure-size | Vladimír Čunát | 1 | -0/+15 | |
TODO: there was more significant refactoring of qtbase and plasma 5.5 on master, and I'm deferring pointing to correct outputs to later. | |||||
2015-12-16 | lib/strings: add readPathsFromFile | Thomas Tuegel | 1 | -0/+15 | |
2015-12-11 | Merge branch 'master' into closure-size | Luca Bruno | 1 | -0/+4 | |
2015-12-10 | add makeBinPath function for abstracting away pkg/bin:pkg2/bin.. | Domen Kožar | 1 | -0/+4 | |
2015-11-25 | Merge remote-tracking branch 'origin/master' into closure-size | Luca Bruno | 1 | -0/+8 | |
2015-11-25 | lib/strings: add a `toInt` helper (close #11242) | Christian Zagrodnick | 1 | -0/+8 | |
While the function itself is pretty easy, it's not straitforward to find a way to convert string to int with nix. | |||||
2015-10-03 | Merge commit staging+systemd into closure-size | Vladimír Čunát | 1 | -50/+54 | |
Many non-conflict problems weren't (fully) resolved in this commit yet. | |||||
2015-08-07 | Allow options with type "package" to be store paths | Eelco Dolstra | 1 | -0/+5 | |
For example, this allows writing nix.package = /nix/store/786mlvhd17xvcp2r4jmmay6jj4wj6b7f-nix-1.10pre4206_896428c; Also, document types.package in the manual. | |||||
2015-07-24 | intersperse: Fix quadratic performance | Eelco Dolstra | 1 | -5/+4 | |
2015-07-24 | Remove eqStrings | Eelco Dolstra | 1 | -22/+14 | |
It's no longer needed. Also clean up some comments. | |||||
2015-07-24 | Use replaceStrings primop | Eelco Dolstra | 1 | -18/+18 | |
2015-07-24 | Use concatStringSep primop | Eelco Dolstra | 1 | -3/+7 | |
2015-07-23 | Rename misc.nix -> deprecated.nix | Eelco Dolstra | 1 | -0/+2 | |
2015-07-23 | Use foldl' instead of fold in some places | Eelco Dolstra | 1 | -1/+1 | |
2015-07-13 | Issue 8152 - Reduce number of attribute set created by replaceChars. | Nicolas B. Pierron | 1 | -4/+6 | |
2015-05-05 | systemPackages, makeLibraryPath: try to guess outputs | Vladimír Čunát | 1 | -1/+3 | |
2015-03-08 | Add 'fixedWidthString' and 'fixedWidthNumber' formatting functions | Nikita Mikhailov | 1 | -0/+11 | |
2014-10-05 | lib: Use arithmetic operators rather than builtins.add etc. | Eelco Dolstra | 1 | -8/+8 | |
2014-08-25 | Added concatMapStringsSep and concatImapStringsSep | Igor Pashev | 1 | -0/+3 | |
Example: configure rewrite rules for Mediawiki RewriteEngine On RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d ${concatMapStringsSep "\n" (u: "RewriteCond %{REQUEST_URI} !^${u.urlPath}") serverInfo.serverConfig.servedDirs} RewriteRule ${if config.enableUploads | |||||
2014-06-11 | lib: Do not take string context into account | Kirill Elagin | 1 | -7/+12 | |
Close #2883. | |||||
2014-05-13 | lib/strings: add hasPrefix and simplify hasSuffix | Vladimír Čunát | 1 | -6/+8 | |
It was discussed as a part of #2570. | |||||
2014-05-13 | lib/strings: simplify removePrefix readability | Vladimír Čunát | 1 | -2/+2 | |
It was discussed as a part of #2570. | |||||
2014-05-09 | fetchFromGitHub: Use .tar.gz instead of .zip | Eelco Dolstra | 1 | -0/+10 | |
Also clean up the name attribute of fetchzip derivations a bit. | |||||
2013-11-12 | Add some primops to lib | Eelco Dolstra | 1 | -1/+2 | |
2013-10-10 | Move pkgs/lib/ to lib/ | Eelco Dolstra | 1 | -0/+190 | |