From 699268efeb59eb71c1c42b460b678442433c7a79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 19 Jan 2013 15:13:18 +0000 Subject: [PATCH] [DEVELOPMENT ENVIRONMENT] * BUG: Creating a source archive now uses a temporary intermediate file and displays an error message if something fails. git-svn-id: svn://localhost/gambas/trunk@5510 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas3/.lang/.pot | 24 ++++++++++++++---------- app/src/gambas3/.src/Project.module | 14 +++++++++++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 015e37b50..c5a139d7a 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -3115,7 +3115,7 @@ msgstr "" msgid "This menu is too deep !" msgstr "" -#: FMenu.class:937 Project.module:5063 +#: FMenu.class:937 Project.module:5075 msgid "modified" msgstr "" @@ -6192,39 +6192,43 @@ msgid "" "already exists." msgstr "" -#: Project.module:4263 +#: Project.module:4258 +msgid "Unable to create source archive." +msgstr "" + +#: Project.module:4275 msgid "Create source package" msgstr "" -#: Project.module:4264 +#: Project.module:4276 msgid "Source packages" msgstr "" -#: Project.module:4555 +#: Project.module:4567 msgid "Cannot copy file &1." msgstr "" -#: Project.module:4603 +#: Project.module:4615 msgid "Cannot create link &1." msgstr "" -#: Project.module:4618 +#: Project.module:4630 msgid "Cannot move a directory inside itself." msgstr "" -#: Project.module:4686 +#: Project.module:4698 msgid "Cannot move file &1." msgstr "" -#: Project.module:5216 +#: Project.module:5228 msgid "Project cleanup..." msgstr "" -#: Project.module:5222 +#: Project.module:5234 msgid "Project files conversion..." msgstr "" -#: Project.module:5252 +#: Project.module:5264 msgid "Unable to convert &1" msgstr "" diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 38d6fc6ae..ec6c0a763 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -4214,6 +4214,7 @@ Public Sub MakeSourcePackageTo(sPath As String) Dim sCmd As String Dim sOpt As String Dim sIgnore As String + Dim sTemp As String Inc Application.Busy @@ -4227,8 +4228,10 @@ Public Sub MakeSourcePackageTo(sPath As String) sOpt = "J" Endif + sTemp = File.SetExt(Temp$(), File.Ext(sPath)) + sCmd = "cd " & Shell$(File.Dir(Project.Dir)) & ";" - sCmd &= " tar cfvh" & sOpt & " " & Shell$(sPath) + sCmd &= " tar cfvh" & sOpt & " " & Shell$(sTemp) sCmd &= " --exclude=" & Shell$(".gambas/*") sCmd &= " --exclude=" & Shell$("*~") sCmd &= " --exclude=" & Shell$("core.*") @@ -4243,7 +4246,16 @@ Public Sub MakeSourcePackageTo(sPath As String) Shell sCmd Wait + Kill sPath + Copy sTemp To sPath + Try Kill sTemp + Dec Application.Busy + +Catch + + Dec Application.Busy + Message.Error(("Unable to create source archive.") & "\n\n" & Error.Text) End