Skip to content

Commit 44eb238

Browse files
author
Rohan Singh
committed
Correctly detect GPG key ID for go script
Check the key directly from Release.gpg instead of trying to introspect the GPG keyring, which sometimes doesn't work if there is more than one key.
1 parent 7f3a43a commit 44eb238

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

debify.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ mv ~/.aptly/public /repo
4848

4949
if [ ! -z "$KEYSERVER" ] && [ ! -z "$URI" ]
5050
then
51-
GPG_KEY_ID=$(gpg -K --with-colons | head -1 | cut -d: -f5)
51+
release_sig_path=$(find /repo/dists -name Release.gpg | head -1)
52+
gpg_key_id=$(gpg --list-packets $release_sig_path | grep -oP "(?<=keyid ).+")
5253

5354
echo "# setup script for $URI" > /repo/go
5455

@@ -64,7 +65,7 @@ END
6465
esac
6566

6667
cat >> /repo/go <<-END
67-
apt-key adv --keyserver $KEYSERVER --recv-keys $GPG_KEY_ID
68+
apt-key adv --keyserver $KEYSERVER --recv-keys $gpg_key_id
6869
echo "deb $URI $APTLY_DISTRIBUTION $APTLY_COMPONENT" >> /etc/apt/sources.list
6970
7071
apt-get update

0 commit comments

Comments
 (0)