unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Efraim Flashner <efraim@flashner.co.il>
Cc: 34066@debbugs.gnu.org
Subject: bug#34066: patch-and-repack can truncate version number
Date: Mon, 14 Jan 2019 16:43:56 -0500	[thread overview]
Message-ID: <87va2q6hjc.fsf@netris.org> (raw)
In-Reply-To: <20190114095042.GC25281@macbook41> (Efraim Flashner's message of "Mon, 14 Jan 2019 11:50:42 +0200")

Hi Efraim,

Efraim Flashner <efraim@flashner.co.il> 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ès <ludo@gnu.org>
  Date:   Fri Feb 28 10:41:44 2014 +0100

  packages: Support 'patches' and 'snippets' for sources that are directories.
  
  * guix/packages.scm (patch-and-repack)[numeric-extension?, tarxz-name]:
    New procedures.
    [builder]: Adjust to deal with SOURCE when it's a directory.
    <body>: 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

  reply	other threads:[~2019-01-14 21:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14  9:50 bug#34066: patch-and-repack can truncate version number Efraim Flashner
2019-01-14 21:43 ` Mark H Weaver [this message]
2019-01-15 12:39   ` Ludovic Courtès
2019-06-20 22:07 ` Marius Bakke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87va2q6hjc.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=34066@debbugs.gnu.org \
    --cc=efraim@flashner.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).