public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH] FEATURES=case-insensitive-fs for bug #524236
Date: Thu, 13 Nov 2014 09:58:01 -0800	[thread overview]
Message-ID: <5464F129.6080404@gentoo.org> (raw)
In-Reply-To: <5464881D.6030307@gentoo.org>

On 11/13/2014 02:29 AM, Alexander Berntsen wrote:
> On 13/11/14 02:22, Zac Medico wrote:
>> +if "case-insensitive-fs" in portage.settings.features:
>> +    FIND_EXTANT_CONFIGS = \
>> +        FIND_EXTANT_CONFIGS.replace("-name '._cfg", "-iname '._cfg")
>> +
> Splitting inside the replace will look nicer following PEP indentation
> (as you won't need the '\').

Okay, I'll re-format it as you've suggested.

>> +Use case\-insensitive file name comparisions when merging and unmerging
>> +files.
>> +.TP
> Maybe mention a) that most people can ignore this option, and b) who
> it's actually for. Kind of in the kernel option help style.

Okay, I'll add something about it only being needed for case-insensitive
file systems, which are usually not used.

> 
> In general I don't like this patch. It handles a bunch of cases separately
> by doing lower(), when I think instead it should be handled implicitly.
> The data should be in a structure such that it knows whether it is supposed
> to be upper or lowercase, and whatever's dealing with it should deal with
> it accordingly, rather than checking "is this case insensitive? OK
> lowercase it before sending it wherever".

Aside from the ConfigProtect constructor, which has a new
case_insensitive keyword parameter, all affected methods handle case
transformations "implicitly", as far as API consumers are concerned.

However, we could improve efficiency for some usage patterns by
providing an alternative to dblink.getcontents that is oriented toward
case-insensitive handling. For example, every single
dblink._match_contents call currently has to transform all names to
lowercase, and generate a reverse mapping from lowercase back to
preserved case. The dblink._match_contents method would be more
efficient if we created an alternative to dblink.getcontents that
handled the transformations and cached the results. I intentionally did
not implement this optimization yet, since it's probably better to do it
in a separate patch, rather than complicate the current patch.

> But if you think this is the best way, I'm not going to stand in the way of this patch.

As discussed above, think the current approach is pretty reasonable,
though I would like to optimize it with a separate patch.
-- 
Thanks,
Zac


  reply	other threads:[~2014-11-13 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13  1:22 [gentoo-portage-dev] [PATCH] FEATURES=case-insensitive-fs for bug #524236 Zac Medico
2014-11-13 10:29 ` Alexander Berntsen
2014-11-13 17:58   ` Zac Medico [this message]
2014-11-16 10:41     ` [gentoo-portage-dev] [PATCH 1/2] dblink: case insensitive support " Zac Medico
2014-11-16 10:41       ` [gentoo-portage-dev] [PATCH 2/2] FEATURES=case-insensitive-fs " Zac Medico
2014-11-16 18:11       ` [gentoo-portage-dev] [PATCH 1/2] dblink: case insensitive support " Brian Dolbec
2014-11-17  1:29         ` [gentoo-portage-dev] [PATCH v2 " Zac Medico
2014-11-17  1:29           ` [gentoo-portage-dev] [PATCH v2 2/2] FEATURES=case-insensitive-fs " Zac Medico
2014-11-17  4:58           ` [gentoo-portage-dev] [PATCH v2 1/2] dblink: case insensitive support " Brian Dolbec
2014-11-17 20:29             ` [gentoo-portage-dev] [PATCH v3 " Zac Medico
2014-11-17 20:29               ` [gentoo-portage-dev] [PATCH v3 2/2] FEATURES=case-insensitive-fs " Zac Medico
2014-11-17 22:09               ` [gentoo-portage-dev] [PATCH v3 1/2] dblink: case insensitive support " Brian Dolbec

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=5464F129.6080404@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.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