Mercurial > mxe-octave
diff tools/pkg-install.py @ 4084:fc806c8583a9
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
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Sat, 30 Jan 2016 08:17:24 -0500 |
parents | bdcddfdc57d0 |
children | 3e78f9bcd779 |
line wrap: on
line diff
--- 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");