diff options
author | Werner Koch <wk@gnupg.org> | 2024-02-29 10:21:33 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2024-02-29 10:21:33 +0100 |
commit | c27e5be50b334726dc2b6a4d12e013582c19de6b (patch) | |
tree | 9ca992988fae2c6acc85d383283258c0bfbc97b6 /build-aux | |
parent | gpg: Emit status lines for errors in the compression layer. (diff) | |
download | gnupg2-c27e5be50b334726dc2b6a4d12e013582c19de6b.tar.xz gnupg2-c27e5be50b334726dc2b6a4d12e013582c19de6b.zip |
build: Make getswdb.sh usable outside the GniPG tree.
--
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/getswdb.sh | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/build-aux/getswdb.sh b/build-aux/getswdb.sh index 7d4b31eef..6ec931c25 100755 --- a/build-aux/getswdb.sh +++ b/build-aux/getswdb.sh @@ -34,6 +34,7 @@ Options: --skip-download Assume download has already been done. --skip-verify Do not check signatures --skip-selfcheck Do not check GnuPG version + (default if not used in the GnuPG tree) --find-sha1sum Print the name of the sha1sum utility --find-sha256sum Print the name of the sha256sum utility --help Print this help. @@ -114,16 +115,37 @@ if [ ${find_sha256sum} = yes ]; then fi +if [ $skip_verify = no ]; then + if [ ! -f "$distsigkey" ]; then + distsigkey="/usr/local/share/gnupg/distsigkey.gpg" + if [ ! -f "$distsigkey" ]; then + distsigkey="/usr/share/gnupg/distsigkey.gpg" + if [ ! -f "$distsigkey" ]; then + echo "no keyring with release keys found!" >&2 + exit 1 + fi + fi + echo "using release keys from $distsigkey" >&2 + skip_selfcheck=yes + fi +fi + + # Get GnuPG version from VERSION file. For a GIT checkout this means # that ./autogen.sh must have been run first. For a regular tarball # VERSION is always available. -if [ ! -f "$srcdir/../VERSION" ]; then +if [ $skip_selfcheck = no ]; then + if [ ! -f "$srcdir/../VERSION" ]; then echo "VERSION file missing - run autogen.sh first." >&2 exit 1 + fi + version=$(cat "$srcdir/../VERSION") +else + version="0.0.0" fi -version=$(cat "$srcdir/../VERSION") version_num=$(echo "$version" | cvtver) + if [ $skip_verify = no ]; then if ! $GPGV --version >/dev/null 2>/dev/null ; then echo "command \"gpgv\" is not installed" >&2 |