From 69238e7e66ff2997c58f5e5463500530376c6efe Mon Sep 17 00:00:00 2001 From: developer1 Date: Thu, 19 Jun 2025 17:29:29 +0200 Subject: [PATCH 1/3] Update deprecated email extraction in p_gpg_decrypt Fixes arch build. Since gpgme v2 release, https://github.com/gpg/gpgme/blob/master/NEWS, the gpgme_key_get_string_attr as well as GPGME_ATTR_EMAIL are REMOVED. Fixes #2 Closes #2 --- src/pgp/gpg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index cae16ffb..1ea2ef02 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -656,11 +656,15 @@ p_gpg_decrypt(const char* const cipher) error = gpgme_get_key(ctx, recipient->keyid, &key, 1); if (!error && key) { - const char* addr = gpgme_key_get_string_attr(key, GPGME_ATTR_EMAIL, NULL, 0); - if (addr) { - g_string_append(recipients_str, addr); + for (gpgme_user_id_t uid = key->uids; uid != NULL; uid = uid->next) { + if (uid->email) { + g_string_append(recipients_str, uid->email); + break; + } } gpgme_key_unref(key); + } else if (error) { + log_warning("GPGME error: %s", gpgme_strerror(error)); } if (recipient->next) { -- 2.49.1 From 0784662d4077b69401328dc8e204442ef50ac00d Mon Sep 17 00:00:00 2001 From: Jabber Developer Date: Thu, 19 Jun 2025 19:59:02 +0200 Subject: [PATCH 2/3] Fix workflow Current setup of the infratstrcture with DIND was causing issues with volume binding, leading to a false-positive error on code formatting check. This commit addresses the issue by removing dependency on a container, but at the same time it limits choice of formatting version. This fix does not address the underlying issue with the architecture. As an additional change, package versions are updated. --- .github/workflows/main.yml | 52 ++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95560e36..dd40b9a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,18 +20,20 @@ jobs: name: Linux steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run tests run: | docker build -f Dockerfile.${{ matrix.flavor }} -t profanity . docker run profanity ./ci-build.sh code-style: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest name: Check coding style continue-on-error: true + env: + GITHUB_WORKSPACE: ${{ runner.workspace }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # if this check fails, you have to update the number of auto types known and the list of auto types in the check below - name: Check auto types are up-to-date run: | @@ -39,18 +41,48 @@ jobs: - name: Check auto types are initialized run: | grep -P 'auto_(char|gchar|gcharv|guchar|jid|sqlite|gfd|FILE)[\w *]*;$' -r src && exit -1 || true - - name: Run clang-format - uses: jidicula/clang-format-action@v4.11.0 - with: - clang-format-version: '16' - check-path: 'src' + + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format + + - name: Run clang-format check + run: | + echo $(clang-format --version) + # Find all source files you care about + INCLUDE_REGEX='^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|(ino|pde|proto|cu))$' + CHECK_PATH='src' + files=$(find "$CHECK_PATH" -name .git -prune -o -regextype posix-egrep -regex "$INCLUDE_REGEX" -print) + if [ -z "$files" ]; then + echo "✅ No source files found to check." + exit 0 + fi + + # Run clang-format in dry-run mode and collect any improperly formatted files + failed=0 + for file in $files; do + if ! output=$(clang-format --dry-run --Werror --style=file "$file" 2>&1); then + echo "❌ Failed on file: $file" + echo "$output" + echo "----------------------------------------" + failed=1 + fi + done + + if [ $failed -ne 0 ]; then + echo "🚫 One or more files are not properly formatted." + else + echo "✅ All files are properly formatted." + fi + exit $failed spell-check: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest name: Check spelling continue-on-error: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: install dependencies run: | sudo apt update -- 2.49.1 From 0d7a859a20c3fd1095ae998d23f1c73f71e1a207 Mon Sep 17 00:00:00 2001 From: Jabber Developer Date: Fri, 20 Jun 2025 14:58:30 +0200 Subject: [PATCH 3/3] fix: curl parameter type correction --- src/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index 349b7b7c..07e4c97b 100644 --- a/src/common.c +++ b/src/common.c @@ -387,7 +387,7 @@ release_get_latest(void) curl_easy_setopt(handle, CURLOPT_URL, url); curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, _data_callback); - curl_easy_setopt(handle, CURLOPT_TIMEOUT, 2); + curl_easy_setopt(handle, CURLOPT_TIMEOUT, 2L); curl_easy_setopt(handle, CURLOPT_WRITEDATA, (void*)&output); curl_easy_perform(handle); -- 2.49.1