mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-04-18 14:41:52 +00:00
Imported 2.566
No reason for CPC update specified.
This commit is contained in:
parent
e7f946de3b
commit
a7e440bdd6
18
debian/changelog
vendored
18
debian/changelog
vendored
@ -1,3 +1,21 @@
|
||||
livecd-rootfs (2.566) disco; urgency=medium
|
||||
|
||||
[ Julian Andres Klode ]
|
||||
* Do not mark direct dependencies of ubiquity as auto installed. This caused
|
||||
cryptsetup to remain auto on the installed system (LP: #1801629)
|
||||
|
||||
[ Tobias Koch ]
|
||||
* When the magic-proxy script could not find a valid InRelease file for the
|
||||
configured timestamp, it would fall back to serving the canonical version
|
||||
of it. This meant that builds would succeed, even though snap-shotting the
|
||||
repository failed.
|
||||
.
|
||||
This update makes the script return HTTP 404 when an InRelease by-hash
|
||||
link for a given combination of mirror, suite and timestamp cannot be
|
||||
found.
|
||||
|
||||
-- Julian Andres Klode <juliank@ubuntu.com> Tue, 26 Feb 2019 08:56:02 +0100
|
||||
|
||||
livecd-rootfs (2.565) disco; urgency=medium
|
||||
|
||||
* Also drop dependency on python.
|
||||
|
64
magic-proxy
64
magic-proxy
@ -771,41 +771,41 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
|
||||
|
||||
index = LPInReleaseIndex(mirror, suite,
|
||||
cache=self.server.inrelease_cache)
|
||||
inrelease = index.get_inrelease_for_timestamp(
|
||||
self.server.snapshot_stamp)
|
||||
|
||||
try:
|
||||
inrelease = index.get_inrelease_for_timestamp(
|
||||
self.server.snapshot_stamp)
|
||||
except LPInReleaseIndexError as e:
|
||||
inrelease = None
|
||||
if inrelease is None:
|
||||
self.__send_error(404, "No InRelease file found for given "
|
||||
"mirror, suite and timestamp.")
|
||||
return
|
||||
|
||||
if inrelease is not None:
|
||||
if target == "InRelease":
|
||||
# If target is InRelease, send back contents directly.
|
||||
data = inrelease.data.encode("utf-8")
|
||||
if target == "InRelease":
|
||||
# If target is InRelease, send back contents directly.
|
||||
data = inrelease.data.encode("utf-8")
|
||||
|
||||
self.log_message(
|
||||
"Inject InRelease '{}'".format(inrelease.hash))
|
||||
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Length", len(data))
|
||||
self.end_headers()
|
||||
|
||||
if verb == "GET":
|
||||
self.wfile.write(data)
|
||||
|
||||
return
|
||||
else:
|
||||
# If target hash is listed, then redirect to by-hash URL.
|
||||
hash_ = inrelease.get_hash_for(target)
|
||||
|
||||
if hash_:
|
||||
self.log_message(
|
||||
"Inject InRelease '{}'".format(inrelease.hash))
|
||||
"Inject {} for {}".format(hash_, target))
|
||||
|
||||
self.send_response(200)
|
||||
self.send_header("Content-Length", len(data))
|
||||
self.end_headers()
|
||||
target_path = target.rsplit("/", 1)[0]
|
||||
|
||||
if verb == "GET":
|
||||
self.wfile.write(data)
|
||||
|
||||
return
|
||||
else:
|
||||
# If target hash is listed, then redirect to by-hash URL.
|
||||
hash_ = inrelease.get_hash_for(target)
|
||||
|
||||
if hash_:
|
||||
self.log_message(
|
||||
"Inject {} for {}".format(hash_, target))
|
||||
|
||||
target_path = target.rsplit("/", 1)[0]
|
||||
|
||||
path = "{}/dists/{}/{}/by-hash/SHA256/{}"\
|
||||
.format(base, suite, target_path, hash_)
|
||||
path = "{}/dists/{}/{}/by-hash/SHA256/{}"\
|
||||
.format(base, suite, target_path, hash_)
|
||||
|
||||
try:
|
||||
client = http.client.HTTPConnection(host)
|
||||
@ -839,6 +839,12 @@ class ProxyingHTTPRequestHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.end_headers()
|
||||
shutil.copyfileobj(response, self.wfile)
|
||||
|
||||
def __send_error(self, status, message):
|
||||
"""Return an HTTP error status and a message in the response body."""
|
||||
self.send_response(status)
|
||||
self.send_header("Content-Type", "text/plain; charset=utf-8")
|
||||
self.wfile.write(message.encode("utf-8"))
|
||||
|
||||
|
||||
class MagicHTTPProxy(socketserver.ThreadingMixIn, http.server.HTTPServer):
|
||||
"""Tiny HTTP server using ProxyingHTTPRequestHandler instances to provide
|
||||
|
@ -23,6 +23,7 @@ def main():
|
||||
roots = set(pkg for pkg in cache if is_root(pkg))
|
||||
workset = set(roots)
|
||||
seen = set()
|
||||
ubiquity_depends = set()
|
||||
|
||||
with cache.actiongroup():
|
||||
while True:
|
||||
@ -33,7 +34,7 @@ def main():
|
||||
for pkg in sorted(to_proc):
|
||||
print(" Visiting", pkg, file=sys.stderr)
|
||||
|
||||
if pkg not in roots:
|
||||
if pkg not in roots and pkg not in ubiquity_depends:
|
||||
pkg.mark_auto()
|
||||
|
||||
for dep in (pkg.installed.dependencies +
|
||||
@ -41,6 +42,16 @@ def main():
|
||||
for bdep in dep.or_dependencies:
|
||||
for ver in bdep.target_versions:
|
||||
if ver.package.is_installed:
|
||||
if pkg.name == "ubiquity":
|
||||
ubiquity_depends.add(ver.package)
|
||||
if pkg.name != "ubiquity":
|
||||
# Reprocess this package again, as we did not mark it when we visited it from ubiquity
|
||||
try:
|
||||
ubiquity_depends.remove(ver.package)
|
||||
# This will raise the KeyError here if ubiquity did not depend on it
|
||||
seen.remove(ver.package)
|
||||
except KeyError:
|
||||
continue
|
||||
workset.add(ver.package)
|
||||
|
||||
seen.add(pkg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user