Permalink
Browse files

added tag v1.5.3.6.3 to Github server and enabled zipball download of

PWGorilla sources.

Version.txt still in testing stage
  • Loading branch information...
1 parent 0a7d580 commit d2b9e9ead9291a6098be222e823d1b31b06c0753 @zdia committed May 7, 2012
Showing with 33 additions and 21 deletions.
  1. +32 −20 sources/gorilla.tcl
  2. +1 −1 utilities/version.txt
View
@@ -8700,11 +8700,6 @@ proc ::gorilla::remove-from-conflict-list { current_dbidx merged_dbidx current_t
# ----------------------------------------------------------------------
#
-proc alert { text } {
- puts $text
- # tk_dialog ...
-}
-
# ----------------------------------------------------------------------
proc gorilla::versionIsNewer { github } {
@@ -8785,31 +8780,35 @@ proc gorilla::versionCallback { w token total current } {
# ----------------------------------------------------------------------
proc gorilla::versionDownload { githubVersion url } {
+ # githubVersion - actual version on Github server
# url - the url of the file to be downloaded
#
# define target location
#
- # debug
- # tcl_platform(machine)
+ # urls for tests
# set url "http://cloud.github.com/downloads/zdia/gorilla/gorilla-1.4.4b-MacOSX.zip"
- # set path ""
- # set filename "/home/dia/Downloads/demo.png"
-
+ # set url http://nodeload.github.com/zdia/gorilla/zipball/v1.5.3.6.3
+
if { $::gorilla::preference(backupPath) eq "" } {
# place backup file into same directory as current password db file
set backupPath "~"
} else {
# place backup file into users preference directory
-
set backupPath $::gorilla::preference(backupPath)
if { ! [file isdirectory $backupPath] } {
- gorilla::ErrorPopup [mc "No valid directory. - \nPlease define a valid backup directory\nin the Preferences menu."] ]
- }
+ gorilla::ErrorPopup [mc "No valid directory. - \nPlease define a valid backup directory\nin the Preferences menu."]
+ return DIR_ERROR
+ }
}
set filename [ file join $backupPath [file tail $url] ]
+ if { [regexp nodeload $url] } {
+ # currently we use zipballs
+ append filename ".zip"
+ }
+
set out [open $filename w]
#
@@ -8818,6 +8817,8 @@ proc gorilla::versionDownload { githubVersion url } {
if { [catch {set gitDownload [::http::geturl $url -validate 1]} oops] } {
gorilla::ErrorPopup "[mc "Http error"]" $oops
+ close $out
+ return HTTP_ERROR
} else {
set fileMeta [http::meta $gitDownload]
set fileLen [dict get $fileMeta Content-Length]
@@ -8844,13 +8845,19 @@ proc gorilla::versionDownload { githubVersion url } {
-progress [ list gorilla::versionCallback .status-dl.pb ] -blocksize 4096]} oops] } {
gorilla::ErrorPopup "[mc "Http error"]" $oops
+ puts beep
+ close $out
+ # return HTTP_ERROR
} else {
# go on and check correct file size
if { [file size $filename] != $fileLen } {
gorilla::ErrorPopup "[mc "Download Error"]" "[mc "Downloaded File has wrong size."]"
+ close $out
+ destroy .status-dl
+ return DOWNLOAD_ERROR
} else {
tk_messageBox -title [mc "Download finished"] \
-message [mc "The new version was successfully downloaded as\n%s." [ file nativename $filename ] ] \
@@ -8860,6 +8867,7 @@ proc gorilla::versionDownload { githubVersion url } {
http::cleanup $gitDownload
destroy .status-dl
close $out
+ return GORILLA_OK
} ;# end proc gorilla::versionDownload
@@ -8871,11 +8879,15 @@ proc gorilla::versionLookup {} {
load-package http
- switch [tk windowingsystem] {
- x11 { set platform Linux }
- win32 { set platform Windows }
- aqua { set platform MacOSX }
- default { set platform source }
+ if { [regexp tclsh [info nameofexecutable]] } {
+ set platform source
+ } else {
+ switch [tk windowingsystem] {
+ x11 { set platform Linux }
+ win32 { set platform Windows }
+ aqua { set platform MacOSX }
+ default { set platform unknown }
+ }
}
lassign [gorilla::versionGet $platform] githubVersion githubUrl
@@ -8885,7 +8897,7 @@ proc gorilla::versionLookup {} {
return
}
- if { [gorilla::versionIsNewer githubVersion] } {
+ if { [gorilla::versionIsNewer $githubVersion] } {
set message "[ mc "You are running version %s." [ regexp {Revision: ([0-9.]+)} $::gorillaVersion dummy version ; set version ] ]\n\n"
@@ -8902,7 +8914,7 @@ proc gorilla::versionLookup {} {
if { $answer eq "yes" } { gorilla::versionDownload $githubVersion $githubUrl }
} else {
- set message [mc "No new version for platform $platform"]
+ set message [mc "No new version available"]
tk_messageBox -message $message -icon info -type ok
}
View
@@ -1,2 +1,2 @@
-Linux {version 1.5.3.6.4 url {i686 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.bin x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363_64.bin}} MacOSX {version 1.5.3.7.3 url {i868 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.zip x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.zip}} Windows {version 1.5.3.7.1 url {i686 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.exe x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363_64.exe}} source {version 1.5.3.6.3 url https://nodeload.github.com/zdia/gorilla/tarball/<branch>}
+Linux {version 1.5.3.6.4 url {i686 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.bin x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363_64.bin}} MacOSX {version 1.5.3.7.3 url {i868 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.zip x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.zip}} Windows {version 1.5.3.7.1 url {i686 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363.exe x86_64 http://cloud.github.com/downloads/zdia/gorilla/gorilla15363_64.exe}} source {version 1.5.3.6.5 url http://nodeload.github.com/zdia/gorilla/zipball/v1.5.3.6.3}

0 comments on commit d2b9e9e

Please sign in to comment.