diff --git a/release_to_git/conditional_add.py b/release_to_git/conditional_add.py index 555fe7c..741fedf 100644 --- a/release_to_git/conditional_add.py +++ b/release_to_git/conditional_add.py @@ -75,21 +75,14 @@ def allGitRevisionsMatch(): break return match -# The definitive version info is stored within the USB driver installer import -versionPrefixFile = "prefix.txt" -revisionFile = "revision.txt" -def getVersionNumber(): - usbDriverSourceItem = sourceItems[0] - versionDir = os.path.join(workspace, usbDriverSourceItem[1]) - versionPrefixFilePath = os.path.join(versionDir, versionPrefixFile) - vpf = open(versionPrefixFilePath) - versionPrefix = vpf.readline().strip().lower() - vpf.close() - revisionFilePath = os.path.join(versionDir, revisionFile) - rp = open(revisionFilePath) - revision = rp.readline().strip().lower() +# The definitive version info is stored within the version import + +def getVersionNumber(): + versionFilePath = os.path.join(workspace, sourceItems[0][1], "buildstamp.txt") + rp = open(versionFilePath) + versionNumber = rp.readline().strip().lower() rp.close() - versionNumber = versionPrefix + revision + print("versionNumber: ",versionNumber) return versionNumber class RepoError(Exception): @@ -253,28 +246,13 @@ def main(): if not isCommitRequired(): print("Commit has not been demanded - exiting") sys.exit(0) - - #try: - # allRevisionsMatch = allGitRevisionsMatch() - #except RevisionError as r: - # print("The ", r.component(), " does not have a valid git revision") - # sys.exit(1) - # - #if not allRevisionsMatch: - # print("The git revisions of all the components do not match") - # sys.exit(1) - - + versionNumber = getVersionNumber() print("Version number of release is: ", versionNumber) if not createReleaseFolders(): print("The release folders could not be created") sys.exit(1) - - #if not makeDestinationPaths(): - # print("Failed to make destination directories") - # sys.exit(1) if not copySourceToDestination(): print("Failed to copy source to destination")