downloader: Support multi distros for the binary list

Since we have renamed the original os-[std|rt].lst to support the
multi distros, so we also change the pattern with downloader.

TestPlan:
PASS: ./stx-init-env --rebuild --cache
PASS: stx shell
PASS: downloader

Story: 2011048
Task: 49702

Depends-On: https://review.opendev.org/c/starlingx/tools/+/911693
Depends-On: https://review.opendev.org/c/starlingx/integ/+/911710

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Change-Id: I5f14b11b07d68ccca050f689deb081021a0e9628
This commit is contained in:
Zhixiong Chi 2024-03-12 08:06:02 +00:00
parent 2a8bec7684
commit 519333bf73
1 changed files with 6 additions and 5 deletions

View File

@ -34,7 +34,7 @@ mirror_root = os.environ.get('STX_MIRROR')
stx_src_mirror = os.path.join(mirror_root, 'sources')
stx_bin_mirror = os.path.join(mirror_root, 'binaries')
DEBIAN_DISTRIBUTION = os.environ.get('DEBIAN_DISTRIBUTION')
all_binary_lists = ['base-' + DEBIAN_DISTRIBUTION + '.lst', 'os-std.lst', 'os-rt.lst']
all_binary_lists = ['base-' + DEBIAN_DISTRIBUTION + '.lst', 'os-' + DEBIAN_DISTRIBUTION + '-std.lst', 'os-' + DEBIAN_DISTRIBUTION + '-rt.lst']
types_pkg_dirs = ['debian_pkg_dirs', 'debian_pkg_dirs_rt', 'debian_pkg_dirs_installer']
logger = logging.getLogger('downloader')
@ -123,7 +123,8 @@ def get_all_stx_pkgs():
def get_all_binary_list(distro=STX_DEFAULT_DISTRO, layers=None, build_types=None):
"""
Return all binary packages listed in base-${DEBIAN_DISTRIBUTION}.lst, os-std.lst,os-rt.lst
Return all binary packages listed in base-${DEBIAN_DISTRIBUTION}.lst,
os-${DEBIAN_DISTRIBUTION}-std.lst,os-${DEBIAN_DISTRIBUTION}-rt.lst
"""
layer_binaries = {}
stx_config = os.path.join(os.environ.get('MY_REPO_ROOT_DIR'),
@ -154,7 +155,7 @@ def get_all_binary_list(distro=STX_DEFAULT_DISTRO, layers=None, build_types=None
logger.warning(' '.join([build_type, 'is not a valid build_type for distro', distro, 'of layer', layer]))
continue
pattern=''.join(['os-',build_type,'.lst'])
pattern=''.join(['os-', DEBIAN_DISTRIBUTION, '-', build_type, '.lst'])
for root, dirs, files in os.walk(search_dir):
for f in fnmatch.filter(files, pattern):
layer_binaries[layer].append(os.path.join(root, f))
@ -538,8 +539,8 @@ class DebDownloader(BaseDownloader):
def start(self):
"""Here define:
the complete set of binaries = base_${DEBIAN_DISTRIBUTION}.lst
+ <layer>/os-std.lst
+ <layer>/os-rt.lst
+ <layer>/os-${DEBIAN_DISTRIBUTION}-std.lst
+ <layer>/os-${DEBIAN_DISTRIBUTION}-rt.lst
"""
super(DebDownloader, self).clean()