all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Ben Woodcroft <b.woodcroft@uq.edu.au>
Cc: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: Re: [PATCH] Add fraggenescan.
Date: Sun, 27 Dec 2015 19:38:00 -0500	[thread overview]
Message-ID: <20151228003800.GA14384@jasmine> (raw)
In-Reply-To: <56805DD7.8010900@uq.edu.au>

On Mon, Dec 28, 2015 at 07:53:27AM +1000, Ben Woodcroft wrote:
> On 20/12/15 23:03, Ricardo Wurmus wrote:

[...]

> >>+               (substitute* "run_hmm.c"
> >>+                 (("^  strcat\\(train_dir, \\\"train/\\\"\\);")
> >>+                  (string-append "  strcpy(train_dir, \"" share "/train/\");")))
> >Why do you replace “strcat” with “strcpy” here?
> The line above does a strcpy we don't want, so strcat would keep that. I
> could remove the line above if you want, but this effectively makes no
> difference to the running of the program.

It looks like this substition has two parts:
1) Provide the correct path to some resources ("train files") for the
program.
2) Change a function call from strcat() to strcpy().

Can you elaborate more on part 2?

I undertand that the intended effect is to discard a value assigned to
'train_dir' [0] in the previous function call. This discarded value is
'argv[0]' minus 12 bytes [1]. The reason for this is that the program is
looking for the "train files" in the same directory as 'argv[0]', but we
have installed the "train files" somewhere else. Is that right?

You mention in a comment in the patch that this program and other
programs expect the "train files" to be in one place, but we are
patching this line to account for the fact that we have installed them
in another location.  Will the other programs have to be patched as
well? If so, do you think it would be better to let the files be
installed in the unusual location chosen by upstream?

[0] 'train_dir' is something like the --prefix parameter in a ./configure
script. Many paths are generated based on it, and they all seem to be
assigned to buffers with a length of 4096 bytes.

[1] The magic number 12 is equal to the length of the basename of
argv[0], "fraggenescan". For the benefit of those reading along...

  reply	other threads:[~2015-12-28  0:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-20 12:36 [PATCH] Add fraggenescan Ben Woodcroft
2015-12-20 13:03 ` Ricardo Wurmus
2015-12-27 21:53   ` Ben Woodcroft
2015-12-28  0:38     ` Leo Famulari [this message]
2015-12-28  0:56       ` Ben Woodcroft
2015-12-28  5:43         ` Leo Famulari
2015-12-29 23:23           ` Ludovic Courtès
2015-12-30  1:19             ` Leo Famulari

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

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

  git send-email \
    --in-reply-to=20151228003800.GA14384@jasmine \
    --to=leo@famulari.name \
    --cc=b.woodcroft@uq.edu.au \
    --cc=guix-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.