Mercurial > hg > octave-lyh
changeset 5993:401ca0de8506
[project @ 2006-09-15 21:51:25 by dbateman]
author | dbateman |
---|---|
date | Fri, 15 Sep 2006 21:51:25 +0000 |
parents | 4289ed95dde8 |
children | 4ace443375b1 |
files | scripts/ChangeLog scripts/pkg/pkg.m |
diffstat | 2 files changed, 23 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,10 @@ +2006-09-15 David Bateman <dbateman@free.fr> + + * pkg/pkg.m (prepare_installation): Don't create package + installation directory here. + (copy_files): Create it here instead, to avoid issues with + upgrades. Also install the COPYING file in packinfo. + 2006-09-13 John W. Eaton <jwe@octave.org> * general/blkdiag.m: Adjust to new cellfun rules.
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -456,14 +456,8 @@ end_try_catch endif - ## Create the installation directory - [status, msg] = mkdir(desc.dir); - if (status != 1) - error("Couldn't create installation directory: %s\n", msg); - endif - - ## If the directory "inst" doesn't exist, we create it - if (!exist([packdir "inst"], "dir")) + ## If the directory "inst" doesn't exist, we create it + if (!exist([packdir "inst"], "dir")) [status, msg] = mkdir([packdir "inst"]); if (status != 1) rm_rf(desc.dir); @@ -599,6 +593,13 @@ function copy_files (desc, packdir, bindir) ## Copy the files from "inst" to installdir if (! dirempty([packdir "inst"])) + if (! exist (desc.dir, "dir")) + [status, output] = mkdir (desc.dir); + if (status != 1) + error("Couldn't create installation directory %s : %s\n", + desc.dir, output); + endif + endif [status, output] = system(["cp -R " packdir "inst/* " desc.dir]); if (status != 0) rm_rf(desc.dir); @@ -621,6 +622,13 @@ error("Couldn't copy DESCRIPTION: %s\n", output); endif + ## Copy COPYING + [status, output] = system(["cp " packdir "COPYING " packinfo]); + if (status != 0) + rm_rf(desc.dir); + error("Couldn't copy COPYING: %s\n", output); + endif + ## Is there an INDEX file to copy or should we generate one? if (exist([packdir "INDEX"], "file")) [status, output] = system(["cp " packdir "INDEX " packinfo]);