Issue #6869
closedPulp 3 - pulp-deb : Add "Date" metadata in Release file
Description
Dear support team,
In order to avoid warnings when connecting Debian or Ubuntu hosts APT client to a DEB repo published by Pulp, would it be possible to add the "Date" metadata in the Release file ?
To avoid these warnings, I fixed it by modifying pulp_deb/app/tasks/publishing.py as following (class _ReleaseHelper, line 208). Before :
def __init__(
self, publication, codename, components, architectures, label=None, description=None
):
self.publication = publication
self.release = deb822.Release()
self.release["Codename"] = codename
self.release["Architectures"] = " ".join(architectures)
if label:
self.release["Label"] = label
if description:
self.release["Description"] = description
self.release["MD5sum"] = []
self.release["SHA1"] = []
self.release["SHA256"] = []
self.release["SHA512"] = []
self.architectures = architectures
self.components = {name: _ComponentHelper(self, name) for name in components}
self.signing_service = publication.signing_service
After :
def __init__(
self, publication, codename, components, architectures, label=None, description=None
):
self.publication = publication
self.release = deb822.Release()
self.release["Codename"] = codename
# Ugly fix Lionel Widmer
self.release["Date"] = "Sat, 09 May 2020 09:51:02 UTC"
self.release["Architectures"] = " ".join(architectures)
if label:
self.release["Label"] = label
if description:
self.release["Description"] = description
self.release["MD5sum"] = []
self.release["SHA1"] = []
self.release["SHA256"] = []
self.release["SHA512"] = []
self.architectures = architectures
self.components = {name: _ComponentHelper(self, name) for name in components}
self.signing_service = publication.signing_service
def add_metadata(self, metadata):
artifact = metadata._artifacts.get()
Of course hardcoding a date is ugly but it was for a test, to validate it removes the warning, and it does.
According to Debian, the "Date" field in Release file is purely informational. However, it produces warnings if it is not present... https://wiki.debian.org/DebianRepository/Format
Thanks for your support
Related issues
Updated by quba42 over 4 years ago
I think we added a Date field in pulp2 and it should be rather trivial to do (I would add the date at the time of creating the publication).
Thanks for reporting this.
Added by quba42 over 4 years ago
Updated by pulpbot over 4 years ago
- Status changed from NEW to POST
Updated by quba42 over 4 years ago
- Related to Issue #6907: Rework release file fields added
Updated by quba42 over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset fa89b426ab369b5339a439f99b58e983c4e40e60.
Updated by quba42 over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Add Date field to Release files during publish
fixes #6869 https://pulp.plan.io/issues/6869
See also: https://wiki.debian.org/DebianRepository/Format#Date.2C_Valid-Until