Nick Rosbrook has proposed merging ~enr0n/curtin:deb822 into curtin:master.

Commit message:
Turn off migration to deb822 by default, and update appropriate docs/test to 
reflect this.

When we are actually ready for this, the logic in want_deb822() can be restored.

Requested reviews:
  Dan Bungert (dbungert)

For more details, see:
https://code.launchpad.net/~enr0n/curtin/+git/curtin/+merge/451474
-- 
Your team curtin developers is subscribed to branch curtin:master.
diff --git a/curtin/commands/apt_config.py b/curtin/commands/apt_config.py
index d2a12d5..dd8e250 100644
--- a/curtin/commands/apt_config.py
+++ b/curtin/commands/apt_config.py
@@ -77,6 +77,16 @@ def want_deb822(target=None):
     This is determined by the version of Ubuntu: deb822 is the default starting
     with Ubuntu 23.10 (Mantic Minotaur).
     """
+<<<<<<< curtin/commands/apt_config.py
+=======
+
+    """
+    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.
+
+>>>>>>> curtin/commands/apt_config.py
     os_release = distro.os_release(target)
 
     if os_release.get('ID') != 'ubuntu':
@@ -91,6 +101,12 @@ def want_deb822(target=None):
         return False
 
     return version[0] > 23 or (version[0] >= 23 and version[1] >= 10)
+<<<<<<< curtin/commands/apt_config.py
+=======
+    """
+
+    return False
+>>>>>>> curtin/commands/apt_config.py
 
 
 class Deb822SourceFormatException(Exception):
@@ -638,11 +654,14 @@ def _generate_sources_deb822(cfg, release, mirrors, target=None, arch=None):
         entry['Suites'] = list(set(entry['Suites']) - suites_to_disable)
         entry['Components'] = list(set(entry['Components']) - comps_to_disable)
 
+<<<<<<< curtin/commands/apt_config.py
         if not entry['Suites']:
             # It is invalid for a stanza to have zero suite configured. In
             # practise, it can happen when -security is disabled.
             continue
 
+=======
+>>>>>>> curtin/commands/apt_config.py
         stanzas.append(deb822_entry_to_str(entry))
 
     target_path = paths.target_path(target, sources_deb822)
diff --git a/doc/topics/apt_source.rst b/doc/topics/apt_source.rst
index 0dfaa34..2591ca1 100644
--- a/doc/topics/apt_source.rst
+++ b/doc/topics/apt_source.rst
@@ -131,6 +131,7 @@ That would be specified as ::
 
 The file examples/apt-source.yaml holds various further examples that can be configured with this feature.
 
+<<<<<<< doc/topics/apt_source.rst
 deb822 sources on Ubuntu >= 23.10
 ---------------------------------
 
@@ -153,6 +154,30 @@ will result in a file on the target system called ``/etc/apt/sources.list.d/prop
  URIs: http://archive.ubuntu.com/ubuntu/
  Suites: mantic-proposed
  Components: main restricted universe multiverse
+=======
+..
+    deb822 sources on Ubuntu >= 23.10
+    ---------------------------------
+
+    By default, Ubuntu 23.10 and newer use the deb822 format for apt sources.
+    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 ::
+
+     apt:
+       sources:
+         proposed.list:
+           source: |
+             deb http://archive.ubuntu.com/ubuntu/ mantic-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 ::
+
+     Types: deb
+     URIs: http://archive.ubuntu.com/ubuntu/
+     Suites: mantic-proposed
+     Components: main restricted universe multiverse
+>>>>>>> doc/topics/apt_source.rst
 
 Common snippets
 ~~~~~~~~~~~~~~~
diff --git a/tests/unittests/test_apt_source.py b/tests/unittests/test_apt_source.py
index 8146c68..3d75274 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
+from unittest import (mock, skip)
 from unittest.mock import call
 
 from aptsources.sourceslist import SourceEntry
@@ -1269,6 +1269,10 @@ 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)
 
+<<<<<<< tests/unittests/test_apt_source.py
+=======
+    @skip('Skipping until ready for migration to deb822 by default')
+>>>>>>> tests/unittests/test_apt_source.py
     @mock.patch('curtin.distro.os_release')
     def test_want_deb822(self, mock_os_release):
         testdata = [
@@ -1306,6 +1310,7 @@ deb-src http://ubuntu.com//ubuntu xenial universe multiverse
             'etc/apt/sources.list.d/ubuntu.sources': ((
                 'Types: deb\n'
                 'URIs: $MIRROR\n'
+<<<<<<< tests/unittests/test_apt_source.py
                 'Suites: $RELEASE $RELEASE-updates\n'
                 'components: main\n'
                 'signed-by: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n'
@@ -1314,6 +1319,9 @@ deb-src http://ubuntu.com//ubuntu xenial universe multiverse
                 'Types: deb\n'
                 'URIs: $MIRROR\n'
                 'Suites: $RELEASE-backports\n'
+=======
+                'Suites: $RELEASE $RELEASE-updates $RELEASE-backports\n'
+>>>>>>> tests/unittests/test_apt_source.py
                 'components: main\n'
                 'signed-by: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n'
                 '\n'
-- 
Mailing list: https://launchpad.net/~curtin-dev
Post to     : curtin-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~curtin-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to