From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 983A1138239 for ; Sun, 21 Feb 2021 01:59:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C7DF3E0870; Sun, 21 Feb 2021 01:59:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AED31E0870 for ; Sun, 21 Feb 2021 01:59:30 +0000 (UTC) Received: by mail-ej1-f51.google.com with SMTP id hs11so23262691ejc.1 for ; Sat, 20 Feb 2021 17:59:29 -0800 (PST) X-Gm-Message-State: AOAM530KBwD3Z52o/vBt4Eb6XZiJ0gdr4ASHI5hdqK8AHYN4PF4yyTWm mJaHKDGXW5sc2IQsFwA3Q9/ToTri9CdSjtBy1K8= X-Google-Smtp-Source: ABdhPJyUGfmENzIR2kP2atayXIgPZW2x9yrKNkrwoWpj6SRWfEBSBydkK1Fud9mM48CnTvOQKKEwa6w69l2HnRtvqNg= X-Received: by 2002:a17:906:753:: with SMTP id z19mr14865028ejb.15.1613872766791; Sat, 20 Feb 2021 17:59:26 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <45ddcea2d3a7de79e99f7c4eb4b8262c3c52c7b4.camel@rohde-schwarz.com> In-Reply-To: <45ddcea2d3a7de79e99f7c4eb4b8262c3c52c7b4.camel@rohde-schwarz.com> From: Matt Turner Date: Sat, 20 Feb 2021 20:59:15 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-catalyst] [PATCH] Enable recursive globbing for clear_path To: gentoo-catalyst@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: fa6db0f2-c73b-4688-b1bd-48b99187e39e X-Archives-Hash: c227c91598099a52ce6aa4de5488919b On Sat, Feb 13, 2021 at 6:18 PM Felix Bier 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!