Opened 2 years ago

Closed 17 months ago

#5239 closed defect (fixed)

make uninstall uninstalls more than needed

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 2.5.0
Component: build Version: 1.4.X
Keywords: Cc:

Description

The make uninstall target under extension directories remove all extensions, not just the one installed by make install in that directory. It can also uninstall foreign extensions which may happen to have the same version as ours. Sounds dangerous.

Change History (3)

comment:1 by strk, 2 years ago

The behaviour I'm describing is due to this snippet in extensions/upgrade-path-rules.mk which is included by all extension Makefile.in files:

INSTALLED_UPGRADE_SCRIPTS = \
  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
  $(NULL)

uninstall-upgrade-paths:
  rm -f $(INSTALLED_UPGRADE_SCRIPTS)

Note there's no $(EXTENSION) being used, so any extension is removed

comment:2 by strk, 2 years ago

Version: 3.0.x1.4.X

I verified we've had this problem for a long time. As back as 1.4:

[strk@c19:/usr/local/src/postgis] grep wildcard.*EXT */extensions/upgrade-paths-rules.mk 
postgis-1.4/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-1.4/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-2.4/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-2.4/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-2.5/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-2.5/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-3.0/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-3.0/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-3.1/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-3.1/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-3.2/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-3.2/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis-3.3/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis-3.3/extensions/upgrade-paths-rules.mk:  $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
postgis/extensions/upgrade-paths-rules.mk:      $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
postgis/extensions/upgrade-paths-rules.mk:      $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \

comment:3 by strk, 17 months ago

Milestone: PostGIS 3.4.0PostGIS 2.5.0
Resolution: fixed
Status: newclosed

This was fixed with [8a4b3a7f80f160c12b9bfab3f049555c5735f7dc/git] which is included even in 2.5.0 and 2.5 is the oldest we support, so closing.

Note: See TracTickets for help on using tickets.