[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
This commit is contained in:
Benoît Minisini 2013-01-19 15:13:18 +00:00
parent 367110840c
commit 699268efeb
2 changed files with 27 additions and 11 deletions

View file

@ -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 ""

View file

@ -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