summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <[email protected]>2024-03-11 08:25:18 +0000
committerServer Team CI Bot <[email protected]>2024-03-11 08:25:18 +0000
commit3d0994a3bfb47318bd8b4c0aa5e345e198eabe77 (patch)
treeef92a746e385ac1810dfd5222b3e90e2380d5771
parent5094d95fa5b8506412979e21548069bc12681dc7 (diff)
apt-config: enable deb822 sources from 24.04 onwards
This reverts commit a7640fdcac396f9f09044dc7ca7553043ce4231c and applies further modifications to enable deb822 sources starting from 24.04 and not 23.10. LP: #2056308 Signed-off-by: Olivier Gayot <[email protected]>
-rw-r--r--curtin/commands/apt_config.py14
-rw-r--r--doc/topics/apt_source.rst35
-rw-r--r--tests/unittests/test_apt_source.py5
3 files changed, 21 insertions, 33 deletions
diff --git a/curtin/commands/apt_config.py b/curtin/commands/apt_config.py
index af02298c..ce2cb75b 100644
--- a/curtin/commands/apt_config.py
+++ b/curtin/commands/apt_config.py
@@ -75,15 +75,8 @@ def want_deb822(target=None):
False otherwise.
This is determined by the version of Ubuntu: deb822 is the default starting
- with Ubuntu 23.10 (Mantic Minotaur).
+ with Ubuntu 24.04 (Noble Numbat).
"""
-
- """
- FIXME: The deb822-by-default goal was delayed in 23.10.
- Re-enable/update this code (and the test case in
- tests/unittests/test_apt_source.py) when we are ready for deb822 by
- default.
-
os_release = distro.os_release(target)
if os_release.get('ID') != 'ubuntu':
@@ -97,10 +90,7 @@ def want_deb822(target=None):
if len(version) != 2:
return False
- return version[0] > 23 or (version[0] >= 23 and version[1] >= 10)
- """
-
- return False
+ return version[0] >= 24
class Deb822SourceFormatException(Exception):
diff --git a/doc/topics/apt_source.rst b/doc/topics/apt_source.rst
index 12baf9f3..902c9c64 100644
--- a/doc/topics/apt_source.rst
+++ b/doc/topics/apt_source.rst
@@ -132,29 +132,28 @@ That would be specified as ::
The file examples/apt-source.yaml holds various further examples that can be configured with this feature.
-..
- deb822 sources on Ubuntu >= 23.10
- ---------------------------------
+deb822 sources on Ubuntu >= 24.04
+---------------------------------
- By default, Ubuntu 23.10 and newer use the
- `deb822 format for apt sources <https://manpages.ubuntu.com/manpages/en/man5/sources.list.5.html>`_.
- When processing the apt configuration for a target system that should use deb822 sources, curtin will migrate legacy one-line sources to deb822 on-the-fly.
- The resulting configuration is functionally equivalent, but the sources on the target system will be formatted differently than provided in the configuration.
+By default, Ubuntu 24.04 and newer use the
+`deb822 format for apt sources <https://manpages.ubuntu.com/manpages/en/man5/sources.list.5.html>`_.
+When processing the apt configuration for a target system that should use deb822 sources, curtin will migrate legacy one-line sources to deb822 on-the-fly.
+The resulting configuration is functionally equivalent, but the sources on the target system will be formatted differently than provided in the configuration.
- For example, a configuration snippet that looks like ::
+For example, a configuration snippet that looks like ::
- apt:
- sources:
- proposed.list:
- source: |
- deb http://archive.ubuntu.com/ubuntu/ mantic-proposed main restricted universe multiverse
+ apt:
+ sources:
+ proposed.list:
+ source: |
+ deb http://archive.ubuntu.com/ubuntu/ noble-proposed main restricted universe multiverse
- will result in a file on the target system called ``/etc/apt/sources.list.d/proposed.sources`` that looks like ::
+will result in a file on the target system called ``/etc/apt/sources.list.d/proposed.sources`` that looks like ::
- Types: deb
- URIs: http://archive.ubuntu.com/ubuntu/
- Suites: mantic-proposed
- Components: main restricted universe multiverse
+ Types: deb
+ URIs: http://archive.ubuntu.com/ubuntu/
+ Suites: noble-proposed
+ Components: main restricted universe multiverse
Common snippets
~~~~~~~~~~~~~~~
diff --git a/tests/unittests/test_apt_source.py b/tests/unittests/test_apt_source.py
index 2065b86d..2b07045e 100644
--- a/tests/unittests/test_apt_source.py
+++ b/tests/unittests/test_apt_source.py
@@ -9,7 +9,7 @@ import re
import socket
-from unittest import (mock, skip)
+from unittest import mock
from unittest.mock import call
from aptsources.sourceslist import SourceEntry
@@ -1269,7 +1269,6 @@ deb-src http://ubuntu.com//ubuntu xenial universe multiverse
filepath = os.path.join(self.target, 'etc/apt/sources.list')
write_file.assert_called_with(filepath, expect, mode=0o644)
- @skip('Skipping until ready for migration to deb822 by default')
@mock.patch('curtin.distro.os_release')
def test_want_deb822(self, mock_os_release):
testdata = [
@@ -1277,7 +1276,7 @@ deb-src http://ubuntu.com//ubuntu xenial universe multiverse
('ubuntu', '22.04', False),
('ubuntu', '22.10', False),
('ubuntu', '23.04', False),
- ('ubuntu', '23.10', True),
+ ('ubuntu', '23.10', False),
('ubuntu', '24.04', True),
('ubuntu', '24.10', True),
('fedora', '38', False),