Make more portable TAP tests of initdb

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Make more portable TAP tests of initdb
Date: 2015-04-14 11:40:33
Message-ID: CAB7nPqQsLH8Kzoko0fQr3Cm9-G1CHWHg1rTDDovur0EOe1Fjxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
20150414_initdb_tap_portable.patch text/x-diff 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-04-14 14:09:28 pgsql: Use Intel SSE 4.2 CRC instructions where available.
Previous Message Shigeru HANADA 2015-04-14 10:49:28 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)