Projects
Eulaceura:Factory
kylin-scanner
_service:obs_scm:0002-modify-version-of-kylin-s...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0002-modify-version-of-kylin-scanner-is-null.patch of Package kylin-scanner
From 45371bb3feb34876ab27ab6420e0d39c870a5e13 Mon Sep 17 00:00:00 2001 From: peijiankang <peijiankang@kylinos.cn> Date: Thu, 25 May 2023 17:13:53 +0800 Subject: [PATCH] modify version of kylin-scanner is null --- src/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 48ae229..fa6b2a8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -140,7 +140,23 @@ static QString getSystemArchitecture() static QString getAppVersion() { - QString versionResult = execCmd(QString("dpkg-parsechangelog -l %1 --show-field Version").arg(ChangelogFilePath)); + QProcess process; + QString versionResult; + QStringList options; + options << "-q" << "kylin-scanner"; + process.start("rpm", options); + process.waitForFinished(); + QString dpkgInfo = process.readAll(); + QStringList infoList = dpkgInfo.split("\n"); + for (int n = 0; n < infoList.size(); n++) { + QString strInfoLine = infoList[n]; + if (strInfoLine.contains("kylin-scanner")) { + QStringList lineInfoList = strInfoLine.split(QRegExp("-")); + if (lineInfoList.size() >= 3) { + versionResult = lineInfoList[2]; + } + } + } return versionResult; } -- 2.39.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2