From 405ec9c524af88bb2560373d994e99f086d82b53 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 28 Nov 2024 15:42:45 +0100 Subject: [PATCH] setup.py: add option to define build tree Signed-off-by: John Crispin --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5b65bef9a..9f5104ef9 100755 --- a/setup.py +++ b/setup.py @@ -104,7 +104,7 @@ def update_patches(): ) os.chdir(openwrt) run( - ["git", "format-patch", config.get("revision", config["branch"]), "-o", "../patches"], + ["git", "format-patch", config.get("revision", config["branch"]), "-o", base_dir / "patches"], check=True, ) print("### Updating done") @@ -120,12 +120,12 @@ setup = False update = False rebase = False config = "config.yml" -profiles = "../profiles" +profiles = base_dir / "profiles" openwrt = "openwrt" git_ref = "" try: - opts, args = getopt.getopt(sys.argv[1:], "srdc:f:u2", ["setup", "rebase", "config=", "folder=", "reference=", "update", "20x" ]) + opts, args = getopt.getopt(sys.argv[1:], "srd:c:f:u2", ["setup", "rebase", "config=", "folder=", "reference=", "update", "20x", "directory=" ]) except getopt.GetoptError as err: print(err) sys.exit(2) @@ -142,6 +142,8 @@ for o, a in opts: config = a elif o in ("--reference"): git_ref = a + elif o in ("-d", "--directory"): + openwrt = a else: assert False, "unhandled option"