|
1 | | -{ stdenv, writeScript, coreutils, gnugrep, gnused, common-updater-scripts, nix }: |
| 1 | +{ lib |
| 2 | +, stdenv |
| 3 | +, common-updater-scripts |
| 4 | +, coreutils |
| 5 | +, gnugrep |
| 6 | +, gnused |
| 7 | +, nix |
| 8 | +, writeScript |
| 9 | +}: |
2 | 10 |
|
3 | 11 | { name ? null |
4 | 12 | , pname ? null |
|
15 | 23 | # where to print git commands and debugging messages |
16 | 24 | fileForGitCommands = "update-git-commits.txt"; |
17 | 25 |
|
| 26 | + grep = lib.getExe gnugrep; |
| 27 | + sed = lib.getExe gnused; |
| 28 | + |
18 | 29 | # shell script to update package |
19 | 30 | updateScript = writeScript "generic-update-script.sh" '' |
20 | 31 | #! ${stdenv.shell} |
|
41 | 52 |
|
42 | 53 | function version_is_ignored() { |
43 | 54 | local tag="$1" |
44 | | - [ -n "$ignored_versions" ] && grep -E "$ignored_versions" <<< "$tag" |
| 55 | + [ -n "$ignored_versions" ] && ${grep} -E "$ignored_versions" <<< "$tag" |
45 | 56 | } |
46 | 57 |
|
47 | 58 | function version_is_unstable() { |
48 | 59 | local tag="$1" |
49 | 60 | local enforce="$2" |
50 | 61 | if [ -n "$odd_unstable" -o -n "$enforce" ]; then |
51 | | - local minor=$(echo "$tag" | ${gnused}/bin/sed -rne 's,^[0-9]+\.([0-9]+).*,\1,p') |
| 62 | + local minor=$(echo "$tag" | ${sed} -rne 's,^[0-9]+\.([0-9]+).*,\1,p') |
52 | 63 | if [ $((minor % 2)) -eq 1 ]; then |
53 | 64 | return 0 |
54 | 65 | fi |
55 | 66 | fi |
56 | 67 | if [ -n "$patchlevel_unstable" -o -n "$enforce" ]; then |
57 | | - local patchlevel=$(echo "$tag" | ${gnused}/bin/sed -rne 's,^[0-9]+\.[0-9]+\.([0-9]+).*$,\1,p') |
| 68 | + local patchlevel=$(echo "$tag" | ${sed} -rne 's,^[0-9]+\.[0-9]+\.([0-9]+).*$,\1,p') |
58 | 69 | if ((patchlevel >= 90)); then |
59 | 70 | return 0 |
60 | 71 | fi |
|
71 | 82 |
|
72 | 83 | # cut any revision prefix not used in the NixOS package version |
73 | 84 | if [ -n "$rev_prefix" ]; then |
74 | | - tags=$(echo "$tags" | ${gnugrep}/bin/grep "^$rev_prefix") |
75 | | - tags=$(echo "$tags" | ${gnused}/bin/sed -e "s,^$rev_prefix,,") |
| 85 | + tags=$(echo "$tags" | ${grep} "^$rev_prefix") |
| 86 | + tags=$(echo "$tags" | ${sed} -e "s,^$rev_prefix,,") |
76 | 87 | fi |
77 | | - tags=$(echo "$tags" | ${gnugrep}/bin/grep "^[0-9]") |
| 88 | + tags=$(echo "$tags" | ${grep} "^[0-9]") |
78 | 89 |
|
79 | 90 | # sort the tags in decreasing order |
80 | 91 | tags=$(echo "$tags" | ${coreutils}/bin/sort --reverse --version-sort) |
|
0 commit comments