litex_setup: Add more comment, fix checkout when sha1 starting with 0.

This commit is contained in:
Florent Kermarrec 2021-10-07 19:03:29 +02:00
parent 1629bcbf30
commit 9f0a03100d
1 changed files with 5 additions and 3 deletions

View File

@ -16,7 +16,9 @@ if os.path.exists(".gitignore"):
# Repositories ------------------------------------------------------------------------------------- # Repositories -------------------------------------------------------------------------------------
# name, (url, recursive clone, develop, sha1) # Get SHA1: git rev-parse HEAD
# Name, (URL, Recursive clone, Develop, SHA1)
repos = [ repos = [
# HDL # HDL
("migen", ("https://github.com/m-labs/", True, True, None)), ("migen", ("https://github.com/m-labs/", True, True, None)),
@ -134,7 +136,7 @@ if "init" in sys.argv[1:]:
subprocess.check_call("git clone " + full_url + " " + opts, shell=True) subprocess.check_call("git clone " + full_url + " " + opts, shell=True)
if sha1 is not None: if sha1 is not None:
os.chdir(os.path.join(current_path, name)) os.chdir(os.path.join(current_path, name))
os.system("git checkout {:7x}".format(sha1)) os.system("git checkout {:040x}".format(sha1))
# Repositories update # Repositories update
if "update" in sys.argv[1:]: if "update" in sys.argv[1:]:
@ -153,7 +155,7 @@ if "update" in sys.argv[1:]:
subprocess.check_call("git submodule update --init --recursive", shell=True) subprocess.check_call("git submodule update --init --recursive", shell=True)
if sha1 is not None: if sha1 is not None:
os.chdir(os.path.join(current_path, name)) os.chdir(os.path.join(current_path, name))
os.system("git checkout {:7x}".format(sha1)) os.system("git checkout {:040x}".format(sha1))
# Repositories installation # Repositories installation
if "install" in sys.argv[1:]: if "install" in sys.argv[1:]: