From c901909b9132a67bbba896130f03cd228d3a1981 Mon Sep 17 00:00:00 2001 From: Sanghyup Lee Date: Mon, 25 Mar 2013 16:29:48 +0900 Subject: [PATCH] Switch release branch from master to tizen_2.1 [Title] Switch release branch from master to tizen_2.1 [Issue] N/A [Problem] Release policy was changed. [Cause] N/A [Solution] Switch release branch from master to tizen_2.1. In addition, removed sdk branch related code because of no needs anymore. Change-Id: I47aaacd3695f16a8764ac737ef65cfef86ef6747 --- TizenScripts/release-webkit | 149 ++++++++++++++++++-------------------------- 1 file changed, 60 insertions(+), 89 deletions(-) diff --git a/TizenScripts/release-webkit b/TizenScripts/release-webkit index 0c84265..e24595b 100755 --- a/TizenScripts/release-webkit +++ b/TizenScripts/release-webkit @@ -10,32 +10,27 @@ import time # defines global options enableDryRun = False enableTizenMain = False -enableTizenSDK = False -version = 0 -commit_id = "" + +patchVersion = 0 +commitId = "" def help(): print (""" Usage: release-webkit [OPTION] -General WebKit package release order : - 1. Commit and push master branch. (--tizen-main) - 2. Commit and push sdk branch. (--tizen-sdk, After merged #1) - [Options] - --help, -h : Print this message. - --dry-run, -n : Don't actually run any commands; just print them. - --tizen-main, -i : Create Release commit in master branch and push to Gerrit. (Tizen:main) - --tizen-sdk, -d : Merge Release commit in sdk branch and push to Gerrit. (Tizen:SDK) + -h, --help : Print this message. + -n, --dry-run : Don't actually run any commands; just print them. + -i, --tizen : Create Release commit in tizen_2.1 branch and push to Gerrit. (Tizen:2.1:Main) """) def checkRepo(repo): currentRepo = "RSA" os.system("git remote -v > tmp") - input_file = open("tmp", "r") + inputFile = open("tmp", "r") - for line in input_file: + for line in inputFile: if (("origin" in line) and ("magnolia" in line)): print("ERROR : This command can executed only RSA repo.") exit() @@ -43,9 +38,9 @@ def checkRepo(repo): def checkoutBranch(branch): findBranch = False os.system("git branch > tmp") - input_file = open("tmp", "r") + inputFile = open("tmp", "r") - for line in input_file: + for line in inputFile: if (line.find(branch) > -1): execute("git checkout " + branch) findBranch = True @@ -53,7 +48,7 @@ def checkoutBranch(branch): if findBranch == False: execute("git checkout -b " + branch + " origin/" + branch) - input_file.close() + inputFile.close() os.system("rm tmp") def execute(command): @@ -69,31 +64,30 @@ def getPath(): return path def getTagMsg(branch): - global commit_id, version + global commitId, patchVersion os.system("git log " + branch + " > tmp") #Find commit id, tag msg - input_file = open("tmp","r") + inputFile = open("tmp","r") #Find commit Id - for line in input_file: + for line in inputFile: if "commit" in line: - commit_id = line.replace("commit ","").strip() + commitId = line.replace("commit ","").strip() elif line.find("[Release] Webkit2-efl-123997") == 4: - version = line.replace("[Release] ", "") - version = version.strip() + patchVersion = line.replace("[Release] ", "").strip() break - input_file.close() + inputFile.close() tag = "" - os.system("git log " + commit_id + " > tmp") - input_file = open("tmp","r") + os.system("git log " + commitId + " > tmp") + inputFile = open("tmp","r") findFirstCommit = False saveTag = False - for line in input_file: + for line in inputFile: if line.find("[") == 4: if "[Release] Webkit2" in line: if findFirstCommit == False: @@ -121,10 +115,10 @@ def getTagMsg(branch): saveTag = False if saveTag: tag += line.strip() + '\n' - output_file = open("tmp_tag","w") - output_file.write(tag) - output_file.close() - input_file.close() + outputFile = open("tmp_tag","w") + outputFile.write(tag) + outputFile.close() + inputFile.close() os.system("rm tmp") @@ -133,8 +127,8 @@ def checkNewPatch(): isFirst = False noPatch = False - input_file = open("tmp_log", "r") - for line in input_file: + inputFile = open("tmp_log", "r") + for line in inputFile: if "commit" in line: if isFirst: break @@ -145,7 +139,7 @@ def checkNewPatch(): if "[Release] Webkit2" in line: noPatch = True - input_file.close() + inputFile.close() os.system("rm tmp_log") if noPatch: @@ -153,28 +147,28 @@ def checkNewPatch(): exit() def versionUp(minor): - global version + global patchVersion path = getPath() # Change version in OptionsTizen.cmake - input_file = open(path + "Source/cmake/OptionsTizen.cmake","r") - output_file = open("tmp","w") + inputFile = open(path + "Source/cmake/OptionsTizen.cmake","r") + outputFile = open("tmp","w") - for line in input_file: + for line in inputFile: if "SET(PROJECT_VERSION_PATCH" in line: - version = line.replace("SET(PROJECT_VERSION_PATCH ", "") - version = version.replace(")", "") + patchVersion = line.replace("SET(PROJECT_VERSION_PATCH ", "") + patchVersion = patchVersion.replace(")", "") - version = int(version) + 1 + patchVersion = int(patchVersion) + 1 - tmp = "SET(PROJECT_VERSION_PATCH " + str(version) +")\n" - output_file.write(tmp) + tmp = "SET(PROJECT_VERSION_PATCH " + str(patchVersion) +")\n" + outputFile.write(tmp) print "Modified PROJECT_VERSION_PATCH in OptionsTizen.cmake to " + tmp.strip() else: - output_file.write(line) + outputFile.write(line) - input_file.close() - output_file.close() + inputFile.close() + outputFile.close() if enableDryRun: os.system("rm tmp") @@ -183,19 +177,19 @@ def versionUp(minor): os.system("mv tmp " + path + "Source/cmake/OptionsTizen.cmake") # Change version in webkit2-efl.spec - input_file = open(path + "packaging/webkit2-efl.spec","r") - output_file = open("tmp","w") + inputFile = open(path + "packaging/webkit2-efl.spec","r") + outputFile = open("tmp","w") - for line in input_file: + for line in inputFile: if "Version:" in line: - tmp = "Version: 123997_0." + str(minor) + "." + str(version) + "\n" - output_file.write(tmp) + tmp = "Version: 123997_0." + str(minor) + "." + str(patchVersion) + "\n" + outputFile.write(tmp) print "Modified Version in webkit2-efl.spec to " + tmp.strip() else: - output_file.write(line) + outputFile.write(line) - input_file.close() - output_file.close() + inputFile.close() + outputFile.close() if enableDryRun: os.system("rm tmp") @@ -206,45 +200,26 @@ def versionUp(minor): execute("git add " + path + "Source/cmake/OptionsTizen.cmake " + path + "packaging/webkit2-efl.spec" ) def TizenMain(): - global version - path = getPath() - + global patchVersion + branchName = "tizen_2.1" + minorVersion = 11 checkRepo("RSA") - checkoutBranch("master") + checkoutBranch(branchName) checkNewPatch() - versionUp(10) - execute("git commit -m '[Release] Webkit2-efl-123997_0.10." + str(version) + "'" ) - getTagMsg("master") - execute("git tag -a submit/trunk/`date --utc +%Y%m%d.%H%M%S` -F tmp_tag") - execute("git push --tags origin HEAD:refs/for/master") - os.system("rm tmp_tag") - - print "[Tizen:Main release] finished." - -def TizenSDK(): - global commit_id - checkRepo("RSA") - checkoutBranch("sdk") - execute("git pull --rebase") - - getTagMsg("origin/master") - execute("git merge " + commit_id) - execute("git commit --amend -m 'Merge commit " + commit_id.strip() + "'") - execute("git tag -a submit/sdk/`date --utc +%Y%m%d.%H%M%S` -F tmp_tag") - execute("git push --tags origin HEAD:refs/for/sdk") - os.system("rm tmp_tag") - - print "[Tizen:SDK release] finished." - + versionUp(minorVersion) + execute("git commit -m '[Release] Webkit2-efl-123997_0." + str(minorVersion) + "." + str(patchVersion) + "'" ) + getTagMsg(branchName) + execute("git tag -a submit/" + branchName + "/`date --utc +%Y%m%d.%H%M%S` -F tmp_tag") + execute("git push --tags origin HEAD:refs/for/" + branchName) + + print "[Tizen:2.1:Main release] finished." def release(): count = 0 if enableTizenMain: count = count + 1 - if enableTizenSDK: - count = count + 1 if count > 1: print "ERROR : Package release is can't executed two branch simultaneously " @@ -252,15 +227,13 @@ def release(): if enableTizenMain: TizenMain() - elif enableTizenSDK: - TizenSDK() if count == 0: help() def main(): - global enableDryRun, enableTizenMain, enableTizenSDK - optlist, args = getopt.getopt(sys.argv[1:], 'hdeilnm:o', [ 'help', 'dry-run', 'tizen-main', 'tizen-sdk']) + global enableDryRun, enableTizenMain + optlist, args = getopt.getopt(sys.argv[1:], 'hdeilnm:o', [ 'help', 'dry-run', 'tizen']) for opt, var in optlist: if opt in ('--help', '-h'): help() @@ -269,7 +242,5 @@ def main(): enableDryRun = True if opt in ('--tizen-main', '-i'): enableTizenMain = True - if opt in ('--tizen-sdk', '-d'): - enableTizenSDK = True release() main() -- 2.7.4