diff --git a/0001-modify-version-of-kylin-scanner-is-null.patch b/0001-modify-version-of-kylin-scanner-is-null.patch new file mode 100644 index 0000000..bd2b939 --- /dev/null +++ b/0001-modify-version-of-kylin-scanner-is-null.patch @@ -0,0 +1,41 @@ +From 5e46fb35016c8ae73fbd31cc64a9f1354b304541 Mon Sep 17 00:00:00 2001 +From: peijiankang +Date: Mon, 30 May 2022 14:51:29 +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..6de4eca 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)); ++ QString versionResult; ++ QProcess process; ++ 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.33.0 + diff --git a/kylin-scanner.spec b/kylin-scanner.spec index 8a67be4..063ff56 100644 --- a/kylin-scanner.spec +++ b/kylin-scanner.spec @@ -1,11 +1,12 @@ %define debug_package %{nil} Name: kylin-scanner Version: 1.0.3 -Release: 2 +Release: 3 Summary: Kylin Scanner is an interface-friendly scanning software developed with Qt5. License: BSL-1.0 and Libpng and zlib and GPL-2.0-or-later URL: https://github.com/UbuntuKylin/kylin-scanner Source0: %{name}-%{version}.tar.gz +Patch01: 0001-modify-version-of-kylin-scanner-is-null.patch BuildRequires: qt5-qtsvg-devel BuildRequires: glib2-devel @@ -39,6 +40,7 @@ and text recognition, etc. %prep %setup -q +%patch01 -p1 %build %{qmake_qt5} @@ -55,6 +57,9 @@ and text recognition, etc. %{_datadir}/pixmaps/scanner.png %changelog +* Mon May 30 2022 peijiankang - 1.0.3-3 +- modify version of kylin-scanner is null + * Thu May 26 2022 peijiankang - 1.0.3-2 - remove {%if 0 and %endif}