[Bug 251073] sysutils/plasma5-kinfocenter: show up FreeBSD 12.1 on FreeBSD 12.2

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Nov 16 03:58:57 GMT 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251073

--- Comment #11 from marshall <marshall.ruanel at qq.com> ---
Hi, all:

I have no choice but read the kinfocenter source code more carefully, Now I
have a little knowledge of what function in KDE gives the mistake-version
string.

The related source code is "kinfocenter/Modules/about-distro/src/Module.cpp"
after line 104:

void Module::loadOSData()
{
    ......
    KOSRelease os;
    ......
    // well this line is okey with kcm-about-distrorc file
    const QString distroName = cg.readEntry("Name", os.name());
    // and this line gives the wrong version string
    const QString osrVersion = cg.readEntry("UseOSReleaseVersion", false)
            ? os.version()
            : os.versionId();
    const QString versionId = cg.readEntry("Version", osrVersion);
    ......
}

case 1:
  say there is no Version and UseOSReleaseVersion information,
osrVersion=os.version() which is 12.1 defined by KDE KOSRelease module
  and if UseOSRleaseVersion=true, then osrVersion=os.versionId(), which is
"12.1-RELEASE-p10"

case 2:
  say I set Version=12.2
  then versionId = 12.2 


Okey, So we know the class KOSRelease os gives wrong string.

So Trace it into "/coreaddons/src/lib/util/kosrelease.cpp" and find it would
read /etc/os-release file as:

static QString defaultFilePath()
{
    if (QFile::exists(QStringLiteral("/etc/os-release"))) {
        return QStringLiteral("/etc/os-release");
    } else if (QFile::exists(QStringLiteral("/usr/lib/os-release"))) {
        return QStringLiteral("/usr/lib/os-release");
    } else {
        return QString();
    }
}

The I cat "/etc/os-release", it gives:

NAME=FreeBSD
VERSION=12.2-RELEASE
VERSION_ID=12.2
ID=freebsd
ANSI_COLOR="0;31"
PRETTY_NAME="FreeBSD 12.2-RELEASE"
CPE_NAME=cpe:/o:freebsd:freebsd:12.2
HOME_URL=https://FreeBSD.org/
BUG_REPORT_URL=https://bugs.FreeBSD.org/

This is crazy. everything looks okey, but where is the "12.1-RELEASE-p10" comes
from?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the kde-freebsd mailing list