Opened 5 months ago

Last modified 5 months ago

#5239 new defect

make uninstall uninstalls more than needed

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.4.0
Component: build/upgrade/install 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 (2)

comment:1 by strk, 5 months 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, 5 months 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) \
Note: See TracTickets for help on using tickets.