|
|
@@ -181,6 +181,8 @@ class AptProvider(object): |
|
|
|
print("Generating metadata for repo:{} dist:{}".format(dist.repo.name, dist.name)) |
|
|
|
|
|
|
|
str_packages = "" |
|
|
|
arches = set() |
|
|
|
ignored_arches = set(["all"]) |
|
|
|
|
|
|
|
for package in session.query(AptPackage) \ |
|
|
|
.filter(AptPackage.repo == dist.repo, |
|
|
@@ -197,25 +199,39 @@ class AptProvider(object): |
|
|
|
|
|
|
|
str_packages += "\n" |
|
|
|
|
|
|
|
if AptPackage.arch and AptPackage.arch not in ignored_arches: |
|
|
|
arches.update([package.arch]) |
|
|
|
|
|
|
|
dist.packages_cache = str_packages.encode("utf-8") |
|
|
|
|
|
|
|
release_hashes = hashmany(dist.packages_cache) |
|
|
|
|
|
|
|
if arches: |
|
|
|
arch = arches.pop() |
|
|
|
if arches: |
|
|
|
print("multiple arches in one dist/repo is not supported") |
|
|
|
else: |
|
|
|
arch = "all" # TODO is this correct? |
|
|
|
|
|
|
|
str_release = """Origin: . {dist} |
|
|
|
Label: . {dist} |
|
|
|
Suite: {dist} |
|
|
|
Codename: {dist} |
|
|
|
Date: {time} |
|
|
|
Architectures: amd64 |
|
|
|
Architectures: {arch} |
|
|
|
Components: main |
|
|
|
Description: Generated by Repobot |
|
|
|
""".format(dist=dist.name, time=datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S UTC")) |
|
|
|
""".format( |
|
|
|
dist=dist.name, |
|
|
|
arch=arch, |
|
|
|
time=datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S UTC") |
|
|
|
) |
|
|
|
for algo, algoname in algos.items(): |
|
|
|
str_release += "{}:\n {} {} {}/{}/{}\n".format(algoname, |
|
|
|
release_hashes[algo], |
|
|
|
len(dist.packages_cache), |
|
|
|
"main", #TODO component |
|
|
|
"binary-amd64", #TODO whatever this was |
|
|
|
"binary-{}".format(arch), #TODO whatever this was |
|
|
|
"Packages") |
|
|
|
|
|
|
|
dist.release_cache = str_release.encode("utf-8") |
|
|
|