litex_setup: Make compat_args optional, fix dev mode.

This commit is contained in:
Florent Kermarrec 2021-10-26 15:16:43 +02:00
parent dab4845c9b
commit f6562195d5
1 changed files with 9 additions and 8 deletions

View File

@ -224,22 +224,23 @@ def main():
parser.add_argument("--gcc", default=None, help="Download/Extract GCC Toolchain (riscv, powerpc, openrisc or lm32).") parser.add_argument("--gcc", default=None, help="Download/Extract GCC Toolchain (riscv, powerpc, openrisc or lm32).")
# Development mode. # Development mode.
parser.add_argument("--dev", action="store_true", help="Development-Mode (no Auto-Update).") parser.add_argument("--dev", action="store_true", help="Development-Mode (no Auto-Update of litex_setup.py).")
# Retro-compatibility. # Retro-compatibility.
parser.add_argument("compat_args", nargs="+", help="Retro-Compatibility arguments (init, update, install or gcc).") parser.add_argument("compat_args", nargs="*", help="Retro-Compatibility arguments (init, update, install or gcc).")
args = parser.parse_args() args = parser.parse_args()
# Handle compat_args. # Handle compat_args.
for arg in args.compat_args: if args.compat_args is not None:
if arg in ["init", "update", "install"]: for arg in args.compat_args:
setattr(args, arg, True) if arg in ["init", "update", "install"]:
if arg in ["gcc"]: setattr(args, arg, True)
args.gcc = "riscv" if arg in ["gcc"]:
args.gcc = "riscv"
# Location/Auto-Update. # Location/Auto-Update.
litex_setup_location_check() litex_setup_location_check()
if args.dev: if not args.dev:
litex_setup_auto_update() litex_setup_auto_update()
# Init. # Init.