public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lucio Sauer" <watermanpaint@posteo.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:dev commit in: net-p2p/p2pool/
Date: Fri, 16 Aug 2024 01:50:12 +0000 (UTC)	[thread overview]
Message-ID: <1723771949.1743d40a1f3911a846ab3ad69f339a05e7720902.watermanpaint@gentoo> (raw)

commit:     1743d40a1f3911a846ab3ad69f339a05e7720902
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Fri Aug 16 01:31:33 2024 +0000
Commit:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Fri Aug 16 01:32:29 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1743d40a

net-p2p/p2pool: reapply simplify verify-sig logic (5265984de)

Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>

 net-p2p/p2pool/Manifest          |  2 +-
 net-p2p/p2pool/p2pool-4.1.ebuild | 52 +++++++++++-----------------------------
 2 files changed, 15 insertions(+), 39 deletions(-)

diff --git a/net-p2p/p2pool/Manifest b/net-p2p/p2pool/Manifest
index d10a9a7b0..6214cb820 100644
--- a/net-p2p/p2pool/Manifest
+++ b/net-p2p/p2pool/Manifest
@@ -1,4 +1,4 @@
 DIST p2pool-4.0.tar.xz 127772256 BLAKE2B 77de14bd19f43483fa7da0e65f8a27d5f6cf8c2daf5d8d5e07be373c752794bd35c421fd812b65328acd22004766ff235e9ad6e7e613d08ca3c27ac95153cbc3 SHA512 ea37993d13342b303902e6aa6acb090a908ba99ae304d9415480ff39a3647c84a963ab80b317c9c78a9f11631e0ca9547a08c6e0c23b83892037b63d4beef7a2
+DIST p2pool-4.1.tar.xz 127754740 BLAKE2B 6d46920d5fe116f65950bb9dd2fee7feed45f911817302a6c5047602431febac1abacd508fa6f64a84303014212426994a64a26db124501127aee5aed5da1825 SHA512 c0d90fa6b1390a9e0744772b574ab48f78a95980a263d03970adcf51bf7abdf40cefdcafb95daca16c004674b593647f48960bfc8c2630f4852d1c0a9c3b0bb0
 DIST p2pool-4.0_shasums.asc 2038 BLAKE2B f8f20875a9fa4771753b1eade7c609be761f007ac32a0641109d87890bdd7f2123f11a203d56ffcca5b74b16667e0d8288479688938935434b86875c6c72959c SHA512 bf4a933a81ce9bd48bf293a26d3e4e75b82c67fcfd48d79c57dd86aaac2c2cd54def43b47b05222e0b93fd61623d2c116c403531500a93d45059bca4a0dd3cb4
 DIST p2pool-4.1_shasums.asc 2007 BLAKE2B 29dfa3e0620f1ce88ed4a0dcad45f0d5b0eb00d2dd063fe83feb9d027e8e58b6e15cdc9244832a9d6f406a3ee3c8fe2b710554336b93d5af71d17b17acd3b0f5 SHA512 a17784e5ec3d181c0218016c2bb69b5b467f33eac3dea0a31e146703b02d6de202bc6f6628abda439aa9846b7e86773d0ae1440453d0a9a5532a097ad5d974f8
-DIST p2pool-4.1_source.tar.xz 127754740 BLAKE2B 6d46920d5fe116f65950bb9dd2fee7feed45f911817302a6c5047602431febac1abacd508fa6f64a84303014212426994a64a26db124501127aee5aed5da1825 SHA512 c0d90fa6b1390a9e0744772b574ab48f78a95980a263d03970adcf51bf7abdf40cefdcafb95daca16c004674b593647f48960bfc8c2630f4852d1c0a9c3b0bb0

diff --git a/net-p2p/p2pool/p2pool-4.1.ebuild b/net-p2p/p2pool/p2pool-4.1.ebuild
index fd912d246..0b1c5ce15 100644
--- a/net-p2p/p2pool/p2pool-4.1.ebuild
+++ b/net-p2p/p2pool/p2pool-4.1.ebuild
@@ -1,7 +1,6 @@
-# Copyright 2022 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-#TODO: verify hell script is safe
 #TODO: enable/fix GRPC dependency and add it as USE flag (https://github.com/SChernykh/p2pool/issues/313)
 
 EAPI=8
@@ -11,7 +10,7 @@ inherit cmake verify-sig
 DESCRIPTION="Decentralized pool for Monero mining"
 HOMEPAGE="https://p2pool.io"
 SRC_URI="
