From nobody Sun Nov 20 17:39:54 2022 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 4NFd7t3wRSz4hk3C; Sun, 20 Nov 2022 17:39:54 +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 4NFd7t3P72z4MQR; Sun, 20 Nov 2022 17:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668965994; 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=VWqqmtd5u/YBVYqkH8r8nZ4srLQCKfWRC/nRu9v50BE=; b=EPuvvjlWBQFl7PRsFNQsT9Mq4jDd28Bh54LwU/1wIPdiFlip9g/6ehyhuFruKIiPc8eW7O vrVgfYKd6EJexU4Z74olfuU/lWQQI1MnQppC7Y8KuwznGQgkSPlwvdDyPusC8vLEMZrdfL xRP62pOVJlu2mX0V3sruKg9kcaCpMLPCPZdVFmwPAkeyeV1PHD/+7oVQHxhMU1lWpoQjKI dQvk+ZCfMClZiZD3w5SLYNDm2bD4TP2xlmSTTJHrO/Lwo011dKxXE8tBsKHgqhliJY6jMk ehp8c0hj5HZXswJFdM4f855pzF3TBLlRWTKJbcEKCjhWd32CjbXeDbWnDqFz6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668965994; 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=VWqqmtd5u/YBVYqkH8r8nZ4srLQCKfWRC/nRu9v50BE=; b=Qfje8C7StAQ4co9qCaqwisNBd38sKuVI+ACU1U9JzkTV6gDCc/cnoiaIVx1C7KTSIYKcsq o4njwWUm+SAi+8dFPCY0Q7wW6MiEvNAfnUFlx3b1UMfKtEU0hbnM09mLNZNqCTeUarM7uA f+yWdajOqhuUyKRcqkdl/hZbq0wQNvL+AnCllh2J8Gd/0xZ2+dCJMxyWzzGxspV1Yow4mt uH3ObVuzALOVgwuY5ukq7T3d4oaU2nXAq0n9t0Hi5yyjqfRdNR8T5TpQK7/sjfu1AH7vig K/H7OB5UEyRShX31OTAt9o8w0Cl34KwvMmAFVWKHkqAvpL2CQgNhvW/4CR/28A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668965994; a=rsa-sha256; cv=none; b=cRDTwk7X1h/qr4fabgfEBpb7umOGcwFSGM0bPjzVyniHFWerEBFaE7fnLglaHzEwqWOUcy bH8cYh04u71aD2/c6zP9sfavdH3fjxHSDgkgREyfI7eb6DL+7uVu8+iEGL86UCr29fFUZP JEqCDL4vNZ9kGiXRVrceN5fJni3Y84SqtIBOwTEdqy45WKzHfPcIkMF/8qtJ79JJwtfCEa R+p5o703fVTtI0Cpiuyljb9su3xv9H6DR3pjh3eqJYMEr4SLkXaJA1JmL2x1RAyhH2vgW0 mebrDfPC3pAd1ah5owo6Mza4JsE9B9Iian9gdWKpDsYvY6Fv/K+P+UvdqSWEJQ== 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 4NFd7t2VRWzY2C; Sun, 20 Nov 2022 17:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AKHdsUO053842; Sun, 20 Nov 2022 17:39:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AKHdsAg053841; Sun, 20 Nov 2022 17:39:54 GMT (envelope-from git) Date: Sun, 20 Nov 2022 17:39:54 GMT Message-Id: <202211201739.2AKHdsAg053841@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: d72b566da395 - main - Uses/cabal.mk: Use .for directive to introduce temporary variables inside loops. 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: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d72b566da395ab655a5083e1240066304c6875fd Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=d72b566da395ab655a5083e1240066304c6875fd commit d72b566da395ab655a5083e1240066304c6875fd Author: Gleb Popov AuthorDate: 2022-11-14 07:00:49 +0000 Commit: Gleb Popov CommitDate: 2022-11-20 17:39:27 +0000 Uses/cabal.mk: Use .for directive to introduce temporary variables inside loops. Suggested by: tijl --- Mk/Uses/cabal.mk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Mk/Uses/cabal.mk b/Mk/Uses/cabal.mk index 81c487782f87..d08559d4dec0 100644 --- a/Mk/Uses/cabal.mk +++ b/Mk/Uses/cabal.mk @@ -136,19 +136,15 @@ BUILD_TARGET?= ${CABAL_EXECUTABLES:S/^/exe:&/} _use_cabal= ${USE_CABAL:O:u} . for package in ${_use_cabal} -_PKG_GROUP= ${package:C/[\.-]//g} -_PKG_WITHOUT_REV= ${package:C/_[0-9]+//} -_REV= ${package:C/[^_]*//:S/_//} - -MASTER_SITES+= https://hackage.haskell.org/package/:${package:C/[\.-]//g} \ - http://hackage.haskell.org/package/:${package:C/[\.-]//g} -DISTFILES+= ${package:C/_[0-9]+//}/${package:C/_[0-9]+//}${CABAL_EXTRACT_SUFX}:${package:C/[\.-]//g} - -. if ${package:C/[^_]*//:S/_//} != "" -DISTFILES+= ${package:C/_[0-9]+//}/revision/${package:C/[^_]*//:S/_//}.cabal:${package:C/[\.-]//g} +. for pkg_group pkg_name xrev in ${package:C/[\.-]//g} ${package:C/_[0-9]+//} x${package:C/[^_]*//:S/_//} +MASTER_SITES+= https://hackage.haskell.org/package/:${pkg_group} \ + http://hackage.haskell.org/package/:${pkg_group} +DISTFILES+= ${pkg_name}/${pkg_name}${CABAL_EXTRACT_SUFX}:${pkg_group} +. if ${xrev} != "x" +DISTFILES+= ${pkg_name}/revision/${xrev:S/x//}.cabal:${pkg_group} . endif - -_CABAL_EXTRACT_ONLY+= ${package:C/_[0-9]+//}/${package:C/_[0-9]+//}${CABAL_EXTRACT_SUFX} +_CABAL_EXTRACT_ONLY+= ${pkg_name}/${pkg_name}${CABAL_EXTRACT_SUFX} +. endfor . endfor . if !defined(EXTRACT_ONLY) @@ -232,13 +228,15 @@ cabal-post-extract: # Move extracted dependencies into ${CABAL_DEPSDIR} directory ${MKDIR} ${CABAL_DEPSDIR} . for package in ${_use_cabal} +. for pkg_name xrev in ${package:C/_[0-9]+//} x${package:C/[^_]*//:S/_//} # Copy revised .cabal file if present -. if ${package:C/[^_]*//:S/_//} != "" - cp ${DISTDIR}/${DIST_SUBDIR}/${package:C/_[0-9]+//}/revision/${package:C/[^_]*//:S/_//}.cabal `find ${WRKDIR}/${package:C/_[0-9]+//} -name '*.cabal' -depth 1` -. endif +. if ${xrev} != "x" + cp ${DISTDIR}/${DIST_SUBDIR}/${pkg_name}/revision/${xrev:S/x//}.cabal `find ${WRKDIR}/${pkg_name} -name '*.cabal' -depth 1` +. endif # Move the dependency source itself cd ${WRKDIR} && \ - mv ${package:C/_[0-9]+//} ${CABAL_DEPSDIR}/ + mv ${pkg_name} ${CABAL_DEPSDIR}/ +. endfor . endfor # Create the cabal-install config ${MKDIR} ${CABAL_HOME}/.cabal @@ -254,7 +252,9 @@ cabal-post-patch: ${ECHO_CMD} "-- added by USES=cabal" >> ${WRKSRC}/cabal.project.local ${ECHO_CMD} "packages:" >> ${WRKSRC}/cabal.project.local . for package in ${_use_cabal} - ${ECHO_CMD} " ${CABAL_DEPS_SUBDIR}/${package:C/_[0-9]+//}" >> ${WRKSRC}/cabal.project.local +. for pkg_name in ${package:C/_[0-9]+//} + ${ECHO_CMD} " ${CABAL_DEPS_SUBDIR}/${pkg_name}" >> ${WRKSRC}/cabal.project.local +. endfor . endfor . endif # SKIP_CABAL_EXTRACT && !CABAL_COOKIE