From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CNagNau5dGGZrwAAgWs5BA (envelope-from ) for ; Sun, 24 Oct 2021 03:40:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yFghMau5dGEAJQAAbx9fmQ (envelope-from ) for ; Sun, 24 Oct 2021 01:40:59 +0000 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 5C809FF17 for ; Sun, 24 Oct 2021 03:40:59 +0200 (CEST) Received: from localhost ([::1]:49964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meS8B-0004fK-1R for larch@yhetil.org; Sat, 23 Oct 2021 21:16:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meS7G-0003hu-F1 for bug-guix@gnu.org; Sat, 23 Oct 2021 21:16:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meS7G-0005SK-5f for bug-guix@gnu.org; Sat, 23 Oct 2021 21:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1meS7G-0001hz-1G for bug-guix@gnu.org; Sat, 23 Oct 2021 21:16:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#51258: [PATCH v3] gnu: emacs: Handle pdump filenames that contain a fingerprint References: In-Reply-To: Resent-From: Morgan.J.Smith@outlook.com Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 24 Oct 2021 01:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51258 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 51258@debbugs.gnu.org, paxton@riseup.net, liliana.prikler@gmail.com Received: via spool by 51258-submit@debbugs.gnu.org id=B51258.16350381336530 (code B ref 51258); Sun, 24 Oct 2021 01:16:01 +0000 Received: (at 51258) by debbugs.gnu.org; 24 Oct 2021 01:15:33 +0000 Received: from localhost ([127.0.0.1]:37576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meS6n-0001hG-FT for submit@debbugs.gnu.org; Sat, 23 Oct 2021 21:15:33 -0400 Received: from mail-bn8nam11olkn2057.outbound.protection.outlook.com ([40.92.20.57]:49376 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1meS6h-0001gy-UT for 51258@debbugs.gnu.org; Sat, 23 Oct 2021 21:15:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DttSj9ChFHktS2wLISYJw3uJ82JXIMBzwRj5XbEt0zdsL/UyM62Hq5fgyFdR7vaNSNO0fVKneTTr5AvXtxTS4KXJoj/qcM8W7F2/n5VWgMdDZFtKRfu82mi0nuMPPqeLIFueKvSFwpEEwQfHaWYev1f4dM55wTJ0WD1AV/4fHjUX/xCs40S6iQxXbvWSQ9DqxWb/pAvWC8XGd4I40o1+SNHjGoHQ20ZsgpDoagdtkY94NTmy9vood3EYyIYBVJf2y6CSjhp6Sd6Ut1+Rv9ySAFXSqtrYEFCAVIK7fwmEzZyOjQqniMVJF8gwxttKdjqp4seDGhPHZTdWLIxXcAx0Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=int8sUlJnXzh/BclgifOjfXl3Wojg/W+t2FRwDiNJzE=; b=AzSDDVEkqATFqGFYx3L6dkz1tBNdZFQ3WmSnNJqc3PKz+YiKWyVwjJW4/nVLjU12xa/DW1DnD2wcyfbeEyxllkiAXFrUH6618dksXEtB7BoBuCdI+dKJZc+C5bZkwKO77P4rRD3rCFZkg2t15HdXD9Jqs12ZWqlDzH848YKkMjqvAlRD4KaKZNpAaO1eXaB6vVSPp8XBIFAjVnekciDo4HJURe3SsrhUzj7JnsV1C+fRiJmEo0zVzrsjlbBnZHqTvajVe631AsIch3FTKCDidgzfddqznlyzO2LqexXDJ5Uh8c0Qo9Q8KB+DXPziWYPnpEN3KMHB2MlGSugqeAmkNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=int8sUlJnXzh/BclgifOjfXl3Wojg/W+t2FRwDiNJzE=; b=sw0A3gJUoZjYVxoTbev9u7qguDq3sVAsTdSw/mSLVxc9cDlgW8ERQFlZkgzCw1DiA7aqmY32uXju2k0LVPO89ANbVtC1p+9XEfm2ZQdXYDvMwE3PR3wm43kpo0g9A6xNl+PefVzwz54bfEBzkgHoizKlLfhZXtXwQtsoaDSc+TX/TfT5p6MqzUiEZ3RuIxZJja73fSYQOXNWL259iK8ynd0ylM0s2KdBZbNU6Ma/sq7r7Dg/CsNDa4TMz1be6BVKq7+Vsowkssmxl/4wcDXUQoDGxfyRp+iIArDeLNwaNU1RP4Cs7dUxPTtz6pRXwpnk5jJhvNxi8JivtR+9B0CGdw== Received: from BYAPR05MB4023.namprd05.prod.outlook.com (2603:10b6:a02:87::30) by BYAPR05MB4261.namprd05.prod.outlook.com (2603:10b6:a02:f6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.11; Sun, 24 Oct 2021 01:15:20 +0000 Received: from BYAPR05MB4023.namprd05.prod.outlook.com ([fe80::745d:ce8d:67ec:5154]) by BYAPR05MB4023.namprd05.prod.outlook.com ([fe80::745d:ce8d:67ec:5154%6]) with mapi id 15.20.4628.018; Sun, 24 Oct 2021 01:15:20 +0000 From: Morgan.J.Smith@outlook.com Date: Sat, 23 Oct 2021 21:00:15 -0400 Message-ID: X-Mailer: git-send-email 2.33.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [hrRyI6O9ry1iVCVpsI69knBJyhevkgNl] X-ClientProxiedBy: YQBPR01CA0004.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01::12) To BYAPR05MB4023.namprd05.prod.outlook.com (2603:10b6:a02:87::30) X-Microsoft-Original-Message-ID: <20211024010014.12659-1-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from workpad.hitronhub.home (170.52.80.188) by YQBPR01CA0004.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Sun, 24 Oct 2021 01:15:19 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 878a44a4-129f-4606-acfc-08d9968bbf12 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNUM9Q2EBuqQX3AYmbXvRMdLLHqiHJFJ+WplnEJQmDf+P8KGm9R1v8d3Ymi5YTJVxXdC02VTlFKsD5nxgH8uqnrtbi98cu/7pVPsA7Pt55xrkGndnNo1wlXj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c/Vt7hkPzaEMKCkyUNU+PvwqIzzspVgsCMuNe5cwM5iaCYjDwFISF83vH57MbcIQHwaawTyuXvfhfBBlSo6SUDsC46roqOsWWSRJ2VJxr0ms7jhO3VTU3aAz2h6Ln+rUyk+VfNkxLZlTqsdlditICJRbiNkyrMupbU1GhYs/sDYwLtmqu000KbWMU= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NjEJt+RKw9f3nlE/qrqVXSXo6l0bITvevO1RoIUPpLL08F7Y6uzhWm5X0pOVNC69rTtGmIcsQbqXPxoEby7WsgLN9roE9BYWZ4geRtZbXErNW/jy41hCp+KnQ+HGS4hR+J7h/ofPx+8HbWisfnZpJjSEJiXJQ1pNOYl7MUlUu/jEBxuDHCNDhss94ekpvg7+847EIiZjTPrSEn9GwKVeU8GApbDTiud4J5Mxlm8DqakricZoDZnK16l52XhZ0S6hYqGt1UwXAkrVr0g3ap2guRDcqVwgnUALnNf8QhXuzHIeRvWxauhup558fhOFuSq32p/bfXGpCqrSuXgo9OVJNz+XcMBvNJce+3J6iFVSwxwIe0SSLryS2+3RA0WWKGCwi1k2Ei5mWSadJnP+Un5yupsaLWc8FLgfkXN21hVJuFjzhAJniFxwX24SfmLQThZQcgJVyqReRVNlwoMkbtVL7ojeKXZ5p5owToC4kvTImbKC6JX0E+A1I/NpByuaDCX0rCmO3F9ooLF0Z0TFsNYz4HvxKx7qlZSr1ptsN9n80gw8T/Q3mPWYTDJrKoEeNjdoACdG2n9KJ5Zpq5B73GNOl8/DeGoGG2JCsOUW2GOQp2FEHfJFKljh8xV0PTBybwpawmSGO+jxtbwO/oWToTHni8e7+69J5L1+qzg765THL/JnEA5//dM85IyGNvx1+0RXNZQT4yuFSslhslQuax6+ug== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 878a44a4-129f-4606-acfc-08d9968bbf12 X-MS-Exchange-CrossTenant-AuthSource: BYAPR05MB4023.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2021 01:15:20.3206 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB4261 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Morgan Smith Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635039659; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=int8sUlJnXzh/BclgifOjfXl3Wojg/W+t2FRwDiNJzE=; b=JJvM1q4YQXpDF3wFFh1olNTEL29UxFFTN18vRd7p0N8liNPN0ZbVm2dS8A47J3Z7tOGITE khzNj1bb9hsIQe1zWB5c8zTtnf5E083uI0swIUUZ2yI8HSedghsq6zeQa1St5Eb0sNL7H/ 0DJdaoYYK3YOyrMapIcZDa2mmfZRjNOvJhHbXbh6jLEsmIm0DVupxpTZsUTQdRCgC2vjSH D4j2dvwTLu9M0z8xQf/h3MZOvZLCuPlps14FAGfRwdiV6nMbSEqCjjxULb7Le0TE8CRmcS 8qOjK0RZc6wjY3htqF4JLLCA5omzsQi/w6ww/FNyUr38JoOfWtuVJWnZLhsjlg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1635039659; a=rsa-sha256; cv=fail; b=AHgDPyJAcKOBjln9mmXGAfbMehi5c/JSDB2+6zXuUTOd2abiAbDrFs3LTMLCVOD88P1W8/ uidyMt3RrTzCm/Jw+5k25xJEcczw/3d0mDGVAEWoS+J6lEQDvjzKTLTxhyCsDWasijabxn FzDPGxjnGHbm4HTmFhrzX2AhfUSj6spukRcxpAsRC/GbZSOtOpUSZIB51z0DX3nbsNpHN/ bJoqNCtPMBFAtf+VOv1JRvxnp4iB30EnwJmz+s/NzBpHyPD6a+94FEmodcc4jJhdjt4EbZ pI7sA5vB2nxg2XNcpJZel4pSZu7znISV3gnhL4Vt5Sno10nUq6syZUg4ZM04zw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=outlook.com header.s=selector1 header.b=sw0A3gJU; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 5.78 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=outlook.com header.s=selector1 header.b=sw0A3gJU; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed)" header.from=outlook.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 5C809FF17 X-Spam-Score: 5.78 X-Migadu-Scanner: scn1.migadu.com X-TUID: sfAVqaucSuS6 From: Morgan Smith * gnu/packages/emacs.scm (emacs) [restore-emacs-pdmp]: Change regex to handle filenames that have a fingerprint in them. Remove #t at the end of the phase. Don't bother deleting the old files because rename will overwrite them anyways. --- find-files does sort its return so my previous 2 patches probably work great regardless of the number of pdmps we encounter (which will only ever be 1 anyways). Also the fingerprint is a 32 char hexidecimal number used to uniquely[1] identify the Emacs binary (well more specifically an earlier binary generated during the build process). If you put the version in there it would completely invalidate the entire purpose of this fingerprint. Different distros will have different fingerprints for the same version and that's the point. Here is another over engineered solution even though the previous 2 still work great. I'm not sure if I'm supposed to just throw a '(use-modules ...)' in the phase but if we want to use the #:modules argument then it will break all of the other Emacsen that inherit from Emacs since they use different build systems. 1. Hash collisions are a thing so maybe not actually uniquely gnu/packages/emacs.scm | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 6d9950d068..e25b79b832 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -179,18 +179,18 @@ (define* (emacs-byte-compile-directory dir) (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp ;; restore the dump file that Emacs installs somewhere in ;; libexec/ to its original state - (lambda* (#:key outputs target #:allow-other-keys) - (let* ((libexec (string-append (assoc-ref outputs "out") + (lambda* (#:key outputs #:allow-other-keys) + (use-modules (ice-9 regex)) + (let* ((pdmp-regex ".(emacs(-[[:xdigit:]]+)?.pdmp)-real") + (libexec (string-append (assoc-ref outputs "out") "/libexec")) - ;; each of these find-files should return one file - (pdmp (find-files libexec "^emacs\\.pdmp$")) - (pdmp-real (find-files libexec - "^\\.emacs\\.pdmp-real$"))) - (for-each (lambda (wrapper real) - (delete-file wrapper) - (rename-file real wrapper)) - pdmp pdmp-real)) - #t)) + (pdmp (find-files libexec pdmp-regex))) + (map + (lambda (pdmp) + (rename-file + pdmp + (regexp-substitute #f (string-match pdmp-regex pdmp) 'pre 1))) + pdmp)))) (add-after 'glib-or-gtk-wrap 'strip-double-wrap (lambda* (#:key outputs #:allow-other-keys) ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped -- 2.33.1