# HG changeset patch # User John Donoghue # Date 1454159844 18000 # Node ID fc806c8583a93d99992d7cf4cf6573a18b838a53 # Parent ab391f476b81371168d82035bbdad1ba7218e610 install: remove old octave pakages during intall of pkg * dist-files.mk: add pkg-install.py * tools/pkg-install.py: add uninstall implmentation and call from install diff -r ab391f476b81 -r fc806c8583a9 dist-files.mk --- a/dist-files.mk Fri Jan 29 13:12:18 2016 -0500 +++ b/dist-files.mk Sat Jan 30 08:17:24 2016 -0500 @@ -845,6 +845,7 @@ install-sh \ make-shared-from-static \ patch-tool-mxe \ + pkg-install.py \ s3-fetch-and-sync \ set-mxe-env.sh.in diff -r ab391f476b81 -r fc806c8583a9 tools/pkg-install.py --- a/tools/pkg-install.py Fri Jan 29 13:12:18 2016 -0500 +++ b/tools/pkg-install.py Sat Jan 30 08:17:24 2016 -0500 @@ -6,6 +6,7 @@ import shutil import fnmatch import subprocess +import glob class Env: mkoctfile = "mkoctfile"; @@ -264,6 +265,18 @@ pass def uninstall_pkg(pkg,env): + # uninstall existing directories + + files=glob.glob(env.prefix + "/share/octave/packages/" + env.pkg + "-" + "*") + for f in files: + print "removing dir " + f + shutil.rmtree(f) + + files=glob.glob(env.prefix + "/lib/octave/packages/" + env.pkg + "-" + "*") + for f in files: + print "removing dir " + f + shutil.rmtree(f) + pass def install_pkg(pkg, env): @@ -301,6 +314,9 @@ configure_make (env, packdir) + # uninstall old packages + uninstall_pkg(pkg, env) + # install package files copy_files(env, packdir) create_pkgadddel (env, packdir, "PKG_ADD");