From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4674E158091 for ; Fri, 3 Jun 2022 18:36:49 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 48AA0E093E; Fri, 3 Jun 2022 18:36:48 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 22903E093E for ; Fri, 3 Jun 2022 18:36:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1E7D33425CD for ; Fri, 3 Jun 2022 18:36:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9C22B47E for ; Fri, 3 Jun 2022 18:36:45 +0000 (UTC) From: "Kenton Groombridge" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kenton Groombridge" Message-ID: <1654261657.497edc4c920a2a01f91e5af51f118d21ef0b140a.concord@gentoo> Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: gentoo/ X-VCS-Repository: proj/hardened-refpolicy X-VCS-Files: gentoo/release-userspace.sh X-VCS-Directories: gentoo/ X-VCS-Committer: concord X-VCS-Committer-Name: Kenton Groombridge X-VCS-Revision: 497edc4c920a2a01f91e5af51f118d21ef0b140a X-VCS-Branch: master Date: Fri, 3 Jun 2022 18:36:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 14c13594-130e-48f8-92cc-576d41725aa3 X-Archives-Hash: 530cc6fb38b7d4ff1471e1577b47a51d commit: 497edc4c920a2a01f91e5af51f118d21ef0b140a Author: Kenton Groombridge gentoo org> AuthorDate: Wed Jun 1 18:23:13 2022 +0000 Commit: Kenton Groombridge gentoo org> CommitDate: Fri Jun 3 13:07:37 2022 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=497edc4c Make release-userspace script prefer pkgdev Use pkgdev and pkgcheck if they are available and fallback to repoman otherwise. Signed-off-by: Kenton Groombridge gentoo.org> gentoo/release-userspace.sh | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/gentoo/release-userspace.sh b/gentoo/release-userspace.sh index 93565f23..4b81d2fd 100644 --- a/gentoo/release-userspace.sh +++ b/gentoo/release-userspace.sh @@ -21,6 +21,9 @@ sys-apps/restorecond # app-admin/setools not released together # dev-python/sepolgen became selinux-python in 2.7 release +SCAN="$(command -v pkgcheck || command -v repoman)" +COMMIT="$(command -v pkgdev || command -v repoman)" + usage() { echo "Usage: $0 " echo "" @@ -51,6 +54,20 @@ die() { exit 2 } +# scan the tree for QA issues with pkgcheck or repoman +doScan() { + if [[ "$(basename "${SCAN}")" == "pkgcheck" ]]; then + "${SCAN}" -q scan --staged + else + "${SCAN}" -q full + fi +} + +# commit the current staged changes with pkgdev or repoman +doCommit() { + "${COMMIT}" -q commit -m "${@}" +} + # set the release date in the live ebuilds so it will be correct when copying to the new version updateLiveEbuilds() { local PKG @@ -80,10 +97,10 @@ updateLiveEbuilds() { # commit changes git add "${PN}-9999.ebuild" git --no-pager diff --cached - repoman -q full + doScan if [[ $? -eq 0 ]] then - repoman -q commit -m "$PKG: update live ebuild" + doCommit "$PKG: update live ebuild" else git reset -- . fi @@ -112,14 +129,14 @@ createEbuilds() { sed -i -e "/${PN}-${NEWVERSION//_/-}/d" Manifest || die cp ${PN}-9999.ebuild ${PN}-${NEWVERSION}.ebuild || die - repoman -q manifest || die + "${COMMIT}" -q manifest || die git add Manifest ${PN}-${NEWVERSION}.ebuild || die #git --no-pager diff --cached - repoman -q full + doScan if [[ $? -eq 0 ]] then - repoman -q commit -m "$PKG: bump to ${NEWVERSION}" || die + doCommit "$PKG: bump to ${NEWVERSION}" || die else git reset -- . || die fi