[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#942104: release.debian.org: Will fail if "Suite" field is missing



Control: tag -1 + patch

On Thu, 10 Oct 2019, Ansgar wrote:
> https://wiki.debian.org/DebianRepository/Format#A.22Release.22_files
> says one of Suite and Codename is required.  Codename itself is not required.

Ok.

> I wouldn't be surprised if many tools just use one and assume it always
> exists and would recommend to always provide both.

Well, that's not really an option for me right now. Because APT will just
complain if you add a "Suite" when it was missing before hand.

In any case, here's a suggested patch (attached).

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/
>From 31acf2e02241082e6bce5419cabb42e8ab950775 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <raphael@offensive-security.com>
Date: Thu, 10 Oct 2019 15:00:00 +0200
Subject: [PATCH] Fall back to codename if Suite is not available

---
 britney2/inputs/suiteloader.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/britney2/inputs/suiteloader.py b/britney2/inputs/suiteloader.py
index 665b66f..ae77785 100644
--- a/britney2/inputs/suiteloader.py
+++ b/britney2/inputs/suiteloader.py
@@ -143,8 +143,8 @@ class DebMirrorLikeSuiteContentLoader(SuiteContentLoader):
             release_file = None
 
         if release_file is not None:
-            suite.name = release_file['Suite']
-            self.logger.info("Using suite name from Release file: %s", release_file['Suite'])
+            suite.name = release_file.get('Suite', release_file['Codename'])
+            self.logger.info("Using suite name from Release file: %s", suite.name)
 
     def _check_release_file(self, target_suite, missing_config_msg):
         try:
-- 
2.23.0


Reply to: