Created
April 18, 2015 16:36
-
-
Save kratsg/b9c87d94b82b9dc6a211 to your computer and use it in GitHub Desktop.
argparse for checking out packages and parsing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import argparse | |
parser = argparse.ArgumentParser(description='Checkout packages and apply patches!', usage='%(prog)s version') | |
version_parser = parser.add_subparsers() | |
for version in ['2.1.27', '2.1.28', '2.1.29', '2.1.30']: | |
sp = version_parser.add_parser('%s' % version, help='Use AnalysisBase %s.' % version) | |
sp.set_defaults(version=version) | |
args = parser.parse_args() | |
list_pkg = ["atlasoff/Reconstruction/egamma/egammaMVACalib/tags/egammaMVACalib-01-00-43", | |
"atlasoff/Control/xAODRootAccess/tags/xAODRootAccess-00-01-04", | |
"ElectronEfficiencyCorrection"] | |
for package_tag in list_pkg: | |
print "package: %s" %(package_tag) | |
os.system("rc checkout_pkg %s" % (package_tag) ) | |
os.chdir("./ElectronEfficiencyCorrection/") | |
os.system("pwd") | |
os.system("patch -p0 -i ../xAODAnaHelpers/data/ElectronEfficiencyCorrection_Base.%s.diff" % args.version ) | |
os.chdir("../") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
versioning can be done via