View a markdown version of this page

從 dnf-plugin-support-info v1 遷移至 v2 - Amazon Linux 2023

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

從 dnf-plugin-support-info v1 遷移至 v2

dnf-plugin-support-info 套件具有重新設計的輸出格式的新主要版本 (v2)。本指南可協助您更新剖析dnf supportinfo輸出的任何指令碼或工具。

在轉換期間,v2 外掛程式隨附 legacy = 1中的 /etc/dnf/plugins/supportinfo.conf,保留 v1 相容的輸出。更新指令碼後,legacy = 0請將 設定為切換到 v2 輸出。

概觀

時間軸

事件 Timing (計時)
v2 外掛程式 (dnf-plugin-support-info 2.0) 可用 現在
外掛程式隨附 legacy = 1(v1 相容輸出) 初始 v2 版本
預設變更為 legacy = 0 未來的 AL2023 季度版本
不再維護 v1 格式 轉換期間之後

您需要做什麼

如果您有剖析主控台輸出、XML 輸出或從磁碟讀取 XML 檔案的指令碼,請更新這些指令碼來處理新的欄位名稱、結構和檔案路徑。如果您使用 --showjson,您的指令碼不需要變更,因為 JSON 輸出在 v1 和 v2 之間是相同的。如果您直接從磁碟讀取 XML 檔案,請切換到從設定的 下載 XML baseurl或使用 dnf supportinfo --show installed --showxml。

中斷需要 動作的變更

如果您剖析主控台輸出

詳細資訊欄位

外掛程式會變更它在您查詢特定套件時顯示的欄位標籤:

v1 標籤 v2 標籤 備註
支援狀態 目前狀態 已重新命名
支援期間 支援時間軸 重新命名,移至輸出結尾
支援陳述式 (已移除) 不再顯示
連結 連結 未變更 (可用時顯示)
其他資訊 其他資訊 未變更 (可用時顯示)
(不存在) 修補程式優先順序 新欄位
(不存在) 支援層級描述 新欄位
(不存在) 涵蓋嚴重性 新欄位
(不存在) Origin 新欄位

欄位標籤欄現在為 28 個字元寬 (先前為 20 個字元)。

v1: dnf supportinfo --pkg apr

Name : apr Version : 1.7.5-1.amzn2023.0.4 State : available Support Status : supported Support Periods : from 2023-03-15 : supported : from 2029-06-30 : unsupported Support Statement : Amazon Linux 2023 end-of-life Link : https://aws.amazon.com/amazon-linux-ami/faqs/ Other Info : This is the support statement for AL2023. The end-of-life : of Amazon Linux 2023 is June 2029. From this point, the : Amazon Linux 2023 packages will no longer receive any : updates from AWS.

v2: dnf supportinfo --pkg apr

Name : apr Version : 1.7.5-1.amzn2023.0.4 State : available Current Status : Supported Patch Priority : Full Support Support Level Description : Full security and bug fix support for all severities Covered Severities : Low, Medium, Important, Critical Origin : Amazon Linux 2023 Core Support Timeline : from 2023-03-15 : supported : from 2029-06-30 : unsupported

資料表資料欄

摘要資料表已從 6 欄變更為 7。v2 資料表也會顯示標頭列 (v1 不會):

v1 資料欄 v2 資料欄 變更
名稱 套件 已重新命名
版本 版本 未變更
State State 未變更
支援狀態 目前狀態 已重新命名
(不存在) 支援層級 新資料欄
日期 (例如 2029-06-30) 直到 (下一個階段) (例如 2029-06-30 (end_of_support)) 已重新命名,格式已變更
注意 注意 未變更
重要

日期欄現在會在括號中包含下一個階段名稱。如果您剖析此欄位,請更新您的 regex 或分隔符號邏輯。

v1: dnf supportinfo --show installed

iproute 6.10.0-319.amzn2023.0.1 installed supported 2029-06-30 Kernel6.18 has security support until June 2029 kernel6.12 6.12.90-120.164.amzn2023 installed supported 2029-06-30 Kernel6.12 has security support until June 2029

v2: dnf supportinfo --show installed

Package Version State Support Level Current Status Until (Next Phase) Note alternatives 1.15-2.amzn2023.0.2 installed Full Support Supported 2029-06-30 (unsupported) amazon-linux-repo-cdn 2023.12.20260611-0.amzn2023 installed Full Support Supported 2029-06-30 (unsupported) redis6 6.2.20-2.amzn2023.0.1 installed End of Support End of Life Upstream end-of-life for Redis 6 (redis6) is 2026-01-31

如果您剖析--showxml輸出

v2 --showxml輸出使用與 v1 不同的 XML 結構。根<package_support>元素相同,但子元素、屬性和階層已變更。

v1: dnf supportinfo --pkg apr --showxml

