diff --git a/README.md b/README.md index aba846b..e770405 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ Build the cache of all the files needed to be accepted as a Debian archive: freight cache +If your system has GnuPG 2.x make sure that a gpg-agent is running or the above +command will fail. Also make sure you have installed a pinentry package (e.g. +pinentry-curses) that suits your needs. + Serve `/var/cache/freight` via your favorite web server and install it as an APT source: echo "deb http://example.com $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/example.list diff --git a/lib/freight/apt.sh b/lib/freight/apt.sh index 69b09fb..2788587 100644 --- a/lib/freight/apt.sh +++ b/lib/freight/apt.sh @@ -207,6 +207,13 @@ EOF } >"$DISTCACHE/Release" + # Pinentry may fail on GnuPG 2.x without GPG_TTY, see + # https://github.com/freight-team/freight/issues/72 + if GPG_TTY=$(tty) + then + export GPG_TTY + fi + # Sign the top-level `Release` file with `gpg`, for each key and # concatenate signatures. for GPGKEY in $GPG; do