diff scripts/pkg/pkg.m @ 6020:f542445f6b7a

[project @ 2006-10-02 19:24:08 by dbateman]
author dbateman
date Mon, 02 Oct 2006 19:24:08 +0000
parents 401ca0de8506
children bb0c9f97fe4f
line wrap: on
line diff
--- a/scripts/pkg/pkg.m	Mon Oct 02 17:44:43 2006 +0000
+++ b/scripts/pkg/pkg.m	Mon Oct 02 19:24:08 2006 +0000
@@ -591,15 +591,17 @@
 endfunction
 
 function copy_files (desc, packdir, bindir)
+    ## Create the installation directory
+    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
+
     ## 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);