From b7e73d89065972338a536ff589065d9b8d21be28 Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Sun, 8 Jan 2017 22:30:47 +1100 Subject: [PATCH] Delete old vendor files when installing --- Makefile.in | 2 +- portmgr/dmg/postflight.in | 16 ++++++++++++++-- vendor/Makefile.in | 9 +++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2530f8bdc9..c9217adb4c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,7 @@ include Mk/macports.autoconf.mk all:: Mk/macports.autoconf.mk -Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in doc/Makefile.in src/Makefile.in src/cflib1.0/Makefile.in src/cregistry/Makefile.in src/darwintracelib1.0/Makefile.in src/machista1.0/Makefile.in src/macports1.0/Makefile.in src/mpcommon1.0/Makefile.in src/package1.0/Makefile.in src/pextlib1.0/Makefile.in src/port/Makefile.in src/port1.0/Makefile.in src/programs/Makefile.in src/programs/daemondo/Makefile.in src/registry2.0/Makefile.in tests/Makefile.in config.status +Mk/macports.autoconf.mk: Mk/macports.autoconf.mk.in src/config.h.in Makefile.in doc/Makefile.in src/Makefile.in src/cflib1.0/Makefile.in src/cregistry/Makefile.in src/darwintracelib1.0/Makefile.in src/machista1.0/Makefile.in src/macports1.0/Makefile.in src/mpcommon1.0/Makefile.in src/package1.0/Makefile.in src/pextlib1.0/Makefile.in src/port/Makefile.in src/port1.0/Makefile.in src/programs/Makefile.in src/programs/daemondo/Makefile.in src/registry2.0/Makefile.in tests/Makefile.in vendor/Makefile.in config.status ./config.status ${MAKE} clean diff --git a/portmgr/dmg/postflight.in b/portmgr/dmg/postflight.in index 382b54d8e3..a5b0ac2616 100755 --- a/portmgr/dmg/postflight.in +++ b/portmgr/dmg/postflight.in @@ -33,8 +33,8 @@ #set -x -# Script identification ('cause more often than not the svn Id is not expanded): -VERSION=2.3.1 +# Script identification: +VERSION=2.4 # Abstraction variables: PREFIX="@prefix@" @@ -53,6 +53,8 @@ OUR_STRING="${OUR_BASESTRING} on ${TIMESTAMP}" OLD_MACPORTS_TCL_DIR=${PREFIX}/share/macports/Tcl OLD_TCL_PACKAGE_DIR=/Library/Tcl +OLD_TCL_FILES="tcl8/8.4/http-2.7.12.tm tcl8/8.4/platform-1.0.12.tm tcl8/8.4/platform-1.0.13.tm tcl8/8.5/tcltest-2.3.5.tm" +OLD_VENDOR_DIRS="thread2.7.0 thread2.7.2 tcllib1.15 tcllib1.17" # Create config files from defaults if not present function setup_configs { @@ -137,6 +139,16 @@ function delete_old_tcl_packages { if [[ -d "${OLD_MACPORTS_TCL_DIR}" ]]; then rm -vrf "${OLD_MACPORTS_TCL_DIR}" fi + for f in ${OLD_TCL_FILES}; do + if [[ -f "${TCL_PACKAGE_PATH}/${f}" ]]; then + rm -vf "${TCL_PACKAGE_PATH}/${f}" + fi + done + for d in ${OLD_VENDOR_DIRS}; do + if [[ -d "${TCL_PACKAGE_PATH}/${d}" ]]; then + rm -vrf "${TCL_PACKAGE_PATH}/${d}" + fi + done } # create the user to use for privilege dropping diff --git a/vendor/Makefile.in b/vendor/Makefile.in index 4a99c3f0b3..608e964153 100644 --- a/vendor/Makefile.in +++ b/vendor/Makefile.in @@ -64,11 +64,19 @@ destroot-tcllib: all-tcllib @umask 0022; $(MAKE) -C @VENDOR_TCLLIB_SUBDIR@ DESTDIR=${DESTROOT} TCLSH_PROG=@INTREE_TCLSH@ @VENDOR_TCLLIB_INSTALL@ install: install-tcl install-tclthread install-tclx install-tcllib + +TCL_PACKAGE_PATH=@TCL_PACKAGE_PATH@ +OLD_TCL_FILES= $(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8/8.4/http-2.7.12.tm \ + $(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8/8.4/platform-1.0.12.tm \ + $(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8/8.4/platform-1.0.13.tm \ + $(DESTDIR)$(TCL_PACKAGE_PATH)/tcl8/8.5/tcltest-2.3.5.tm install-tcl: + rm -rf $(OLD_TCL_FILES) @echo ===\> making $(@:%-tcl=%) in ${DIRPRFX}@VENDOR_TCL_SUBDIR@ @umask 0022; $(MAKE) -C @VENDOR_TCL_SUBDIR@ @VENDOR_TCL_INSTALL@ install-tclthread: + rm -rf $(DESTDIR)$(TCL_PACKAGE_PATH)/thread2.7.{0,2} @echo ===\> making $(@:%-tclthrad=%) in ${DIRPRFX}@VENDOR_TCLTHREAD_SUBDIR@ @umask 0022; $(MAKE) -C @VENDOR_TCLTHREAD_SUBDIR@ @VENDOR_TCLTHREAD_INSTALL@ @@ -77,6 +85,7 @@ install-tclx: @umask 0022; $(MAKE) -C @VENDOR_TCLX_SUBDIR@ @VENDOR_TCLX_INSTALL@ install-tcllib: + rm -rf $(DESTDIR)$(TCL_PACKAGE_PATH)/tcllib1.1{5,7} @echo ===\> making $(@:%-tcllib=%) in ${DIRPRFX}@VENDOR_TCLLIB_SUBDIR@ @umask 0022; $(MAKE) -C @VENDOR_TCLLIB_SUBDIR@ @VENDOR_TCLLIB_INSTALL@