Project

Profile

Help

Issue #6869

Pulp 3 - pulp-deb : Add "Date" metadata in Release file

Added by swisscom 5 months ago. Updated 5 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version - Debian:
master
Platform Release:
Target Release - Debian:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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

Related to Debian Support - Issue #6907: Rework release file fieldsMODIFIED<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

History

#1 Updated by quba42 5 months 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.

#2 Updated by pulpbot 5 months ago

  • Status changed from NEW to POST

#3 Updated by quba42 5 months ago

  • Related to Issue #6907: Rework release file fields added

#4 Updated by quba42 5 months ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF