From nobody Fri Nov 11 12:41:51 2022 X-Original-To: freebsd-ports@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 4N7yyj10Ycz4dRXp for ; Fri, 11 Nov 2022 12:42:21 +0000 (UTC) (envelope-from 6yearold@gmail.com) Received: from mail-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N7yyh1dNTz3vjK for ; Fri, 11 Nov 2022 12:42:20 +0000 (UTC) (envelope-from 6yearold@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of 6yearold@gmail.com designates 209.85.222.43 as permitted sender) smtp.mailfrom=6yearold@gmail.com; dmarc=none Received: by mail-ua1-f43.google.com with SMTP id v8so1335574uap.12 for ; Fri, 11 Nov 2022 04:42:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wULSiRJcQsmw0AFrQZcAs3pxDSQrhicIztZXuOFrwC8=; b=T98X/4RIbRDGGeZ5fjM/1Lw1meYuwhR5X6jC6Kp/33Rhxz7X/NY5rKRSJZvz+JNH+1 vkt5LJXGeihVg4ODXDihZNqK3DoKq2OdTH6WgDO7XEmapZ8WviMqi7bONDSqdBPpfLO5 za4WlWKJIK3wex1u2rGlTKboj+JsD/aEM3KG/IF2f+E4TT/0GXVasVp6haF2WQC/X4EM v0o9l46xmCoTMM24gNJrm88bIAvxnppe6cJ1uq8XsMf0869reRdelOcoyXj0YtvRTkWz RKwLjhL0ZahqtuBdLAfed0Y+W72WKCxVdWCLZCCLFIoYPA+fXBMEC26k6HXUTVZJ2Gnp j0nA== X-Gm-Message-State: ANoB5ply9iVOlavSOLkSUSBwShWoTsbOkCRbg9sii/mope70UZiNcCkc 4T2t0py3WujyBFEH17lxALTVxnwLLaPilA== X-Google-Smtp-Source: AA0mqf4S/eXIJJ2y/1EGuFRGkLPngkYn2BiWWfwwfhPjx8s4aDa7gvgFKXpbxJ1+HTRu1HZo/RS2Ug== X-Received: by 2002:ab0:6384:0:b0:411:502d:7c67 with SMTP id y4-20020ab06384000000b00411502d7c67mr602917uao.29.1668170538239; Fri, 11 Nov 2022 04:42:18 -0800 (PST) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id s206-20020a1fa9d7000000b003b8403b7572sm337328vke.6.2022.11.11.04.42.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 04:42:17 -0800 (PST) Received: by mail-vs1-f53.google.com with SMTP id p4so5041929vsa.11 for ; Fri, 11 Nov 2022 04:42:17 -0800 (PST) X-Received: by 2002:a67:e010:0:b0:3a9:7ae1:39d3 with SMTP id c16-20020a67e010000000b003a97ae139d3mr644124vsl.48.1668170537523; Fri, 11 Nov 2022 04:42:17 -0800 (PST) List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org MIME-Version: 1.0 From: Gleb Popov Date: Fri, 11 Nov 2022 15:41:51 +0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Temporary variables in make .for loops To: FreeBSD ports list Content-Type: text/plain; charset="UTF-8" X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.96 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.96)[-0.963]; FORGED_SENDER(0.30)[arrowd@freebsd.org,6yearold@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[arrowd@freebsd.org,6yearold@gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[209.85.222.43:from,209.85.217.53:received]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.222.43:from]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TO_DN_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[freebsd.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-ports@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Queue-Id: 4N7yyh1dNTz3vjK X-ThisMailContainsUnwantedMimeParts: N Hello fellow porters. My variable modifiers are growing and become too incomprehensible, so here is the question I wanted to ask long ago: How do I make and use a temporary variable in the .for loop? This is what I have in Mk/Uses/cabal.mk: . for package in ${_use_cabal} _PKG_GROUP= ${package:C/[\.-]//g} MASTER_SITES+= https://hackage.haskell.org/package/:${package:C/[\.-]//g} . endfor I'd like to write ${_PKG_GROUP} instead of repeating that regexp incantation, but due to specifics of .for operation it doesn't work. Using := with _PKG_GROUP also doesn't fix the problem. Now I need to add another regexp substitution to every expression inside this loop and it'll become even less readable than before. Is there a clean solution to this problem? Thanks in advance.