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:
Olga Kitaina
2025-10-27 11:29:27 +04:00
parent 4a895ff413
commit 11e13dda3e

View File

@@ -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"]