Bug#1103441: apt: Patch to configure output of modernize notice

Tyler Riddle <[email protected]>
Newsgroups gmane.linux.debian.apt.devel
Message-ID <174491573834.126678.1186607354703030309.reportbug__6672.68384001858$1744915893$gmane$org@gornon>
Package: apt
Version: 3.0.0
Followup-For: Bug #1103441
X-Debbugs-Cc: [email protected]

Dear Maintainer,

I've got a patch that enables the behavior I described. By default the notice
is shown but if the APT::Cmd::Show-Modernize-Available config variable is set
to false the notice is not displayed to the user. The audit log entries are
still generated regardless of the configuration setting.


-- Package-specific info:

-- (no /etc/apt/preferences present) --


-- (no /etc/apt/preferences.d/* present) --


-- (/etc/apt/sources.list present, but not submitted) --


-- (/etc/apt/sources.list.d/brave-browser-release.list present, but not submitted) --


-- (/etc/apt/sources.list.d/element-io.list present, but not submitted) --


-- (/etc/apt/sources.list.d/ksp-ckan.list present, but not submitted) --


-- (/etc/apt/sources.list.d/vscode.list present, but not submitted) --


-- (/etc/apt/sources.list.d/winehq-trixie.sources present, but not submitted) --


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.12.21-amd64 (SMP w/16 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages apt depends on:
ii  adduser                 3.150
ii  base-passwd             3.6.7
ii  debian-archive-keyring  2025.1
ii  libapt-pkg7.0           3.0.0
ii  libc6                   2.41-6
ii  libgcc-s1               14.2.0-19
ii  libseccomp2             2.6.0-2
ii  libssl3t64              3.5.0-1
ii  libstdc++6              14.2.0-19
ii  libsystemd0             257.5-2
ii  sqv                     1.3.0-1

Versions of packages apt recommends:
ii  ca-certificates  20241223

Versions of packages apt suggests:
pn  apt-doc                      <none>
pn  aptitude | synaptic | wajig  <none>
ii  dpkg-dev                     1.22.18
ii  gnupg                        2.2.46-6
ii  powermgmt-base               1.38

-- no debconf information
no-modernize-notice.patch (text/plain, 1018 B)
diff -ru apt-3.0.0.orig/apt-private/private-update.cc apt-3.0.0/apt-private/private-update.cc
--- apt-3.0.0.orig/apt-private/private-update.cc	2025-04-04 14:32:19.000000000 -0600
+++ apt-3.0.0/apt-private/private-update.cc	2025-04-17 12:27:09.942688996 -0600
@@ -138,8 +138,11 @@
       {
          _error->Audit(_("Consider migrating all sources.list(5) entries to the deb822 .sources format"));
          _error->Audit(_("The deb822 .sources format supports both embedded as well as external OpenPGP keys"));
-	 _error->Audit(_("See apt-secure(8) for best practices in configuring repository signing."));
-	 _error->Notice(_("Some sources can be modernized. Run 'apt modernize-sources' to do so."));
+         _error->Audit(_("See apt-secure(8) for best practices in configuring repository signing."));
+
+         if (_config->FindB("APT::Update::Show-Modernize-Available", true)) {
+            _error->Notice(_("Some sources can be modernized. Run 'apt modernize-sources' to do so."));
+         }
       }
    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.