-	https://github.com/SChernykh/p2pool/releases/download/v${PV}/p2pool_source.tar.xz -> ${P}_source.tar.xz
+	https://github.com/SChernykh/p2pool/releases/download/v${PV}/p2pool_source.tar.xz -> ${P}.tar.xz
 	verify-sig? ( https://github.com/SChernykh/p2pool/releases/download/v${PV}/sha256sums.txt.asc -> ${P}_shasums.asc )
 "
 
@@ -28,44 +27,21 @@ BDEPEND="
 	verify-sig? ( sec-keys/openpgp-keys-schernykh )
 "
 
-VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/SChernykh.asc
-
 src_unpack() {
 	if use verify-sig; then
-		#what we want to do is `verify-sig_verify_signed_checksums ${P}_shasums.asc sha512 p2pool_source.tar.xz`
-		verify-sig_verify_message "${DISTDIR}/${P}_shasums.asc" "${WORKDIR}/p2pool_shasums.txt"
-		
-		#start of hell script
-		hellscript_stage=0
-		tr -d '\r' < p2pool_shasums.txt | while IFS='' read -r LINE; do
-			if [ "$hellscript_stage" -eq 0 ] && [ "$LINE" = "Name: p2pool_source.tar.xz" ]; then
-				hellscript_stage=1
-				continue
-			fi
-			if [ "$hellscript_stage" -eq 1 ]; then
-				hellscript_sizestring="Size: $(cat ${DISTDIR}/${P}_source.tar.xz | wc -c) bytes"
-				if [ "${LINE:0:"${#hellscript_sizestring}"}" = "$hellscript_sizestring" ]; then
-					hellscript_stage=2
-					continue
-				else
-					die
-				fi
-			fi
-			if [ "$hellscript_stage" -eq 2 ]; then
-				hellscript_shaprefix="SHA256: "
-				if [ "${LINE:0:"${#hellscript_shaprefix}"}" = "$hellscript_shaprefix" ]; then
-					echo "$(echo "${LINE:"${#hellscript_shaprefix}"}" | tr '[:upper:]' '[:lower:]')  ${DISTDIR}/${P}_source.tar.xz" \
-					 > "${WORKDIR}/src_shasum.txt"
-				else
-					die
-				fi
-				break
-			fi
-		done
-		verify-sig_verify_unsigned_checksums "${WORKDIR}/src_shasum.txt" sha256 "${DISTDIR}/${P}_source.tar.xz"
-		#end of hell script
+		local VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/SChernykh.asc
+		pushd "${DISTDIR}" > /dev/null || die
+		verify-sig_verify_message ${P}_shasums.asc - | \
+			tr \\r \\n | \
+			tr '[:upper:]' '[:lower:]' | \
+			sed -n '/p2pool_source/,$p' | \
+			grep -m 1 sha256: | \
+			sed "s/sha256: \(.*\)/\1 ${P}.tar.xz/" | \
+			verify-sig_verify_unsigned_checksums - sha256 ${P}.tar.xz
+		assert
+		popd || die
 	fi
-	unpack ${P}_source.tar.xz
+	unpack ${P}.tar.xz
 	mv -T "${WORKDIR}"/${PN} "${WORKDIR}"/${P} || die
 }
 


             reply	other threads:[~2024-08-16  1:50 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16  1:50 Lucio Sauer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-06  1:28 [gentoo-commits] repo/proj/guru:dev commit in: net-p2p/p2pool/ Adam Pimentel
2024-08-14  8:47 Ronny Gutbrod
2024-08-13  0:42 Lucio Sauer
2024-08-01 20:24 Adam Pimentel
2024-07-18  9:19 David Roman
2024-07-16 14:36 Adam Pimentel
2024-01-04 22:51 Adam Pimentel
2023-11-26 21:05 Adam Pimentel
2023-10-31 16:03 Adam Pimentel
2023-10-05 13:18 David Roman
2023-09-30 16:35 Adam Pimentel
2023-09-08  7:40 Adam Pimentel
2023-09-04 17:01 Adam Pimentel
2023-09-01 15:52 Adam Pimentel
2023-08-31 23:53 Adam Pimentel
2023-08-31 23:24 Adam Pimentel
2023-07-01  0:22 Adam Pimentel
2023-06-01 23:50 Adam Pimentel
2023-04-30 17:06 Adam Pimentel
2023-04-01 12:35 Anna Vyalkova
2023-04-01  7:42 Adam Pimentel
2023-03-01 19:20 Adam Pimentel
2023-02-03  4:21 Adam Pimentel
2023-01-27 21:06 Adam Pimentel
2022-12-18  0:08 Adam Pimentel
2022-12-10  7:56 Viorel Munteanu
2022-12-05 17:59 Adam Pimentel
2022-12-05 16:33 Adam Pimentel
2022-12-05  9:20 [gentoo-commits] repo/proj/guru:master " Viorel Munteanu
2022-12-04 12:37 ` [gentoo-commits] repo/proj/guru:dev " Viorel Munteanu
2022-12-04 16:56 Adam Pimentel
2022-12-01 14:36 Adam Pimentel
2022-12-01 14:30 Adam Pimentel
2022-12-01 14:30 Adam Pimentel
2022-11-29 13:09 Adam Pimentel
2022-11-28 17:21 Adam Pimentel
2022-11-09 22:45 Adam Pimentel
2022-09-09 22:03 Adam Pimentel
2022-09-09  2:29 Adam Pimentel
2022-09-09  2:29 Adam Pimentel
2022-09-09  2:01 Adam Pimentel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1723771949.1743d40a1f3911a846ab3ad69f339a05e7720902.watermanpaint@gentoo \
    --to=watermanpaint@posteo.net \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox