Project

Profile

Help

Issue #6869

closed

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

Added by swisscom over 2 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
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 fieldsCLOSED - CURRENTRELEASEActions
Actions #1

Updated by quba42 over 2 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.

Actions #2

Updated by pulpbot over 2 years ago

  • Status changed from NEW to POST
Actions #3

Updated by quba42 over 2 years ago

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

Updated by quba42 over 2 years ago

  • Status changed from POST to MODIFIED
Actions #5

Updated by quba42 over 1 year ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF