# HG changeset patch # User dbateman # Date 1158357085 0 # Node ID 401ca0de850637881233c447ff1dea7d3ff0eb58 # Parent 4289ed95dde81e90aea9f6925e73505ae89bb4ce [project @ 2006-09-15 21:51:25 by dbateman] diff -r 4289ed95dde8 -r 401ca0de8506 scripts/ChangeLog --- a/scripts/ChangeLog Fri Sep 15 20:29:18 2006 +0000 +++ b/scripts/ChangeLog Fri Sep 15 21:51:25 2006 +0000 @@ -1,3 +1,10 @@ +2006-09-15 David Bateman + + * 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 * general/blkdiag.m: Adjust to new cellfun rules. diff -r 4289ed95dde8 -r 401ca0de8506 scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Fri Sep 15 20:29:18 2006 +0000 +++ b/scripts/pkg/pkg.m Fri Sep 15 21:51:25 2006 +0000 @@ -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]);