mirror of
https://dev.iopsys.eu/iopsys/iopsyswrt.git
synced 2025-12-20 00:52:33 +08:00
iop: scripts: openwrt: Fix issue missed on review
This simplification was written, but accidentally not added in the merge request.
This commit is contained in:
@@ -79,17 +79,13 @@ def add_feed_remote(feed_name, feed_dir, feed_openwrt_url, fetch):
|
|||||||
logging.warning(f"Feed directory {feed_dir} doesn't exist, skipping")
|
logging.warning(f"Feed directory {feed_dir} doesn't exist, skipping")
|
||||||
return
|
return
|
||||||
remotes = git_cmd_wrapper(["git", "-C", feed_dir, "remote"])
|
remotes = git_cmd_wrapper(["git", "-C", feed_dir, "remote"])
|
||||||
remote_exists = False
|
|
||||||
for remote_name in remotes.strip().split("\n"):
|
for remote_name in remotes.strip().split("\n"):
|
||||||
url = git_cmd_wrapper(["git", "-C", feed_dir, "config", "get", f"remote.{remote_name}.url"])
|
url = git_cmd_wrapper(["git", "-C", feed_dir, "config", "get", f"remote.{remote_name}.url"])
|
||||||
if "://git.openwrt.org/" in url:
|
if "://git.openwrt.org/" in url:
|
||||||
found_name = remote_name
|
logging.info(
|
||||||
remote_exists = True
|
f"Nothing to do for feed {feed_name}, {remote_name} already exists"
|
||||||
if remote_exists:
|
)
|
||||||
logging.info(
|
return
|
||||||
f"Nothing to do for feed {feed_name}, {found_name} already exists"
|
|
||||||
)
|
|
||||||
return
|
|
||||||
|
|
||||||
logging.info(f"Adding openwrt remote for feed {feed_name}")
|
logging.info(f"Adding openwrt remote for feed {feed_name}")
|
||||||
add_cmd = ["git", "-C", feed_dir, "remote", "add"]
|
add_cmd = ["git", "-C", feed_dir, "remote", "add"]
|
||||||
|
|||||||
Reference in New Issue
Block a user