Browse Source

clone: Create metadata for empty components

In certain scenarios, mirror components (e.g. trusty-security)
are present in both packetary configuration input, and in target
system's apt source definitions, but contain no packages of interest.

For such repository/requirements combinations, packetary currently
skips creating metadata (Release, Packages) for those components,
which leads to the partial mirror missing some critical files for apt,
(an empty file would be enough).

e.g.: Using packetary to create a partial Ubuntu mirror, then trying
to build a bootstrap image from the new mirror leads to:

W: Failed to fetch http://127.0.0.1:8080/mirrors/ubuntu/dists/\
   trusty-security/multiverse/binary-amd64/Packages  404

Closes-bug: 1638631

Change-Id: I850b43d5b4d8742d99e9a5702cc9ad4de881a401
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Alexandru Avadanii 2 years ago
parent
commit
cb261b0994
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      packetary/api/repositories.py

+ 2
- 1
packetary/api/repositories.py View File

@@ -117,7 +117,8 @@ class RepositoryApi(object):
117 117
 
118 118
         repositories = self.controller.load_repositories(repos_data)
119 119
         all_packages = self._get_packages(repositories, requirements_data)
120
-        package_groups = defaultdict(set)
120
+        # create a empty package group even repo is empty
121
+        package_groups = {repo: set() for repo in repositories}
121 122
         for pkg in all_packages:
122 123
             package_groups[pkg.repository].add(pkg)
123 124
 

Loading…
Cancel
Save