From: Matt Turner <mattst88@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: Re: [gentoo-catalyst] [PATCH] Enable recursive globbing for clear_path
Date: Sat, 20 Feb 2021 20:59:15 -0500 [thread overview]
Message-ID: <CAEdQ38EheEGtRQQGqh8nmcPGj-CYA1wh4KHx9QqH=vL5PAbprQ@mail.gmail.com> (raw)
In-Reply-To: <45ddcea2d3a7de79e99f7c4eb4b8262c3c52c7b4.camel@rohde-schwarz.com>
On Sat, Feb 13, 2021 at 6:18 PM Felix Bier <Felix.Bier@rohde-schwarz.com> wrote:
>
> This commit enables recursive globbing in clear_path, allowing the
> usage of '**' to match an arbitrary number of sub-directories.
>
> Before this commit, clear_path used only non-recursive globbing. This
> allowed to use '*' to expand names within one directory, e.g. '/a/*/c'
> can expand to '/a/b/c', but not '/a/b/b/c'. With this commit, '/a/**/c'
> can be used to expand to '/a/b/c', '/a/b/b/c', '/a/b/b/b/c' etc.
>
> This is motivated by wanting to recursively delete all occurences of a
> filename with the 'stage4/rm' entry of a spec file. The '/rm' entries
> are processed with 'clear_path' in the existing code.
>
> Additionally, 'glob.glob' is replaced with 'glob.iglob',
> which returns the same files as 'glob.glob', but as an iterator
> instead of as a list (so it no longer necessary to hold
> all matches in memory at once).
>
> Recursive globbing has been added in Python 3.5.
>
> References:
> https://docs.python.org/3/library/glob.html#glob.glob
> https://docs.python.org/3/library/glob.html#glob.iglob
Nice, thank you. Committed!
prev parent reply other threads:[~2021-02-21 1:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-13 23:18 [gentoo-catalyst] [PATCH] Enable recursive globbing for clear_path Felix Bier
2021-02-21 1:59 ` Matt Turner [this message]
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='CAEdQ38EheEGtRQQGqh8nmcPGj-CYA1wh4KHx9QqH=vL5PAbprQ@mail.gmail.com' \
--to=mattst88@gentoo.org \
--cc=gentoo-catalyst@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