From nobody Wed Jul 12 19:17:31 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R1SDX1xhcz2trsn; Wed, 12 Jul 2023 19:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R1SDX1WfQz3NkD; Wed, 12 Jul 2023 19:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689189452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nVRGTbNDhho+ARunm/klz1vj4y8hHsr7NdjSkHb5+po=; b=xhrobUONfQjSdIbyyooEuk548Okt1Vc3RQNLAMpmWjj1WT2QUHO4prEOrg+bw1s9Cj6SkX iCWFPQx0xRc/S+F1Ow/0ElP2X/hHRdp05KS6w+y/+QbP4LKYxemeeyxFsGVnp7I1GdMtEd 2Jq+lr8P8KOw39PvUrxWUGH5NFMPYAwI8v9ZRROqtrnV3LdCBD+hNrSXeqePjYZxoeOsJ5 5iZ4O9zkAed96zACS5rRIAdyncMPFPhBH14JAWiMFJXW/qwEjRV6Sk5jRQrI6MYQQxlfZX r42OoqPQVNgzvwu10/m6t51TKHOwo+K8rEXTCnt3Je37b6B+kc1vqW3Q0a1dfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689189452; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nVRGTbNDhho+ARunm/klz1vj4y8hHsr7NdjSkHb5+po=; b=rnCVGon/cNWqAHI0I4+zZIB7H+yS81svP2ZLXYrJqJwmjDL25bESt/gCJxx2UWJif1tuJQ G+lj/P02/m4fskqYq+lhdeEIXqjc5TY5vyN2IyMZTEtzbgSarQ77OYoPolPkx+KYotYBUX JddF0AFhGfMVvmPBUqnkq8BwgOIVztadtKvYx486JxafhgG/g/CGTUX1Ps1wwgt0IG4kTX qqxhf5v1a1R+8yX4LK7i06uoO6IYPvwU/5IDZQqfFC/Vj3zqH4DC9M7hc62rbG2pUxfwWR SC1Tvol8fxpUlX73wN3OIXGVl41pQ8AAZqJKQsS4X3miGOsH3XWplyG2O/YbCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689189452; a=rsa-sha256; cv=none; b=N9ctn30C8SfyEjETaeQPxSOAcJTkIPrp78OO1e8oJJ4n1ODiwlj6+taHVawrZUc9AgnibI NggQenYkqOXj0QcUwzbn9bGBt+N29XbsHjZ9MIMXj4k+2t1WO3h3bD01OEavznfrv0kETA dSuiONbJLvoC/L4X6tnBVne0vKomfLp96X+hocxdvEpVznHVH06UKUZgvm+0Zvv9AclYQV vCHtZS/bsQtnFk/EKLYFvWSLXasje57HV4gz1XFSNE0UUmE9gGj6Z9shlhwGZW1Pv5tJUr gtCTW9dT4iAGb8ribgVluuJ79AThdBAtzq841rreS2BYpOD9z6HpdrscVYi8QQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R1SDX0SwCzM5F; Wed, 12 Jul 2023 19:17:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36CJHVKb008798; Wed, 12 Jul 2023 19:17:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36CJHVWR008797; Wed, 12 Jul 2023 19:17:31 GMT (envelope-from git) Date: Wed, 12 Jul 2023 19:17:31 GMT Message-Id: <202307121917.36CJHVWR008797@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 39a98a35c17a - main - Tools/scripts: Improve update-rust-port.sh List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 39a98a35c17a9b3721f215b4dd1acee3a41363a6 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=39a98a35c17a9b3721f215b4dd1acee3a41363a6 commit 39a98a35c17a9b3721f215b4dd1acee3a41363a6 Author: Yuri Victorovich AuthorDate: 2023-07-12 19:14:57 +0000 Commit: Yuri Victorovich CommitDate: 2023-07-12 19:17:29 +0000 Tools/scripts: Improve update-rust-port.sh * use strict shell mode * check dependencies * update PORTREVISION Suggested by: mikael@ (use of portedit) --- Tools/scripts/update-rust-port.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/update-rust-port.sh b/Tools/scripts/update-rust-port.sh index 7e479f87822a..80edc8347f71 100755 --- a/Tools/scripts/update-rust-port.sh +++ b/Tools/scripts/update-rust-port.sh @@ -2,12 +2,25 @@ # # MAINTAINER: yuri@FreeBSD.org +# CAVEAT: ports with Makefile.crates are not yet supported + ## args VERSION="$1" +## set strict mode + +STRICT="set -euo pipefail" +$STRICT + ## checks +for dep in portedit rustc; do + if ! which -s $dep; then + echo "error: $dep dependency is missing, $0 requires lang/rust and ports-mgmt/portfmt to be installed" >&2 + exit 1 + fi +done if [ -z "$VERSION" ]; then echo "Usage: $0 " exit 1 @@ -22,8 +35,13 @@ fi # copy Makefile cp Makefile Makefile.new -# substitute version -sed -i '' -E "s/(VERSION=[\t ]*)[0-9.]+/\1${VERSION}/" Makefile.new +# substitute version tag PORTVERSION or DISTVERSION +sed -i '' -E "s/^(PORT|DIST)(VERSION=[\t ]*)[0-9.-]+/\1\2${VERSION}/" Makefile.new + +# reset PORTREVISION if present +if grep -q "PORTREVISION=" Makefile; then + echo PORTREVISION=0 | portedit merge -i Makefile.new +fi # replace CARGO_CRATES with a placeholder /usr/bin/awk '