Patch #2296 2007-12-21 18:13

jenslody

patch to the new make_dist.script
Download
2296-patch_to_the_n.patch (1.4 KB)
Category
 
Status
Accepted
Close date
2008-01-10 10:14
Assigned to
 
--- codeblocks-1.0svn.orig/src/scripts/make_dist.script    2007-12-20 14:20:59.000000000 +0100
+++ codeblocks-1.0svn.work/src/scripts/make_dist.script    2007-12-21 11:28:48.000000000 +0100
@@ -53,6 +53,10 @@
             return -1;
         }
         
+        // if there is more then one project in the workspace the current working dir is the one of the last loaded project,
+        // so we have to set it explicitely to make the zip-command find the files
+        IO.SetCwd(prj.GetCommonTopLevelPath());
+
         // good, now let's get the project's filename
         local prj_fname = wxFileName();
         prj_fname.Assign(prj.GetFilename(), ::wxPATH_NATIVE);
@@ -71,7 +75,10 @@
         }
         
         // all that's left is to replace the variables in the command
-        local cmd = Cmd;
+        // local cmd = Cmd;
+        // we have to copy Cmd into cmd or both are two names for the same instance and the placeholders get overwritten
+        local cmd = wxString();
+        cmd += Cmd;
         cmd.Replace(_T("$ARCHIVE"), prj_fname.GetName());
         cmd.Replace(_T("$FILES_LIST"), file_list);
         
--- codeblocks-1.0svn.orig/src/scripts/Makefile.am    2007-11-15 12:49:38.000000000 +0100
+++ codeblocks-1.0svn.work/src/scripts/Makefile.am    2007-12-20 17:54:38.000000000 +0100
@@ -3,4 +3,5 @@
 dist_pkgdata_DATA = startup.script \
             gdb_types.script \
             edit_startup_script.script \
-            wx_help.script
+            wx_help.script \
+            make_dist.script
jenslody 2007-12-21 18:14

"make_dist.script" is missing from "Makefile.am" in "src/scripts", so it's doesn't get installed when using "./configure", "make" and "make install".

If there is more then one project iin the workspace the CurrentWorkingDir is the one of the last loaded project, what makes zip unable to find the projects files.

If run twice the replacement of "$ARCHIVE" and "$FILES_LIST" is permanent (until restarting C::B), because "local cmd = Cmd;" make "cmd" use the same memory then "Cmd".

This patch fixes both issues.

mandrav 2008-01-10 10:14

Applied, thanks :)