From 05cc65b2e8513201e6672d28827d7a16e4138d40 Mon Sep 17 00:00:00 2001 From: Jeff Lenk Date: Thu, 3 Dec 2009 19:43:38 +0000 Subject: [PATCH] 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 --- Makefile.am | 3 ++- build/sounds_version.txt | 4 +++- libs/win32/Dowload 32khz Sounds.2008.vcproj | 4 ++-- libs/win32/Download 16khz Sounds.2008.vcproj | 4 ++-- libs/win32/Download 8khz Sounds.2008.vcproj | 4 ++-- libs/win32/util.vbs | 19 +++++++++++++++++++ 6 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 8a1366fdd1..366f039a81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,10 +16,11 @@ DEFAULT_SOUNDS=en-us-callie-8000 @target=`echo $@ | sed -e 's|^.*-||'`; \ target_prefix=`echo $@ | sed -e 's|-.*$$||'`; \ sound_perfix=`echo $@ | sed -e 's|-.*||'`; \ - sounds_version=`cat $(switch_srcdir)/build/sounds_version.txt`;\ moh_version=`cat $(switch_srcdir)/build/moh_version.txt`;\ full_sound_dir=`echo $@ | sed -e 's|^sounds||' | sed -e 's|^-||' | sed -e 's|-install$$||'`; \ test ! -z $$full_sound_dir || full_sound_dir=`echo $(DEFAULT_SOUNDS)`; \ + base_sound_dir=`echo $$full_sound_dir | sed -e 's|-[^-]*000$$||' ` ;\ + sounds_version=`grep $$base_sound_dir $(switch_srcdir)/build/sounds_version.txt | cut -d ' ' -f2`;\ soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$moh_version.tar.gz`; \ echo $$full_sound_dir | grep music >/dev/null || soundfile=`echo freeswitch-sounds-$$full_sound_dir-$$sounds_version.tar.gz`; \ if test "$$target" = "install"; then $(MAKE) $(AM_MAKEFLAGS) core_install; else $(MAKE) $(AM_MAKEFLAGS) core ; fi; \ diff --git a/build/sounds_version.txt b/build/sounds_version.txt index bb83058ed5..d26e74ef02 100644 --- a/build/sounds_version.txt +++ b/build/sounds_version.txt @@ -1 +1,3 @@ -1.0.12 +en-us-callie 1.0.12 +ru-RU-elena 1.0.12 + diff --git a/libs/win32/Dowload 32khz Sounds.2008.vcproj b/libs/win32/Dowload 32khz Sounds.2008.vcproj index fbad2a3095..5fcc1f5fec 100644 --- a/libs/win32/Dowload 32khz Sounds.2008.vcproj +++ b/libs/win32/Dowload 32khz Sounds.2008.vcproj @@ -75,7 +75,7 @@ @@ -85,7 +85,7 @@ diff --git a/libs/win32/Download 16khz Sounds.2008.vcproj b/libs/win32/Download 16khz Sounds.2008.vcproj index 789bb74947..e0588b4606 100644 --- a/libs/win32/Download 16khz Sounds.2008.vcproj +++ b/libs/win32/Download 16khz Sounds.2008.vcproj @@ -75,7 +75,7 @@ @@ -85,7 +85,7 @@ diff --git a/libs/win32/Download 8khz Sounds.2008.vcproj b/libs/win32/Download 8khz Sounds.2008.vcproj index a03410cbf6..8111460d8e 100644 --- a/libs/win32/Download 8khz Sounds.2008.vcproj +++ b/libs/win32/Download 8khz Sounds.2008.vcproj @@ -75,7 +75,7 @@ @@ -85,7 +85,7 @@ diff --git a/libs/win32/util.vbs b/libs/win32/util.vbs index 10a9541af4..c332dfb80a 100644 --- a/libs/win32/util.vbs +++ b/libs/win32/util.vbs @@ -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