Please consider to support symlinks to repositories in `/usr/share/updated/localrepo` for `list` and `check` commands
In case that users have external storage connected, it would be useful to allow localrepo
repositories to reside on the external storage in order to avoid unnecessary wear to the internal eMMC. An easy way to achieve this is to create symlinks to the actual repository location in /usr/share/updater/localrepo
. However, currently such symlinks are secondary citizens which are not automatically recognized by the list
and check
sub-commands.
E.g. localrepo list
doesn't list packages when the default localrepo (/usr/share/updater/localrepo/user
) is a symlink (whereas the more explicit localrepo list user
works just fine).
An easy fix would be adding followlinks=True
to the os.walk(..)
call in localrepo.repo_list(..)
:
diff --git a/localrepo b/localrepo
index fd89fe9..a77481c 100755
--- a/localrepo
+++ b/localrepo
@@ -105,7 +105,7 @@ def split_index(lines):
def repo_list():
"Return list of repositories"
repos = []
- for root, _, files in os.walk(REPO_PATH):
+ for root, _, files in os.walk(REPO_PATH, followlinks=True):
if 'Packages.gz' in files:
repos.append(root[len(REPO_PATH)+1:])
return repos
Would you please consider adding this simple change?