Opened 12 years ago

Closed 12 years ago

#1527 closed defect (invalid)

extensions/postgis/topology/Makefile.in uses non-POSIX [[ in makefile

Reported by: gdt Owned by: strk
Priority: medium Milestone: PostGIS 2.0.0
Component: build Version: master
Keywords: Cc:

Description

The [[ construct is beyond POSIX specifications, and not all shells implement it. Even if so, there is no standard for the behavior.

The following diff helps, but because there are underlying issues with revisions not being numeric, it doesn't work (but I think it fixes the [[ issue).

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 9010)
+++ Makefile.in	(working copy)
@@ -72,14 +72,14 @@
 sql_minor_upgrade: ../postgis_extension_helper.sql sql_bits/remove_from_extension.sql.in sql/topology_upgrade_minor.sql sql_bits/topology_comments.sql ../postgis_extension_helper_uninstall.sql
 	if test "$(PREREL_NUMBER)x" != "x"; then \
 	   v=$(PREREL_PREV); \
-	   while [[ $$v -ge 1 ]]; do \
+	   while [ "$$v" -ge 1 ]; do \
 	       cat $< > sql/$(EXTENSION)--$(MINORVERSION).$(PREREL_PREFIX)$$v--$(EXTVERSION).sql; \
 	       v=$$(($$v-1)); \
 	     done; \
 	else \
 	  if test $(MICRO_NUMBER) -gt 0; then \
 	   v=0; \
-	   while [[ $$v -le $(MICRO_PREV) ]]; do \
+	   while [ "$$v" -le "$(MICRO_PREV)" ]; do \
            cat $< > sql/$(EXTENSION)--$(MINORVERSION).$(PREREL_PREFIX)$$v--$(EXTVERSION).sql; \
 	       v=$$(($$v+1)); \
 	    done; \

Change History (4)

comment:1 by gdt, 12 years ago

The same issue applies to extensions/postgis/Makefile.in

comment:2 by gdt, 12 years ago

Component: postgisbuild/upgrade/install
Owner: changed from pramsey to strk

comment:3 by gdt, 12 years ago

With the fix in ticket:1534, this patch is confirmed to work.

comment:4 by pramsey, 12 years ago

Resolution: invalid
Status: newclosed

Also invalided by a change in the approach using extensions/upgradeable_versions.mk

Note: See TracTickets for help on using tickets.