Re: Skip .DS_Store files in check_mode_recursive

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: Skip .DS_Store files in check_mode_recursive
Date: 2026-07-28 13:21:00
Message-ID: 277F140E-9DB1-4679-B821-0D9AF9CFFFD8@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 28 Jul 2026, at 13:56, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> On 2026-07-28 Tu 4:53 AM, Andrei Lepikhov wrote:

>> I am repeatedly encountering an annoying failing test during 'make check-world'
>> execution on the macOS platform: pg_resetwal with the result:
>>
>> Failed test 'check PGDATA permissions'
>>
>> It happens because a filesystem object .DS_Store exists in the directory.
>> AFAIK, MacOS manages it on its own. Given that I almost never touch this module,
>> it seems the OS handles it automatically.
>>
>> A quick dive into the mailing list history shows that this problem has been
>> discovered [1] and partly fixed [2] before.
>>
>> It looks like this approach might be extended to TAP tests too. In the
>> attachment, see the sketch of the code and a minor test to prove that it works.

Off the cuff, seems reasonable.

> Minor perl nit:
>
> I don't think you need to say
>
> return if basename($File::Find::name) eq '.DS_Store';
>
> you can just say
>
> return if $_ eq '.DS_Store';

Since the rest of the function use $File::Find::name it does however seem a bit
clearer for those less well versed in Perl to use the proposed programming? I
had to go read File::Find and I assume I am not the only one =)

--
Daniel Gustafsson

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-07-28 13:24:57 Re: Grab bag of smaller OpenSSL fixups
Previous Message Jim Jones 2026-07-28 13:18:31 Re: PSQL schema "describe" \dn is not escaping quotes