bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Simon Josefsson via Gnulib discussion list <bug-gnulib@gnu.org>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org,  Collin Funk <collin.funk1@gmail.com>
Subject: Re: [PATCH] gnulib-tool.py: Fix function call on incorrect object.
Date: Mon, 19 Feb 2024 09:59:22 +0100	[thread overview]
Message-ID: <87ttm44yol.fsf@kaka.sjd.se> (raw)
In-Reply-To: <10243767.qOBuL9xsDt@nimes> (Bruno Haible's message of "Mon, 19 Feb 2024 03:17:26 +0100")

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

Bruno Haible <bruno@clisp.org> writes:

>> What is the status of the Python gnulib tool? I'm not sure how far
>> behind it is compared to the shell script but it seems like it would
>> be much faster. I would say more maintainable but I might just be bad
>> at writing shell scripts. :)
>
> Yes, it's the hope that it will be faster that is the main motivation
> behind the Python rewrite.

Orthogonal to a rewrite in python: is it possible to design a reliable
caching mechanism?  Something similar to CONFIG_SITE for autoconf?

I find that ./gnulib-tool takes a long time and 95% of the time I use
it, it ended up doing exactly the same thing as it did last time I ran
it: copying a set of possibly patched files out of the gnulib directory.

How about logic like this:

. $GNULIB_SITE
if test -d $gnulib_cache_dir; then
  rsync -av $gnulib_cache_dir .
else if test -n "$gnulib_cache_dir"; then
  mkdir $savedir
  rsync -av . $savedir

  # do whatever gnulib normally is doing

  # compare . with $savedir, saving a copy of each modified
  # file into $gnulib_cache_dir
fi

then I could put something like this into a $GNULIB_SITE script:

if test -z "$gnulib_cache_dir"; then
    hash=`echo $PWD|md5sum|cut -d' ' -f1`
    my_cache_dir=$HOME/.cache/gnulib.site
    gnulib_cache_dir=$my_cache_dir/cache.`basename $PWD`.$hash
    test -d $gnulib_cache_dir || mkdir -p $gnulib_cache_dir
fi

/Simon

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 255 bytes --]

  reply	other threads:[~2024-02-19  8:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19  1:24 [PATCH] gnulib-tool.py: Fix function call on incorrect object Collin Funk
2024-02-19  2:17 ` Bruno Haible
2024-02-19  8:59   ` Simon Josefsson via Gnulib discussion list [this message]
2024-02-19 10:38     ` gnulib-tool caching Bruno Haible
2024-02-19 12:55       ` Simon Josefsson via Gnulib discussion list
2024-02-19 21:50         ` Bruno Haible
2024-02-19 22:24           ` Sam James
2024-02-19 23:11             ` Bruno Haible
2024-02-19 23:17               ` Sam James
2024-02-19 18:37   ` [PATCH] gnulib-tool.py: Fix function call on incorrect object Collin Funk
2024-02-19 21:36     ` Bruno Haible
2024-02-19 22:42       ` Collin Funk

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://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=87ttm44yol.fsf@kaka.sjd.se \
    --to=bug-gnulib@gnu.org \
    --cc=bruno@clisp.org \
    --cc=collin.funk1@gmail.com \
    --cc=simon@josefsson.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.
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).