Make more portable TAP tests of initdb - Mailing list pgsql-hackers

From Michael Paquier
Subject Make more portable TAP tests of initdb
Date
Msg-id CAB7nPqQsLH8Kzoko0fQr3Cm9-G1CHWHg1rTDDovur0EOe1Fjxg@mail.gmail.com
Whole thread Raw
Responses Re: Make more portable TAP tests of initdb
List pgsql-hackers
Hi all,

I noticed that src/bin/initdb/t/001_initdb.pl uses directly rm via a
system() call like that:
system_or_bail "rm -rf '$tempdir'/*";

This way of doing is not portable, particularly on platforms that do
not have rm like... Windows where the equivalent is del. And we could
actually use remove_tree with its option keep_root to get the same
effect in pure perl as mentioned here:
http://perldoc.perl.org/File/Path.html
With this formulation:
remove_tree($tempdir, {keep_root => 1});

Attached is a patch doing that.
Regards,
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: inherit support for foreign tables
Next
From: Heikki Linnakangas
Date:
Subject: Re: What exactly is our CRC algorithm?