nixpkgs/pkgs
Will Dietz 0e95bed017 nix-prefetch-git: fix extraction of submodule hashes on latest git
Summary:

According to git-submodule manpage,
"git submodule status" prefixes the hash with a '-' if it is not
initialized, and other chars in other circumstances.
(this is consistent on the various git versions tested)

nix-prefetch-git runs "git submodule init" which does you'd think,
but apparently despite this earlier versions of git before 2.16
would still give the hash the '-' suffix.
In particular this is the behavior when using 2.15 and 2.14.1
from the nixos-17.09 and nixos-17.03 channels respectively.

The script then used awk to drop the first char of the first field
which does the wrong thing when there is no prefix emitted:
while there is a space character before the hash, this is not
part of the field and so we ended up eating the first character
of the hash.

To fix this in a way that also works with the previous behavior,
this commit instead uses awk to grab the hash field
and uses tr to delete any '-' chars should they be present.

This seems to work in my testing, and for example can now
successfully fetch the source for "nginxModules.brotli"
where previously it would generate an error:

fatal: '22564a95d9ab58865a096b8d9f7324ea5f2e03e' is not a commit and a branch 'fetchgit' cannot be created from it

(we dropped a '2' from the beginning of the hash)
2018-01-24 20:18:59 +02:00
..
applications Merge pull request #34209 from LnL7/darwin-libR 2018-01-24 12:59:07 +01:00
build-support nix-prefetch-git: fix extraction of submodule hashes on latest git 2018-01-24 20:18:59 +02:00
common-updater
data hackage: update all-cabal-hashes snapshot to Hackage at 2018-01-18T14:32:45Z 2018-01-18 17:01:33 +01:00
desktops gnome-shell-extension-nohotcorner: init at 16.0 2018-01-23 00:48:27 -05:00
development Merge pull request #34116 from brown131/patch-1 2018-01-24 17:02:14 +00:00
games cataclysm-dda-git: install missing translations 2018-01-23 08:19:03 +09:00
misc Merge pull request #34146 from symphorien/fix-epkowa 2018-01-24 08:41:22 +01:00
os-specific Revert "perf: apply patch to fix build of 4.9" 2018-01-23 23:17:24 +02:00
servers Merge pull request #34085 from ikervagyok/samba 2018-01-23 20:55:15 -05:00
shells Remove nckx as a maintainer for all packages 2018-01-16 23:00:49 +01:00
stdenv Merge branch 'ericson2314-cross-master' into staging 2018-01-16 13:05:39 -05:00
test sierra-shared-test: fix build 2018-01-05 23:20:55 +01:00
tools Merge pull request #34200 from dtzWill/update/siege-4.0.4 2018-01-24 16:25:58 +08:00
top-level Merge pull request #33626 from thanegill/rxpy-init 2018-01-24 08:27:15 +01:00