From ce28b01ea34c346d697348b6082c90c0b9613ede Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Sat, 31 Jul 2021 12:55:16 +0200 Subject: [PATCH] maintainers/haskell/package-list: Only read one line from password-cmd --- .../scripts/haskell/upload-nixos-package-list-to-hackage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh b/maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh index c49ea68fbfb..9e243052f25 100755 --- a/maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh +++ b/maintainers/scripts/haskell/upload-nixos-package-list-to-hackage.sh @@ -12,10 +12,10 @@ # ~/.cabal/config file. # e.g. username: maralorn -# password-command: pass hackage.haskell.org (this can be any command, but not an arbitrary shell expression.) +# password-command: pass hackage.haskell.org (this can be any command, but not an arbitrary shell expression. Like cabal we only read the first output line and ignore the rest.) # Those fields are specified under `upload` on the `cabal` man page. package_list="$(nix-build -A haskell.package-list)/nixos-hackage-packages.csv" username=$(grep "^username:" ~/.cabal/config | sed "s/^username: //") password_command=$(grep "^password-command:" ~/.cabal/config | sed "s/^password-command: //") -curl -u "$username:$($password_command)" --digest -H "Content-type: text/csv" -T "$package_list" http://hackage.haskell.org/distro/NixOS/packages.csv +curl -u "$username:$($password_command | head -n1)" --digest -H "Content-type: text/csv" -T "$package_list" http://hackage.haskell.org/distro/NixOS/packages.csv