Sample code using libzypp:
zypp::Target_Ptr target = zypp::getZYpp()->target();
zypp::Product::constPtr product = target->baseProduct();
logDebug() << "Product name: " << product->name()
<< " summary: " << product->summary()
<< " short name: " << product->shortName()
<< " version: " << product->edition().version()
<< endl;
Field | Content |
---|---|
Product name | Leap |
Summary | openSUSE Leap 15.6 |
Short name | openSUSE Leap |
Version | 15.6 |
$releasever | 15.6 |
/etc/products.d/baseproduct:
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
<vendor>openSUSE</vendor>
<name>Leap</name>
<version>15.6</version>
<release>1</release>
<endoflife>2025-12-31</endoflife>
<arch>x86_64</arch>
<cpeid>cpe:/o:opensuse:leap:15.6</cpeid>
<productline>Leap</productline>
<codestream>
<name>openSUSE Leap 15</name>
<endoflife>2025-12-31</endoflife>
</codestream>
<register>
<pool>
<repository url="http://download.opensuse.org/distribution/leap/15.6/repo/oss/">
<zypp name="openSUSE-Leap-15.6-Pool" alias="openSUSE-Leap-15.6-Pool"/>
</repository>
<repository url="http://download.opensuse.org/distribution/leap/15.6/repo/non-oss/">
<zypp name="openSUSE-Leap-15.6-NonOss-Pool" alias="openSUSE-Leap-15.6-NonOss-Pool"/>
</repository>
</pool>
<updates>
<distrotarget arch="x86_64">openSUSE-Leap-15.6-x86_64</distrotarget>
<distrotarget arch="aarch64">openSUSE-Leap-15.6-aarch64</distrotarget>
<distrotarget arch="ppc64le">openSUSE-Leap-15.6-ppc64le</distrotarget>
<distrotarget arch="s390x">openSUSE-Leap-15.6-s390x</distrotarget>
<repository project="openSUSE:Leap:15.6:Update" name="standard">
<zypp name="openSUSE-Leap-15.6-Updates" alias="openSUSE-Leap-15.6-Updates"/>
</repository>
<repository project="openSUSE:Leap:15.6:NonFree:Update" name="standard">
<zypp name="openSUSE-Leap-15.6-NonOss-Updates" alias="openSUSE-Leap-15.6-NonOss-Updates"/>
</repository>
<repository project="openSUSE:Backports:SLE-15-SP6:Update" name="standard">
<zypp name="openSUSE-Backports-15.6-Updates" alias="openSUSE-Backports-15.6-Updates"/>
</repository>
<repository project="SUSE:SLE-15-SP6:Update" name="pool">
<zypp name="openSUSE-SLE-15.6-Updates" alias="openSUSE-SLE-15.6-Updates"/>
</repository>
</updates>
</register>
<repositories>
<repository type="update" repoid="obsrepository://build.opensuse.org/openSUSE:Leap:15.6:Update/standard"/>
<repository type="update" repoid="obsrepository://build.opensuse.org/openSUSE:Leap:15.6:NonFree:Update/standard"/>
<repository type="update" repoid="obsrepository://build.opensuse.org/openSUSE:Backports:SLE-15-SP6:Update/standard"/>
<repository type="update" repoid="obsrepository://build.opensuse.org/SUSE:SLE-15-SP6:Update/pool"/>
</repositories>
<updaterepokey>000000000</updaterepokey>
<summary>openSUSE Leap 15.6</summary>
<shortsummary>openSUSE Leap</shortsummary>
<linguas>
...
...
</linguas>
<description>openSUSE Leap 15.6.</description>
<urls>
<url name="releasenotes">http://doc.opensuse.org/release-notes/x86_64/openSUSE/Leap/15.6/release-notes-openSUSE.rpm</url>
<url name="repository">http://download.opensuse.org/distribution/leap/15.6/repo/oss/</url>
</urls>
<buildconfig>
<producttheme>openSUSE</producttheme>
<create_flavors>true</create_flavors>
</buildconfig>
<installconfig>
<defaultlang>en_US</defaultlang>
<releasepackage name="openSUSE-release" flag="EQ" version="15.6" release="lp156.416.2"/>
<distribution>openSUSE</distribution>
</installconfig>
<runtimeconfig/>
</product>
Field | Content |
---|---|
Product name | openSUSE |
Summary | openSUSE Tumbleweed |
Short name | openSUSE |
Version | 20250125 |
$releasever | 20250125 |
/etc/products.d/baseproduct:
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
<vendor>openSUSE</vendor>
<name>openSUSE</name>
<version>20250125</version>
<release>0</release>
<arch>x86_64</arch>
<cpeid>cpe:/o:opensuse:opensuse:20250125</cpeid>
<productline>openSUSE</productline>
<register>
<target>openSUSE-Tumbleweed-x86_64</target>
<pool>
</pool>
<updates>
<distrotarget arch="x86_64">openSUSE-Tumbleweed-x86_64</distrotarget>
<distrotarget arch="s390x">openSUSE-Tumbleweed-s390x</distrotarget>
<distrotarget arch="ppc64le">openSUSE-Tumbleweed-ppc64le</distrotarget>
<distrotarget arch="aarch64">openSUSE-Tumbleweed-aarch64</distrotarget>
</updates>
</register>
<repositories>
</repositories>
<updaterepokey>000000000</updaterepokey>
<summary>openSUSE Tumbleweed</summary>
<shortsummary>openSUSE</shortsummary>
<description>openSUSE Tumbleweed is the rolling distribution by the openSUSE.org project.</description>
<linguas>
...
...
</linguas>
<urls>
<url name="releasenotes">http://doc.opensuse.org/release-notes/x86_64/openSUSE/Tumbleweed/release-notes-openSUSE.rpm</url>
<url name="repository">http://download.opensuse.org/tumbleweed/repo/oss/</url>
</urls>
<buildconfig>
<producttheme>openSUSE</producttheme>
<create_flavors>true</create_flavors>
</buildconfig>
<installconfig>
<defaultlang>en_US</defaultlang>
<default_obs_repository_name>openSUSE_Tumbleweed</default_obs_repository_name>
<default_obs_download_url>https://download.opensuse.org/repositories</default_obs_download_url>
<releasepackage name="openSUSE-release" flag="EQ" version="20250125" release="3339.1"/>
<distribution>openSUSE</distribution>
</installconfig>
<runtimeconfig/>
</product>
Field | Content |
---|---|
Product name | openSUSE |
Summary | openSUSE Tumbleweed-Slowroll |
Short name | openSUSE |
Version | 20250101 |
$releasever | 20250101 |
/etc/products.d/baseproduct:
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
<vendor>openSUSE</vendor>
<name>openSUSE</name>
<version>20250101</version>
<release>0</release>
<arch>x86_64</arch>
<cpeid>cpe:/o:opensuse:opensuse:20250101</cpeid>
<productline>openSUSE</productline>
<register>
<target>openSUSE-Slowroll-x86_64</target>
<pool>
</pool>
<updates>
<distrotarget arch="x86_64">openSUSE-Slowroll-x86_64</distrotarget>
<distrotarget arch="s390x">openSUSE-Slowroll-s390x</distrotarget>
<distrotarget arch="ppc64le">openSUSE-Slowroll-ppc64le</distrotarget>
<distrotarget arch="aarch64">openSUSE-Slowroll-aarch64</distrotarget>
</updates>
</register>
<repositories>
</repositories>
<updaterepokey>000000000</updaterepokey>
<summary>openSUSE Tumbleweed-Slowroll</summary>
<shortsummary>openSUSE</shortsummary>
<description>openSUSE Tumbleweed-Slowroll is the slowly rolling distribution by the openSUSE.org project.</description>
<linguas>
...
...
</linguas>
<urls>
<url name="releasenotes">http://doc.opensuse.org/release-notes/x86_64/openSUSE/Tumbleweed/release-notes-openSUSE.rpm</url>
<url name="repository">http://download.opensuse.org/slowroll/repo/oss/</url>
</urls>
<buildconfig>
<producttheme>openSUSE</producttheme>
<create_flavors>true</create_flavors>
</buildconfig>
<installconfig>
<defaultlang>en_US</defaultlang>
<default_obs_repository_name>openSUSE_Slowroll</default_obs_repository_name>
<default_obs_download_url>https://download.opensuse.org/repositories</default_obs_download_url>
<releasepackage name="openSUSE-release" flag="EQ" version="20250101" release="3295.15.1.sr20250101"/>
<distribution>openSUSE</distribution>
</installconfig>
<runtimeconfig/>
</product>
Untested yet, values taken from the baseproduct file
Field | Content |
---|---|
Product name | SLES |
Summary | SUSE Linux Enterprise Server 15 SP5 |
Short name | SLES15-SP5 |
Version | 15.5 |
$releasever | 15.5 |
/etc/products.d/baseproduct:
<?xml version="1.0" encoding="UTF-8"?>
<product schemeversion="0">
<vendor>SUSE</vendor>
<name>SLES</name>
<version>15.5</version>
<baseversion>15</baseversion>
<patchlevel>5</patchlevel>
<release>0</release>
<endoflife></endoflife>
<arch>x86_64</arch>
<cpeid>cpe:/o:suse:sles:15:sp5</cpeid>
<productline>sles</productline>
<codestream>
<name>SUSE Linux Enterprise Server 15</name>
<endoflife>2028-07-31</endoflife>
</codestream>
<register>
<target>sle-15-x86_64</target>
</register>
<repositories>
<repository type="update" repoid="obsrepository://build.suse.de/SUSE:Updates:SLE-Product-SLES:15-SP5:x86_64/update" />
<repository type="update" repoid="obsrepository://build.suse.de/SUSE:Updates:SLE-Product-SLES:15-SP5:x86_64/update_debug" />
<repository type="update" repoid="obsrepository://build.suse.de/SUSE:Updates:SLE-INSTALLER:15-SP5:x86_64/update" />
<repository type="pool" repoid="obsproduct://build.suse.de/SUSE:Products:SLE-Product-SLES:15-SP5:x86_64/SLES/15.5/x86_64" />
</repositories>
<summary>SUSE Linux Enterprise Server 15 SP5</summary>
<shortsummary>SLES15-SP5</shortsummary>
<description>SUSE Linux Enterprise offers...
</description>
<linguas>
...
</linguas>
<urls>
<url name="releasenotes">https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP5/release-notes-sles.rpm</url>
</urls>
<buildconfig>
<producttheme>SLES</producttheme>
</buildconfig>
<installconfig>
<defaultlang>en_US</defaultlang>
<releasepackage name="sles-release" flag="EQ" version="15.5" release="150500.43.4"/>
<distribution>SUSE_SLE</distribution>
</installconfig>
<runtimeconfig/>
<productdependency relationship="provides" name="SUSE_SLE" baseversion="15" patchlevel="5" flag="EQ"/>
<productdependency relationship="provides" name="SUSE_SLE-SP5" baseversion="15" patchlevel="5" flag="EQ"/>
</product>