<?xml version="1.0" ?> <package_support current_as="2026-06-18"> <statements> <statement id="eol" marker="supported" start_date="2023-03-15" end_date="2029-06-30"> <summary>Amazon Linux 2023 end-of-life</summary> <text>This is the support statement for AL2023. The end-of-life of Amazon Linux 2023 is June 2029. From this point, the Amazon Linux 2023 packages will no longer receive any updates from AWS.</text> <link>https://aws.amazon.com/amazon-linux-ami/faqs/</link> <packages> <package name="apr" nevra="1.7.5-1.amzn2023.0.4"/> </packages> </statement> </statements> </package_support>

v2: dnf supportinfo --pkg apr --showxml

<?xml version='1.0' encoding='utf-8'?> <package_support current_as="2026-06-18"> <statements> <statement id="eol_lc" current_phase="supported"> <phases> <phase name="supported" start_date="2023-03-15"> <patch_priority>Full Support</patch_priority> <support_level_description>Full security and bug fix support for all severities</support_level_description> <covered_severities>Low, Medium, Important, Critical</covered_severities> </phase> <phase name="unsupported" start_date="2029-06-30"> <patch_priority>End of Support</patch_priority> <support_level_description>End of support - no further updates</support_level_description> </phase> </phases> <packages> <package name="apr" nevra="1.7.5-1.amzn2023.0.4" state="available" origin="Amazon Linux 2023 Core"/> </packages> </statement> </statements> </package_support>

主要結構差異:

  • v1 在 上使用 marker、start_date、end_date屬性<statement>與 <summary>、<text>、<link>子系

  • v2 使用具有支援層級詳細資訊的current_phase屬性和巢狀<phases>元素

  • v2 <covered_severities>完全省略空白 (而非空白元素)

  • v2 套件元素包含 state和 origin 屬性

  • v2 不包含 <summary>、 <text>或 <link>元素

如果您直接從磁碟讀取 XML 檔案

v1 外掛程式將其資料檔案綁定在:

/usr/lib/python*/site-packages/dnf-plugins/support_info.xml
警告

此檔案legacy = 0一旦生效就不會再更新。請勿倚賴此路徑取得目前的資料。

當 做為根目錄執行/var/cache/dnf/support-info/時,v2 外掛程式會在 快取資料。以非根使用者身分執行時,它會遵循每個使用者臨時目錄的 DNF 標準慣例/var/tmp/dnf-username-*/support-info/來使用 。這些目錄中的檔案使用以內容定址的檔案名稱,而且不穩定。請勿直接剖析它們。

建議的替代方案:

  1. 直接從設定的 URL 下載 XML:

    https://cdn.amazonlinux.com/al2023/core/AL2023-supportinfo-1.0.xml
  2. 使用 CLI 取得已安裝套件的結構化輸出:

    dnf supportinfo --show installed --showxml

如果您使用 篩選 --show

--show 篩選條件接受的值已變更:

v1 篩選條件值 v2 篩選條件值
supported full_support
unsupported eos

v1 篩選條件是階段名稱 (supported、unsupported)。v2 篩選條件是支援層級名稱 (full_support、 eos等)。

執行 --list-filters以探索系統上可用的篩選條件值:

dnf supportinfo --list-filters

什麼不會變更

安裝 dnf-plugin-support-info v2 後,無論legacy設定為何,下列項目都會保持不變:

  • --showjson 輸出。JSON 輸出是相同的legacy,無論是 0還是 1,因為外掛程式在格式化之前會標準化為 v2 內部結構。

  • CLI 引數。所有標記 (--pkg、--show、--showxml、--showjson、--clean-cache--list-filters、、--sync) 都以兩種模式運作。

  • 命令名稱。您仍然執行 dnf supportinfo。

注意

--showjson、--list-filters、 --clean-cache和 --sync旗標在 v2 中是新的,在 v1 中不可用。

轉換期間

v2 外掛程式隨附於 legacy = 1。 /etc/dnf/plugins/supportinfo.conf在此期間:

  1. 外掛程式會從設定的 URL 下載 v2 資料。

  2. 主控台輸出、XML 輸出和篩選條件值會繼續像 v1 一樣運作。

  3. v1 格式 XML 檔案在舊路徑仍然可用,因此現有指令碼會繼續運作。

在未來的 AL2023 每季版本中,預設 會變更為 legacy = 0。此時:

  • 主控台輸出使用 v2 欄位名稱和結構。

  • --showxml 會產生新的階段型格式。

  • --show 篩選條件值會變更為支援關卡名稱。

  • 舊路徑的 v1 XML 檔案不會再更新。

若要暫時保留 v1 相容的輸出,請在 legacy = 1中設定 /etc/dnf/plugins/supportinfo.conf:

[main] legacy = 1
重要

legacy = 1 選項是臨時橋接。計劃將工具遷移到 v2 輸出,而不是無限期地依賴此設定。