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:24:03 +0200 Message-ID: <87v9x53mto.fsf@devup.no> References: <874l4p52at.fsf@devup.no> <20190616091313.GB1460@macbook41> 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]:39220) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcRPM-00015G-4O for bug-guix@gnu.org; Sun, 16 Jun 2019 05:25:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcRPK-0007Rf-Tu for bug-guix@gnu.org; Sun, 16 Jun 2019 05:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54399) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hcRPK-0007RV-QF for bug-guix@gnu.org; Sun, 16 Jun 2019 05:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hcRPK-0000ab-MS for bug-guix@gnu.org; Sun, 16 Jun 2019 05:25:02 -0400 Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Message-ID: In-Reply-To: <20190616091313.GB1460@macbook41> 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: Efraim Flashner Cc: 36242-done@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Efraim Flashner writes: > On Sun, Jun 16, 2019 at 11:04:26AM +0200, Marius Bakke wrote: >> Hello, >>=20 >> 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. >>=20 >> E.g. `guix build -S eudev` returns >>=20 >> /gnu/store/7lgsxmr0rk9f8fbq6k0kj1aqb7lnrlll-eudev-3.2.tar.xz >>=20 >> ...even though it should be "3.2.8". >>=20 >> This patch fixes it: >>=20 > >> From 0c44561d0d45de91f4674d659b86d740642ae801 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. >>=20 >> * guix/packages.scm (patch-and-repack): If ORIGINAL-FILE-NAME is a source >> checkout, drop the '-checkout' part so the version-detecting code works. >> --- >> guix/packages.scm | 12 +++++++++--- >> 1 file changed, 9 insertions(+), 3 deletions(-) >>=20 >> diff --git a/guix/packages.scm b/guix/packages.scm >> index c94a651f27..5b8969e079 100644 >> --- 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=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. >> - (let ((base (if (numeric-extension? file-name) >> - original-file-name >> - (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" >> --=20 >> 2.22.0 >>=20 > > Pinging Mark and Ludo, similar to https://issues.guix.info/issue/34066 Whoops, was not aware of that report! Closing as duplicate. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl0GCrMACgkQoqBt8qM6 VPrMRwf/YGW/LF9F4zgfv3RXV9Io6kSd6Qn+bz9ts0EoXVvLd/WgXi2qcTF75svH B1YEZ98XE3kmoOjOHLuOXrP3Xpo+O73XerWVeLlti7M1T3FH6BWy08Hz6GuaIes4 kVw7a8VvC9LPfPHhZgsZiS2RX/qLxcv7WX3G+qc3NkL6liEJvkT6T7bmVbe4fl35 7BXgp0YwLUWJdos/WH2D4K8qHWKniWWdWiOq8E3/kj+Ifl+QOSCkbyGrd56Am6Y3 zMdBYHo9HJWBnp3yBe4dFADLB+HdEfrdU000eBsLYvJQTfRH+N9AwmE9lQapbAhG QCSlGWoAafW9O30ZVLkyGMU1ARbwmw== =gmVs -----END PGP SIGNATURE----- --=-=-=--