From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IHmJIzthOGPB/AAAbAwnHQ (envelope-from ) for ; Sat, 01 Oct 2022 17:48:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EF6NIjthOGMrOwEAG6o9tA (envelope-from ) for ; Sat, 01 Oct 2022 17:48:11 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 49F78E620 for ; Sat, 1 Oct 2022 17:48:11 +0200 (CEST) Received: from localhost ([::1]:35966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oeeio-0001Pn-FV for larch@yhetil.org; Sat, 01 Oct 2022 11:48:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeeih-0001Pc-9L for guix-patches@gnu.org; Sat, 01 Oct 2022 11:48:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oeeig-00013R-M9 for guix-patches@gnu.org; Sat, 01 Oct 2022 11:48:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oeeig-0002xe-HY for guix-patches@gnu.org; Sat, 01 Oct 2022 11:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58230] [PATCH] build: copy-build-system: Add #:output filter. Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Oct 2022 15:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58230 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58230@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166463925011239 (code B ref -1); Sat, 01 Oct 2022 15:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Oct 2022 15:47:30 +0000 Received: from localhost ([127.0.0.1]:45599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeeiA-0002vD-07 for submit@debbugs.gnu.org; Sat, 01 Oct 2022 11:47:30 -0400 Received: from lists.gnu.org ([209.51.188.17]:44288) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oeei8-0002v5-13 for submit@debbugs.gnu.org; Sat, 01 Oct 2022 11:47:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeei7-0001Ng-Rw for guix-patches@gnu.org; Sat, 01 Oct 2022 11:47:27 -0400 Received: from mail.boiledscript.com ([144.168.59.46]:57556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oeei6-0000yB-7N for guix-patches@gnu.org; Sat, 01 Oct 2022 11:47:27 -0400 Date: Sat, 01 Oct 2022 23:46:44 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1664639240; 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=Tsn4ewYFUTqURAFbzVi0bM7oHXrRVTRFUc75WouV60E=; b=u5gesgngeI8YM+xESfE+kFZvkEz53XuZohPkqcpv2FBGYH+Lsk2SoZediMSvzK/sU2UMGW Fbzzhs341GeM6CDT1CnPE5xZjiHRA5tXc2+LEMo1f/jUKSslCvscxOP2FINDUhmzYZotIN J0eWzGCwUF/fTsvigweOdnKwQuUxW1YiR59EUAB1DDBQgVyGC5YFWwfFDLlLLwSL/DVSFi 81MhWDrn9QNsJsRj8jV/d1MmHdhRWcxNvkiePP+S5vE1LjyjMNqholuU9moPU0850L0IAt eMTNAKYMoeCl3s1mua/o4FJvxWXW8uq84ZBa0mrS+dc4vYr0qnfx4jQ88PrbBg== Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-Spamd-Bar: / Received-SPF: pass client-ip=144.168.59.46; envelope-from=hako@ultrarare.space; helo=mail.boiledscript.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Hilton Chain X-ACL-Warn: , Hilton Chain via Guix-patches From: Hilton Chain via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664639291; h=from:from:sender:sender:reply-to: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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Tsn4ewYFUTqURAFbzVi0bM7oHXrRVTRFUc75WouV60E=; b=cUeQ6KR7c1G9tb2kicN/RxjqXtDItuq8yCElHhqnmhHfYnL9kPanKe13VnaPDibaF4pTnz m6MwKW9sGi9JfTJcLA3eyY2o62k6oUG5NQDnUbpvOYZe2UVIrCPz8/iSujzqdk/I8nroC4 eJyq3lke6cwa0rgrR6rl7LUlvUiIBrKes3kgsSp8QciFZJi0Qi/YwC1ipTVYNuBVcvpG1c tzS2Z36/dL764Bbu85Sx99CPl6cScXJzDHlGIN3ZFif/tVS/FHGjmLscCEIwhHPhXKsgYh WdqyB8+sIdS413+qaoTcM62JqpSSWFFXlexV2BX6nBGe+1RHFuUkMzXB5j3r/Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664639291; a=rsa-sha256; cv=none; b=hdKNZxSafFQE4JbcIAPUmSx3RnmQyN4hNG7RcEyzKHgo57luYLu3E6etP/xZbSYOYl3u9l oOP4Y5BDoIwh32BR/660ziGdQLmnB1g14+ThOnxH8uM/o1cYgEcGbkUElEENcmWiBF73jU X9sBNimLKwxy12ZFV1QZwLQiN3+LSJKTVe6VLwvSb6bLqwx8jaBo+zBsE/8XYc+hkrwUWi wgTSX9OLAzugt9ed6YASDaLJToUgEg8JT0ThJIga4aN+cwj6t2UaSyM09LPSE0a/SlPKJM f1f/VHLVkKUwrClxPjJhf8TeplgXiWzPUPmAjYHv6iE61R8QnagCd3yeCCR9Fg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=u5gesgng; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.84 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=u5gesgng; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 49F78E620 X-Spam-Score: -3.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: y80KyUGUF7hH * guix/build/copy-build-system.scm (install): Add #:output filter. --- guix/build/copy-build-system.scm | 49 +++++++++++++++++++------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm index fb2d1db056..111032eed8 100644 --- a/guix/build/copy-build-system.scm +++ b/guix/build/copy-build-system.scm @@ -54,7 +54,7 @@ (define* (install #:key install-plan outputs #:allow-other-keys) - Without FILTERS, install the full SOURCE _content_ to TARGET. The paths relative to SOURCE are preserved within TARGET. - With FILTERS among `#:include`, `#:include-regexp`, `#:exclude`, - `#:exclude-regexp`: + `#:exclude-regexp`, `#:output`: - With `#:include`, install only the paths which suffix exactly matches one of the elements in the list. - With `#:include-regexp`, install subpaths matching the regexps in the list. @@ -62,6 +62,8 @@ (define* (install #:key install-plan outputs #:allow-other-keys) install every subpath but the files matching the `#:exclude*` filters. If both `#:include*` and `#:exclude*` are specified, the exclusion is done on the inclusion list. + - With `#:output`, install into TARGET of every specified output(s), the + default value is \"out\". Examples: @@ -72,7 +74,13 @@ (define* (install #:key install-plan outputs #:allow-other-keys) - `(\"foo/\" \"share/my-app\" #:include (\"sub/file\"))`: Install only \"foo/sub/file\" to \"share/my-app/sub/file\". - `(\"foo/sub\" \"share/my-app\" #:include (\"file\"))`: Install \"foo/sub/file\" to -\"share/my-app/file\"." +\"share/my-app/file\". +- As the previout example, when not specifying `#:output`: Install \"foo/sub/file\" to +\"share/my-app/file\" of \"out\" output. +- `(\"foo/sub\" \"share/my-app\" #:include (\"file\")) #:output (\"lib\")`: Install +\"foo/sub/file\" to \"share/my-app/file\" of \"lib\" output. +- `(\"foo/sub\" \"share/my-app\" #:include (\"file\")) #:output (\"out\"\"lib\")`: +Install \"foo/sub/file\" to \"share/my-app/file\" of both \"out\" and \"lib\" outputs." (define (install-simple source target) "Install SOURCE to TARGET. TARGET must point to a store location. @@ -133,23 +141,26 @@ (define* (install-file-list source target #:key include exclude include-regexp e (string-append target "/"))) file-list)))) - (define* (install source target #:key include exclude include-regexp exclude-regexp) - (let ((final-target (string-append (assoc-ref outputs "out") "/" target)) - (filters? (or include exclude include-regexp exclude-regexp))) - (when (and (not (file-is-directory? source)) - filters?) - (error "Cannot use filters when SOURCE is a file.")) - (let ((multi-files-in-source? - (or (string-suffix? "/" source) - (and (file-is-directory? source) - filters?)))) - (if multi-files-in-source? - (install-file-list source final-target - #:include include - #:exclude exclude - #:include-regexp include-regexp - #:exclude-regexp exclude-regexp) - (install-simple source final-target))))) + (define* (install source target #:key include exclude include-regexp exclude-regexp (output '("out"))) + (for-each + (lambda (out) + (let ((final-target (string-append (assoc-ref outputs out) "/" target)) + (filters? (or include exclude include-regexp exclude-regexp))) + (when (and (not (file-is-directory? source)) + filters?) + (error "Cannot use filters when SOURCE is a file.")) + (let ((multi-files-in-source? + (or (string-suffix? "/" source) + (and (file-is-directory? source) + filters?)))) + (if multi-files-in-source? + (install-file-list source final-target + #:include include + #:exclude exclude + #:include-regexp include-regexp + #:exclude-regexp exclude-regexp) + (install-simple source final-target))))) + output)) (for-each (lambda (plan) (apply install plan)) install-plan) #t) base-commit: 225e00bd1925487fb045d9184fd249d93accad08 -- 2.37.3