From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#34066: patch-and-repack can truncate version number Date: Mon, 14 Jan 2019 16:43:56 -0500 Message-ID: <87va2q6hjc.fsf@netris.org> References: <20190114095042.GC25281@macbook41> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:48646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjA3X-00054m-GE for bug-guix@gnu.org; Mon, 14 Jan 2019 16:46:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjA3W-0002Sq-Kg for bug-guix@gnu.org; Mon, 14 Jan 2019 16:46:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:60119) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjA3W-0002Sj-Gd for bug-guix@gnu.org; Mon, 14 Jan 2019 16:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gjA3W-0001EY-Cu for bug-guix@gnu.org; Mon, 14 Jan 2019 16:46:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190114095042.GC25281@macbook41> (Efraim Flashner's message of "Mon, 14 Jan 2019 11:50:42 +0200") 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: 34066@debbugs.gnu.org Hi Efraim, Efraim Flashner writes: > When using 'git-fetch' for the source, when a patch is applied part of > the version number is truncated. > > The following derivations will be built: > /gnu/store/zsy0j8jfg4q4nz8xk5bpc3h5qrclm679-opencv-3.4.3-checkout.drv > /gnu/store/kadg4jnyar79mpz5bmmg4w3qgn0iy81r-opencv-3.4.tar.xz.drv I guess the issue is in 'tarxz-name', defined within 'patch-and-repack': (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)))) (string-append base (if (equal? (file-extension base) "tar") ".xz" ".tar.xz")))) Unless the extension (everything after the last '.') of the original file name is composed entirely of hexadecimal characters, it is removed. In this case, I guess the extension is "3-checkout", so it's removed. I'm reluctant to suggest a fix until I understand the rationale for this behavior. It was added by Ludovic in February 2014, in commit 3ca00bb51e3ff906a700b6925e0ce81558c8c469. commit 3ca00bb51e3ff906a700b6925e0ce81558c8c469 Author: Ludovic Court=C3=A8s Date: Fri Feb 28 10:41:44 2014 +0100 packages: Support 'patches' and 'snippets' for sources that are directori= es. =20=20 * guix/packages.scm (patch-and-repack)[numeric-extension?, tarxz-name]: New procedures. [builder]: Adjust to deal with SOURCE when it's a directory. : Use 'tarxz-name'. Always add (guix build utils) to IMPORTED-MODULES. Do you remember why you decided to remove non-numeric extensions, Ludovic? Thanks, Mark