73 lines
2.2 KiB
Diff
73 lines
2.2 KiB
Diff
|
From: Petr Tesarik <ptesarik@suse.com>
|
||
|
Date: Thu Nov 25 21:39:12 2021 +0100
|
||
|
Subject: Remove unused KernelPath::name() and KernelPath::m_name
|
||
|
Upstream: merged
|
||
|
Git-commit: fd3168af4ba9fd139a55ade3e50b1ad0e08da746
|
||
|
|
||
|
This API does not have any users. Let it RIP.
|
||
|
|
||
|
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
|
||
|
|
||
|
diff --git a/kdumptool/kernelpath.cc b/kdumptool/kernelpath.cc
|
||
|
index 5a87aae..fd6565f 100644
|
||
|
--- a/kdumptool/kernelpath.cc
|
||
|
+++ b/kdumptool/kernelpath.cc
|
||
|
@@ -55,25 +55,19 @@ KernelPath::KernelPath(FilePath const &path)
|
||
|
|
||
|
FilePath canonical = path.getCanonicalPath();
|
||
|
m_directory = canonical.dirName();
|
||
|
- m_name = canonical.baseName();
|
||
|
+ KString name = canonical.baseName();
|
||
|
|
||
|
for (auto const pfx : imageNames(Util::getArch())) {
|
||
|
- if (m_name.startsWith(pfx)) {
|
||
|
- if (m_name.length() == pfx.length()) {
|
||
|
- m_name = pfx;
|
||
|
- break;
|
||
|
- }
|
||
|
- if (m_name[pfx.length()] == '-') {
|
||
|
- m_version.assign(m_name, pfx.length() + 1);
|
||
|
- m_name = pfx;
|
||
|
- break;
|
||
|
+ if (name.startsWith(pfx)) {
|
||
|
+ if (name[pfx.length()] == '-') {
|
||
|
+ m_version.assign(name, pfx.length() + 1);
|
||
|
}
|
||
|
+ break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
- Debug::debug()->trace("directory=%s, name=%s, version=%s",
|
||
|
- m_directory.c_str(), m_name.c_str(),
|
||
|
- m_version.c_str());
|
||
|
+ Debug::debug()->trace("directory=%s, version=%s",
|
||
|
+ m_directory.c_str(), m_version.c_str());
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------------------------------------------
|
||
|
diff --git a/kdumptool/kernelpath.h b/kdumptool/kernelpath.h
|
||
|
index 84cba88..332190b 100644
|
||
|
--- a/kdumptool/kernelpath.h
|
||
|
+++ b/kdumptool/kernelpath.h
|
||
|
@@ -39,7 +39,6 @@
|
||
|
class KernelPath {
|
||
|
private:
|
||
|
FilePath m_directory;
|
||
|
- KString m_name;
|
||
|
KString m_version;
|
||
|
|
||
|
public:
|
||
|
@@ -60,12 +59,6 @@ class KernelPath {
|
||
|
const FilePath& directory()
|
||
|
{ return m_directory; }
|
||
|
|
||
|
- /**
|
||
|
- * @return kernel image name
|
||
|
- */
|
||
|
- const KString& name()
|
||
|
- { return m_name; }
|
||
|
-
|
||
|
/**
|
||
|
* @return kernel version (may be empty)
|
||
|
*/
|