Source.clean(self)
self.removeArchives()
- def update (self, cmdProtocol = None):
+ def update (self, cmdProtocol = None, force = False):
if not self.isArchiveUpToDate():
self.fetchAndVerifyArchive()
self.filename = filename
self.checksum = checksum
- def update (self, cmdProtocol = None):
+ def update (self, cmdProtocol = None, force = False):
if not self.isFileUpToDate():
Source.clean(self)
self.fetchAndVerifyFile()
assert url != None
return url
- def update (self, cmdProtocol = None):
+ def update (self, cmdProtocol = None, force = False):
fullDstPath = os.path.join(EXTERNAL_DIR, self.baseDir, self.extractDir)
url = self.selectUrl(cmdProtocol)
(stdout, stderr) = proc.communicate()
if proc.returncode == 0:
execute(["git", "tag", "-d",tag])
- execute(["git", "fetch", "--tags", url, "+refs/heads/*:refs/remotes/origin/*"])
- execute(["git", "checkout", self.revision])
+ force_arg = ['--force'] if force else []
+ execute(["git", "fetch"] + force_arg + ["--tags", url, "+refs/heads/*:refs/remotes/origin/*"])
+ execute(["git", "checkout"] + force_arg + [self.revision])
finally:
popWorkingDir()
" Minimum python version required " + versionsForInsecureStr)
parser.add_argument('--protocol', dest='protocol', default=None, choices=['ssh', 'https'],
help="Select protocol to checkout git repositories.")
+ parser.add_argument('--force', dest='force', action='store_true', default=False,
+ help="Pass --force to git fetch and checkout commands")
args = parser.parse_args()
if args.clean:
pkg.clean()
else:
- pkg.update(args.protocol)
+ pkg.update(args.protocol, args.force)