[pacman-dev] [PATCH] makepkg: use builtin globbing to print files in package

Eli Schwartz eschwartz at archlinux.org
Tue Aug 21 15:53:10 UTC 2018


On 8/21/18 11:41 AM, Luke Shumaker wrote:
> On Tue, 21 Aug 2018 10:15:12 -0400,
> Eli Schwartz wrote:
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index ae1ef01b..1325b019 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -711,10 +711,14 @@ write_buildinfo() {
>>  # database files are placed at the beginning of the package regardless of
>>  # sorting
>>  list_package_files() {
>> -	(find . -path './.*' \! -name '.'; find . \! -path './.*' \! -name '.' | LC_ALL=C sort) |
>> -	sed -e 's|^\./||' | tr '\n' '\0'
>> +	(
>> +		export LC_COLLATE=C
>> +		shopt -s dotglob globstar
>> +		printf '%s\0' **
>> +	)
> 
> Since globbing is done in the same process, it should be sufficient to
> set LC_COLLATE; no need to export it.

I guess....

My initial version used LC_COLLATE without globstar and just replaced
the first find command with printf, so it needed to be exported to sort
as well. Then dreisner pointed out using globstar could totally drop the
find subprocess.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/pacman-dev/attachments/20180821/9c71fd72/attachment.asc>


More information about the pacman-dev mailing list