add changes for sounds download to allow independent version specific selection

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15777 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Jeff Lenk
2009-12-03 19:43:38 +00:00
parent 718671a30d
commit 05cc65b2e8
6 changed files with 30 additions and 8 deletions

View File

@@ -45,6 +45,8 @@ If objArgs.Count >=3 Then
Wget objArgs(1), Showpath(objArgs(2))
Case "GetUnzip"
WgetUnCompress objArgs(1), Showpath(objArgs(2))
Case "GetUnzipSounds"
WgetSounds objArgs(1), objArgs(2), Showpath(objArgs(3)), objArgs(4)
Case "Version"
'CreateVersion(tmpFolder, VersionDir, includebase, includedest)
CreateVersion Showpath(objArgs(1)), Showpath(objArgs(2)), objArgs(3), objArgs(4)
@@ -56,6 +58,23 @@ End If
' Utility Subroutines
' *******************
Sub WgetSounds(PrimaryName, Freq, DestFolder, VersionFile)
BaseURL = "http://files.freeswitch.org/freeswitch-sounds"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(VersionFile,1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.Readline
versionPos = InstrRev(strLine, " ", -1, 1)
name = Left(strLine, versionPos-1)
if name = PrimaryName Then
version = Right(strLine, Len(strLine) - versionPos)
Wscript.Echo "Sound name: " & name & " Version " & version
URL = BaseURL & "-" & name & "-" & Freq &"-" & version & ".tar.gz"
Wscript.Echo "URL: " & URL
WgetUnCompress URL, Showpath(DestFolder)
End If
Loop
End Sub
Sub WgetUnCompress(URL, DestFolder)
If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If