Project

Profile

Help

Issue #6869

closed

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

Added by swisscom over 4 years ago. Updated over 3 years 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

Also available in: Atom PDF