From: Sandro Santilli Date: Mon, 17 Jul 2017 14:38:18 +0000 (+0000) Subject: Allow postgis_restore.pl to work on directory-style (-Fd) dumps X-Git-Tag: 2.4.0alpha~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c493bf6c22f71a58a23e1c681701b00e2d0a0270;p=postgis Allow postgis_restore.pl to work on directory-style (-Fd) dumps Patch by Roger Crew Closes #3788 git-svn-id: http://svn.osgeo.org/postgis/trunk@15488 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 7f9b636c0..c2bb7e6c1 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PostGIS 2.4.0 * New Features * + - #3788, Allow postgis_restore.pl to work on directory-style (-Fd) dumps + (Roger Crew) - #3772, Direction agnostic ST_CurveToLine output (Sandro Santilli / KKGeo) - #2464, ST_CurveToLine with MaxError tolerance (Sandro Santilli / KKGeo) - #3599, Geobuf output support via ST_AsGeobuf (Björn Harrtell) diff --git a/utils/postgis_restore.pl.in b/utils/postgis_restore.pl.in index 7561edd3b..c3bc57ccf 100644 --- a/utils/postgis_restore.pl.in +++ b/utils/postgis_restore.pl.in @@ -83,12 +83,14 @@ while (@ARGV && $ARGV[0] =~ /^-/) { die $usage if (@ARGV < 1); my $dumpfile = $ARGV[0]; -my $manifest = $dumpfile . ".lst"; +my $manifest = $dumpfile; +$manifest =~ s/\/$//; # strip trailing slash +$manifest .= ".lst"; my $hasTopology = 0; die "$me:\tUnable to find 'pg_dump' on the path.\n" if ! `pg_dump --version`; die "$me:\tUnable to find 'pg_restore' on the path.\n" if ! `pg_restore --version`; -die "$me:\tUnable to open dump file '$dumpfile'.\n" if ! -f $dumpfile; +die "$me:\tUnable to open dump file '$dumpfile'.\n" if ! -r $dumpfile; print STDERR "Converting $dumpfile to ASCII on stdout...\n";