File: createConf.vbs

package info (click to toggle)
pgadmin3 1.20.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 73,704 kB
  • ctags: 18,591
  • sloc: cpp: 193,786; ansic: 18,736; sh: 5,154; pascal: 1,120; yacc: 927; makefile: 516; lex: 421; xml: 126; perl: 40
file content (29 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Set objFS = CreateObject("Scripting.FileSystemObject")

' *********** Read the version from version.h ***********
strFile= "..\pgadmin\include\version.h"
Set objFile = objFS.OpenTextFile(strFile, 1)
Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
    If InStr(strLine,"#define VERSION_PACKAGE")> 0 then
	strLongToken= split(strLine)
	strLongVer = strLongToken(2)
    End If
Loop
objFile.Close
strShortToken = split(strLongVer, ".")
strShortVer = strShortToken(0) & "." & strShortToken(1)

' ********** Copy the conf.py.in file as conf.py *********
objFS.Copyfile "en_US\conf.py.in" , "en_US\conf.py"

' ****** Replace the Long and Short version in conf.py file ******
strConfFile = "en_US\conf.py"
Set objConfFile = objFS.OpenTextFile(strConfFile, 1)
strText = objConfFile.ReadAll
objConfFile.Close
strText = Replace(strText, "PGADMIN_LONG_VERSION", strLongVer)
strText = Replace(strText, "PGADMIN_SHORT_VERSION", strShortVer)
Set objConfFile = objFS.OpenTextFile(strConfFile, 2)
objConfFile.WriteLine strText
objConfFile.Close