def main(argv=None): if argv is None: argv = sys.argv if len(argv) < 2: print "Usage: ./configure-submodule.py submodule [submodule2 ...]" return 1 # extract module dependencies using Fake fake = Fake() fakefile = ijPath + "/Fakefile" fis = FileInputStream(fakefile) parser = fake.parse(fis, File(ijPath)) parser.parseRules([]) fis.close() # process each submodule specified for arg in argv[1:]: processSubModule(arg, parser)
from sys import exit print 'Usage:', argv[0], '<jar>', '[<timestamp-or-checksum>]' exit(1) if timestamp == None: print 'No timestamp found for', argv[1], '(locally modified)' from sys import exit exit(1) # Find out which path the jar comes from from fiji.build import Fake fakefile = getProperty('fiji.dir') + '/Fakefile' fake = Fake() from java.io import File, FileInputStream parser = fake.parse(FileInputStream(fakefile), File(getProperty('fiji.dir'))) parser.parseRules([]) print 'Getting rule for', argv[1] rule = parser.getRule(argv[1]) prereq = rule.getPrerequisiteString() space = prereq.find(' ') if space < 0: space = len(prereq) star = prereq.find('*', 0, space) if star < 0: star = space slash = prereq.rfind('/', 0, star) if slash > 0: prereq = prereq[:slash]