From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: bug#36242: Repacked source checkouts get a misleading file name Date: Sun, 16 Jun 2019 11:04:26 +0200 Message-ID: <874l4p52at.fsf@devup.no> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:36127) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcR5z-0006ON-Q7 for bug-guix@gnu.org; Sun, 16 Jun 2019 05:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcR5y-0005Eg-Q8 for bug-guix@gnu.org; Sun, 16 Jun 2019 05:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54380) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcR5y-0005EW-Lr for bug-guix@gnu.org; Sun, 16 Jun 2019 05:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcR5y-0008VR-DL for bug-guix@gnu.org; Sun, 16 Jun 2019 05:05:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:36023) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcR5c-0006Li-SQ for bug-guix@gnu.org; Sun, 16 Jun 2019 05:04:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcR5Z-0004u7-5S for bug-guix@gnu.org; Sun, 16 Jun 2019 05:04:39 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:51597) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcR5V-0004oX-JX for bug-guix@gnu.org; Sun, 16 Jun 2019 05:04:33 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 086E22208C for ; Sun, 16 Jun 2019 05:04:29 -0400 (EDT) Received: from localhost (140.226.16.62.customer.cdi.no [62.16.226.140]) by mail.messagingengine.com (Postfix) with ESMTPA id 64CB78005A for ; Sun, 16 Jun 2019 05:04:28 -0400 (EDT) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 36242@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hello, When repacking a source checkout (e.g. by using git-fetch with a snippet), the generated file name contains only the first two version identifiers. E.g. `guix build -S eudev` returns /gnu/store/7lgsxmr0rk9f8fbq6k0kj1aqb7lnrlll-eudev-3.2.tar.xz ...even though it should be "3.2.8". This patch fixes it: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-packages-Keep-full-version-in-file-name-when-repacki.patch Content-Transfer-Encoding: quoted-printable From=200c44561d0d45de91f4674d659b86d740642ae801 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 16 Jun 2019 10:50:15 +0200 Subject: [PATCH] packages: Keep full version in file name when repacking source checkouts. * guix/packages.scm (patch-and-repack): If ORIGINAL-FILE-NAME is a source checkout, drop the '-checkout' part so the version-detecting code works. =2D-- guix/packages.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/guix/packages.scm b/guix/packages.scm index c94a651f27..5b8969e079 100644 =2D-- a/guix/packages.scm +++ b/guix/packages.scm @@ -505,11 +505,17 @@ specifies modules in scope when evaluating SNIPPET." (and=3D> (file-extension file-name) (cut string-every char-set:hex-digit <>))) =20 + (define (checkout? directory) + ;; Return true if DIRECTORY is a checkout (git, svn, etc). + (string-suffix? "-checkout" directory)) + (define (tarxz-name file-name) ;; Return a '.tar.xz' file name based on FILE-NAME. =2D (let ((base (if (numeric-extension? file-name) =2D original-file-name =2D (file-sans-extension file-name)))) + (let ((base (cond ((numeric-extension? file-name) + original-file-name) + ((checkout? file-name) + (string-drop-right file-name 9)) + (else (file-sans-extension file-name))))) (string-append base (if (equal? (file-extension base) "tar") ".xz" =2D-=20 2.22.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0GBhoACgkQoqBt8qM6 VPpcNQgAoGxnhm3chqZU5peUbi5PDbTv0sQi6SJbEnHbctXsW5f8vC+brdwUBtIA X3Esz4mFSIBKtSTnhUSrec6q+fdqGonWYP5z4Lo1mXuApn/3sw1diopFbIFkw5mc UDntEq76IGohsWy1y0BZsPFCDF/wWf+0YyRHj5QMwE6pqlWqCtTtxH+7VwCBsVqG Rba10d97BxBS0zen5QsKPJXGR36PQ15cBD0hpb84mk0Iyf0owH2ZJXhQMVX/2P8S zIOIAWrxprsnrD3Y2UJVXCLtWVjyeKgHfti2DPoo6WwfjG0zUgB7GfR9nIZ8oK60 IsFa8r4NA4KHDBtrFwGz2ORPBlQiLQ== =cO3D -----END PGP SIGNATURE----- --==-=-=--