Merge commits from 8.5 into 9.0-beta branch.
Resolves: rhbz#1957575
This commit is contained in:
parent
cca1c17b35
commit
d209baa18a
31
pcp.spec
31
pcp.spec
@ -1,6 +1,6 @@
|
|||||||
Name: pcp
|
Name: pcp
|
||||||
Version: 5.3.0
|
Version: 5.3.0
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: System-level performance monitoring and performance management
|
Summary: System-level performance monitoring and performance management
|
||||||
License: GPLv2+ and LGPLv2+ and CC-BY
|
License: GPLv2+ and LGPLv2+ and CC-BY
|
||||||
URL: https://pcp.io
|
URL: https://pcp.io
|
||||||
@ -9,6 +9,10 @@ URL: https://pcp.io
|
|||||||
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
|
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
|
||||||
|
|
||||||
Patch000: redhat-bugzilla-1940971.patch
|
Patch000: redhat-bugzilla-1940971.patch
|
||||||
|
Patch001: redhat-bugzilla-1615742.patch
|
||||||
|
Patch002: redhat-bugzilla-1615718.patch
|
||||||
|
Patch003: redhat-bugzilla-1956608.patch
|
||||||
|
Patch004: redhat-bugzilla-1950263.patch
|
||||||
|
|
||||||
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
|
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
|
||||||
%global __python2 python2
|
%global __python2 python2
|
||||||
@ -44,12 +48,7 @@ Patch000: redhat-bugzilla-1940971.patch
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# libvarlink and pmdapodman
|
|
||||||
%if 0%{?fedora} >= 28 || 0%{?rhel} > 7
|
|
||||||
%global disable_podman 0
|
%global disable_podman 0
|
||||||
%else
|
|
||||||
%global disable_podman 1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
# libchan, libhdr_histogram and pmdastatsd
|
# libchan, libhdr_histogram and pmdastatsd
|
||||||
%if 0%{?fedora} >= 29 || 0%{?rhel} > 7
|
%if 0%{?fedora} >= 29 || 0%{?rhel} > 7
|
||||||
@ -243,9 +242,6 @@ BuildRequires: python3-setuptools
|
|||||||
BuildRequires: ncurses-devel
|
BuildRequires: ncurses-devel
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
BuildRequires: cyrus-sasl-devel
|
BuildRequires: cyrus-sasl-devel
|
||||||
%if !%{disable_podman}
|
|
||||||
BuildRequires: libvarlink-devel
|
|
||||||
%endif
|
|
||||||
%if !%{disable_statsd}
|
%if !%{disable_statsd}
|
||||||
# ragel unavailable on RHEL8
|
# ragel unavailable on RHEL8
|
||||||
%if 0%{?rhel} == 0
|
%if 0%{?rhel} == 0
|
||||||
@ -894,12 +890,10 @@ License: GPLv2+
|
|||||||
Summary: Performance Co-Pilot (PCP) metrics for podman containers
|
Summary: Performance Co-Pilot (PCP) metrics for podman containers
|
||||||
URL: https://pcp.io
|
URL: https://pcp.io
|
||||||
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
||||||
Requires: libvarlink
|
|
||||||
BuildRequires: libvarlink-devel
|
|
||||||
|
|
||||||
%description pmda-podman
|
%description pmda-podman
|
||||||
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
|
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
|
||||||
collecting podman container and pod statistics through libvarlink.
|
collecting podman container and pod statistics via the podman REST API.
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !%{disable_statsd}
|
%if !%{disable_statsd}
|
||||||
@ -1786,7 +1780,7 @@ URL: https://pcp.io
|
|||||||
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
|
||||||
%if !%{disable_python3}
|
%if !%{disable_python3}
|
||||||
Requires: python3-pcp
|
Requires: python3-pcp
|
||||||
%if 0%{?rhel} == 0
|
%if 0%{?rhel} == 0 || 0%{?rhel} > 7
|
||||||
Requires: python3-pyodbc
|
Requires: python3-pyodbc
|
||||||
%endif
|
%endif
|
||||||
%else
|
%else
|
||||||
@ -2251,6 +2245,10 @@ updated policy package.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
%patch000 -p1
|
%patch000 -p1
|
||||||
|
%patch001 -p1
|
||||||
|
%patch002 -p1
|
||||||
|
%patch003 -p1
|
||||||
|
%patch004 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# fix up build version
|
# fix up build version
|
||||||
@ -3312,6 +3310,13 @@ PCP_LOG_DIR=%{_logsdir}
|
|||||||
%files zeroconf -f pcp-zeroconf-files.rpm
|
%files zeroconf -f pcp-zeroconf-files.rpm
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 18 2021 Nathan Scott <nathans@redhat.com> - 5.3.0-2
|
||||||
|
- Improve pmchart duplicate archive diagnostics (BZ 1615718)
|
||||||
|
- Save pmchart users prefered archive locations (BZ 1615742)
|
||||||
|
- Remove libvarlink dependency from podman PMDA (BZ 1956608)
|
||||||
|
- Correct pcp-testsuite file permissions (BZ 1922040)
|
||||||
|
- Resolve pcp-testsuite linkage problems (BZ 1950263)
|
||||||
|
|
||||||
* Thu May 06 2021 Nathan Scott <nathans@redhat.com> - 5.3.0-1
|
* Thu May 06 2021 Nathan Scott <nathans@redhat.com> - 5.3.0-1
|
||||||
- Added conditional lockdown policy access by pmdakvm (BZ 1940971)
|
- Added conditional lockdown policy access by pmdakvm (BZ 1940971)
|
||||||
- Added spec file dependency on cyrus-sasl-scram (BZ 1942879)
|
- Added spec file dependency on cyrus-sasl-scram (BZ 1942879)
|
||||||
|
127
redhat-bugzilla-1615718.patch
Normal file
127
redhat-bugzilla-1615718.patch
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
commit 0b62b6e2fef99a143b993bed273ce83e5a5563c3
|
||||||
|
Author: Nathan Scott <nathans@redhat.com>
|
||||||
|
Date: Fri May 14 11:46:29 2021 +1000
|
||||||
|
|
||||||
|
pmchart: use libpcp_qmc diagnostic for archives from same host
|
||||||
|
|
||||||
|
Instead of providing a cryptic higher-level error message when
|
||||||
|
the user attempts to open archives from the same host, use the
|
||||||
|
message libpcp_qmc has constructed previously - all we need to
|
||||||
|
do is to pmflush(3) it.
|
||||||
|
|
||||||
|
Resolves Red Hat BZ #1615718
|
||||||
|
|
||||||
|
diff --git a/src/pmchart/chartdialog.cpp b/src/pmchart/chartdialog.cpp
|
||||||
|
index 78ca0041b..5c3da5641 100644
|
||||||
|
--- a/src/pmchart/chartdialog.cpp
|
||||||
|
+++ b/src/pmchart/chartdialog.cpp
|
||||||
|
@@ -388,12 +388,7 @@ void ChartDialog::archiveButtonClicked()
|
||||||
|
for (QStringList::Iterator it = al.begin(); it != al.end(); ++it) {
|
||||||
|
QString archive = *it;
|
||||||
|
if ((sts = archiveGroup->use(PM_CONTEXT_ARCHIVE, archive)) < 0) {
|
||||||
|
- archive.prepend(tr("Cannot open PCP archive: "));
|
||||||
|
- archive.append(tr("\n"));
|
||||||
|
- archive.append(tr(pmErrStr(sts)));
|
||||||
|
- QMessageBox::warning(this, pmGetProgname(), archive,
|
||||||
|
- QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
- Qt::NoButton, Qt::NoButton);
|
||||||
|
+ pmflush();
|
||||||
|
} else {
|
||||||
|
setupAvailableMetricsTree(true);
|
||||||
|
archiveGroup->updateBounds();
|
||||||
|
@@ -419,12 +414,7 @@ void ChartDialog::hostButtonClicked()
|
||||||
|
QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
Qt::NoButton, Qt::NoButton);
|
||||||
|
} else if ((sts = liveGroup->use(PM_CONTEXT_HOST, hostspec, flags)) < 0) {
|
||||||
|
- hostspec.prepend(tr("Cannot connect to host: "));
|
||||||
|
- hostspec.append(tr("\n"));
|
||||||
|
- hostspec.append(tr(pmErrStr(sts)));
|
||||||
|
- QMessageBox::warning(this, pmGetProgname(), hostspec,
|
||||||
|
- QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
- Qt::NoButton, Qt::NoButton);
|
||||||
|
+ pmflush();
|
||||||
|
} else {
|
||||||
|
console->post(PmChart::DebugUi,
|
||||||
|
"ChartDialog::newHost: %s (flags=0x%x)",
|
||||||
|
diff --git a/src/pmchart/openviewdialog.cpp b/src/pmchart/openviewdialog.cpp
|
||||||
|
index ed5a9f943..0f48b2f88 100644
|
||||||
|
--- a/src/pmchart/openviewdialog.cpp
|
||||||
|
+++ b/src/pmchart/openviewdialog.cpp
|
||||||
|
@@ -219,7 +219,6 @@ void OpenViewDialog::archiveAdd()
|
||||||
|
{
|
||||||
|
QFileDialog *af = new QFileDialog(this);
|
||||||
|
QStringList al;
|
||||||
|
- int sts;
|
||||||
|
|
||||||
|
af->setFileMode(QFileDialog::ExistingFiles);
|
||||||
|
af->setAcceptMode(QFileDialog::AcceptOpen);
|
||||||
|
@@ -238,13 +237,8 @@ void OpenViewDialog::archiveAdd()
|
||||||
|
|
||||||
|
for (QStringList::Iterator it = al.begin(); it != al.end(); ++it) {
|
||||||
|
QString archive = *it;
|
||||||
|
- if ((sts = archiveGroup->use(PM_CONTEXT_ARCHIVE, archive)) < 0) {
|
||||||
|
- archive.prepend(tr("Cannot open PCP archive: "));
|
||||||
|
- archive.append(tr("\n"));
|
||||||
|
- archive.append(tr(pmErrStr(sts)));
|
||||||
|
- QMessageBox::warning(this, pmGetProgname(), archive,
|
||||||
|
- QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
- QMessageBox::NoButton, QMessageBox::NoButton);
|
||||||
|
+ if (archiveGroup->use(PM_CONTEXT_ARCHIVE, archive) < 0) {
|
||||||
|
+ pmflush();
|
||||||
|
} else {
|
||||||
|
setupComboBoxes(true);
|
||||||
|
archiveGroup->updateBounds();
|
||||||
|
@@ -262,20 +256,15 @@ void OpenViewDialog::hostAdd()
|
||||||
|
|
||||||
|
if (host->exec() == QDialog::Accepted) {
|
||||||
|
QString hostspec = host->getHostSpecification();
|
||||||
|
- int sts, flags = host->getContextFlags();
|
||||||
|
+ int flags = host->getContextFlags();
|
||||||
|
|
||||||
|
if (hostspec.isNull() || hostspec.length() == 0) {
|
||||||
|
hostspec.append(tr("Hostname not specified\n"));
|
||||||
|
QMessageBox::warning(this, pmGetProgname(), hostspec,
|
||||||
|
QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
Qt::NoButton, Qt::NoButton);
|
||||||
|
- } else if ((sts = liveGroup->use(PM_CONTEXT_HOST, hostspec, flags)) < 0) {
|
||||||
|
- hostspec.prepend(tr("Cannot connect to host: "));
|
||||||
|
- hostspec.append(tr("\n"));
|
||||||
|
- hostspec.append(tr(pmErrStr(sts)));
|
||||||
|
- QMessageBox::warning(this, pmGetProgname(), hostspec,
|
||||||
|
- QMessageBox::Ok|QMessageBox::Default|QMessageBox::Escape,
|
||||||
|
- Qt::NoButton, Qt::NoButton);
|
||||||
|
+ } else if (liveGroup->use(PM_CONTEXT_HOST, hostspec, flags) < 0) {
|
||||||
|
+ pmflush();
|
||||||
|
} else {
|
||||||
|
console->post(PmChart::DebugUi,
|
||||||
|
"OpenViewDialog::newHost: %s (flags=0x%x)",
|
||||||
|
@@ -320,11 +309,7 @@ bool OpenViewDialog::useLiveContext(int index)
|
||||||
|
int sts;
|
||||||
|
|
||||||
|
if ((sts = liveGroup->use(PM_CONTEXT_HOST, source.source())) < 0) {
|
||||||
|
- QString msg = QString("Failed to connect to pmcd on \"%1\".\n%2.\n\n")
|
||||||
|
- .arg(sourceName).arg(pmErrStr(sts));
|
||||||
|
- QMessageBox::warning(NULL, pmGetProgname(), msg,
|
||||||
|
- QMessageBox::Ok | QMessageBox::Default | QMessageBox::Escape,
|
||||||
|
- QMessageBox::NoButton, QMessageBox::NoButton);
|
||||||
|
+ pmflush();
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
free(sourceName);
|
||||||
|
@@ -345,14 +330,9 @@ bool OpenViewDialog::useArchiveContext(int index)
|
||||||
|
QmcSource source = archiveGroup->context(index)->source();
|
||||||
|
char *sourceName = source.sourceAscii();
|
||||||
|
bool result = true;
|
||||||
|
- int sts;
|
||||||
|
|
||||||
|
- if ((sts = archiveGroup->use(PM_CONTEXT_ARCHIVE, source.source())) < 0) {
|
||||||
|
- QString msg = QString("Failed to open archive \"%1\".\n%2.\n\n")
|
||||||
|
- .arg(sourceName).arg(pmErrStr(sts));
|
||||||
|
- QMessageBox::warning(NULL, pmGetProgname(), msg,
|
||||||
|
- QMessageBox::Ok | QMessageBox::Default | QMessageBox::Escape,
|
||||||
|
- QMessageBox::NoButton, QMessageBox::NoButton);
|
||||||
|
+ if (archiveGroup->use(PM_CONTEXT_ARCHIVE, source.source()) < 0) {
|
||||||
|
+ pmflush();
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
free(sourceName);
|
494
redhat-bugzilla-1615742.patch
Normal file
494
redhat-bugzilla-1615742.patch
Normal file
@ -0,0 +1,494 @@
|
|||||||
|
commit f15e34b06bd25dce5fafa68eeee04f2b5a27e9a0
|
||||||
|
Author: Nathan Scott <nathans@redhat.com>
|
||||||
|
Date: Fri May 14 11:10:56 2021 +1000
|
||||||
|
|
||||||
|
pmchart: save changes to users prefered archive location
|
||||||
|
|
||||||
|
Use the users QSettings configuration file to hold any new
|
||||||
|
preference given for archive locations, and restore this at
|
||||||
|
pmchart startup time.
|
||||||
|
|
||||||
|
Similarly save and restore locations for exported images.
|
||||||
|
|
||||||
|
While in here, some janitorial work has been done in terms
|
||||||
|
of dropping paths to configuration files not used in many,
|
||||||
|
many years now.
|
||||||
|
|
||||||
|
Resolves Red Hat BZ #1615742
|
||||||
|
|
||||||
|
diff --git a/src/pmchart/chartdialog.cpp b/src/pmchart/chartdialog.cpp
|
||||||
|
index 3873abe9c..78ca0041b 100644
|
||||||
|
--- a/src/pmchart/chartdialog.cpp
|
||||||
|
+++ b/src/pmchart/chartdialog.cpp
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/*
|
||||||
|
- * Copyright (c) 2013-2015, Red Hat.
|
||||||
|
+ * Copyright (c) 2013-2015,2021 Red Hat.
|
||||||
|
* Copyright (c) 2007-2008, Aconex. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
@@ -374,10 +374,17 @@ void ChartDialog::archiveButtonClicked()
|
||||||
|
af->setAcceptMode(QFileDialog::AcceptOpen);
|
||||||
|
af->setIconProvider(fileIconProvider);
|
||||||
|
af->setWindowTitle(tr("Add Archive"));
|
||||||
|
- af->setDirectory(QDir::toNativeSeparators(QDir::homePath()));
|
||||||
|
+ af->setDirectory(globalSettings.lastArchivePath);
|
||||||
|
|
||||||
|
- if (af->exec() == QDialog::Accepted)
|
||||||
|
+ if (af->exec() == QDialog::Accepted) {
|
||||||
|
al = af->selectedFiles();
|
||||||
|
+ QString path = QFileInfo(al.at(0)).dir().absolutePath();
|
||||||
|
+ if (globalSettings.lastArchivePath != path) {
|
||||||
|
+ globalSettings.lastArchivePath = path;
|
||||||
|
+ globalSettings.lastArchivePathModified = true;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (QStringList::Iterator it = al.begin(); it != al.end(); ++it) {
|
||||||
|
QString archive = *it;
|
||||||
|
if ((sts = archiveGroup->use(PM_CONTEXT_ARCHIVE, archive)) < 0) {
|
||||||
|
diff --git a/src/pmchart/exportdialog.cpp b/src/pmchart/exportdialog.cpp
|
||||||
|
index fe926ebfa..db38d16db 100644
|
||||||
|
--- a/src/pmchart/exportdialog.cpp
|
||||||
|
+++ b/src/pmchart/exportdialog.cpp
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2007, Aconex. All Rights Reserved.
|
||||||
|
- * Copyright (c) 2013, Red Hat, Inc.
|
||||||
|
+ * Copyright (c) 2013,2021 Red Hat, Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@@ -48,7 +48,7 @@ void ExportDialog::languageChange()
|
||||||
|
void ExportDialog::init()
|
||||||
|
{
|
||||||
|
QChar sep(pmPathSeparator());
|
||||||
|
- QString imgfile = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
+ QString imgfile = globalSettings.lastExportPath;
|
||||||
|
|
||||||
|
my.quality = 0;
|
||||||
|
my.format = strdup("png");
|
||||||
|
@@ -122,10 +122,17 @@ void ExportDialog::displayQualitySlider()
|
||||||
|
void ExportDialog::filePushButton_clicked()
|
||||||
|
{
|
||||||
|
ExportFileDialog file(this);
|
||||||
|
-
|
||||||
|
- file.setDirectory(QDir::toNativeSeparators(QDir::homePath()));
|
||||||
|
- if (file.exec() == QDialog::Accepted)
|
||||||
|
- fileLineEdit->setText(file.selectedFiles().at(0));
|
||||||
|
+ file.setDirectory(globalSettings.lastExportPath);
|
||||||
|
+
|
||||||
|
+ if (file.exec() == QDialog::Accepted) {
|
||||||
|
+ QString selection = file.selectedFiles().at(0);
|
||||||
|
+ QString path = QFileInfo(selection).dir().absolutePath();
|
||||||
|
+ if (globalSettings.lastExportPath != path) {
|
||||||
|
+ globalSettings.lastExportPath = path;
|
||||||
|
+ globalSettings.lastExportPathModified = true;
|
||||||
|
+ }
|
||||||
|
+ fileLineEdit->setText(selection);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExportDialog::formatComboBox_currentIndexChanged(QString suffix)
|
||||||
|
diff --git a/src/pmchart/main.cpp b/src/pmchart/main.cpp
|
||||||
|
index 08de404d3..ef07fa012 100644
|
||||||
|
--- a/src/pmchart/main.cpp
|
||||||
|
+++ b/src/pmchart/main.cpp
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/*
|
||||||
|
- * Copyright (c) 2014,2016, Red Hat.
|
||||||
|
+ * Copyright (c) 2014,2016,2021 Red Hat.
|
||||||
|
* Copyright (c) 2006, Ken McDonell. All Rights Reserved.
|
||||||
|
* Copyright (c) 2007-2009, Aconex. All Rights Reserved.
|
||||||
|
*
|
||||||
|
@@ -234,6 +234,14 @@ void writeSettings(void)
|
||||||
|
else
|
||||||
|
userSettings.remove("savedHosts");
|
||||||
|
}
|
||||||
|
+ if (globalSettings.lastArchivePathModified) {
|
||||||
|
+ globalSettings.lastArchivePathModified = false;
|
||||||
|
+ userSettings.setValue("lastArchivePath", globalSettings.lastArchivePath);
|
||||||
|
+ }
|
||||||
|
+ if (globalSettings.lastExportPathModified) {
|
||||||
|
+ globalSettings.lastExportPathModified = false;
|
||||||
|
+ userSettings.setValue("lastExportPath", globalSettings.lastExportPath);
|
||||||
|
+ }
|
||||||
|
|
||||||
|
userSettings.endGroup();
|
||||||
|
}
|
||||||
|
@@ -373,6 +381,21 @@ static void readSettings(void)
|
||||||
|
globalSettings.savedHosts =
|
||||||
|
userSettings.value("savedHosts").toStringList();
|
||||||
|
|
||||||
|
+ //
|
||||||
|
+ // Saved filesystem search paths
|
||||||
|
+ //
|
||||||
|
+ globalSettings.lastArchivePathModified = false;
|
||||||
|
+ QChar sep(pmPathSeparator());
|
||||||
|
+ QString pmlogger = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
+ pmlogger.append(sep).append(".pcp").append(sep).append("pmlogger");
|
||||||
|
+ globalSettings.lastArchivePath =
|
||||||
|
+ userSettings.value("lastArchivePath", pmlogger).toString();
|
||||||
|
+ globalSettings.lastExportPathModified = false;
|
||||||
|
+ QString pictures = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
+ pictures.append(sep).append("Pictures");
|
||||||
|
+ globalSettings.lastExportPath =
|
||||||
|
+ userSettings.value("lastExportPath", pictures).toString();
|
||||||
|
+
|
||||||
|
userSettings.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -475,6 +498,7 @@ main(int argc, char ** argv)
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
setupEnvironment();
|
||||||
|
readSettings();
|
||||||
|
+ atexit(writeSettings);
|
||||||
|
|
||||||
|
opts.flags = PM_OPTFLAG_MULTI | PM_OPTFLAG_MIXED;
|
||||||
|
opts.short_options = "A:a:Cc:D:f:F:g:h:H:Ln:o:O:p:s:S:T:t:Vv:WzZ:?";
|
||||||
|
diff --git a/src/pmchart/main.h b/src/pmchart/main.h
|
||||||
|
index ec79ec9a4..4be939186 100644
|
||||||
|
--- a/src/pmchart/main.h
|
||||||
|
+++ b/src/pmchart/main.h
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/*
|
||||||
|
- * Copyright (c) 2014, Red Hat.
|
||||||
|
+ * Copyright (c) 2014,2021 Red Hat.
|
||||||
|
* Copyright (c) 2007, Aconex. All Rights Reserved.
|
||||||
|
* Copyright (c) 2006, Ken McDonell. All Rights Reserved.
|
||||||
|
*
|
||||||
|
@@ -71,6 +71,12 @@ typedef struct {
|
||||||
|
// Saved Hosts
|
||||||
|
QStringList savedHosts;
|
||||||
|
bool savedHostsModified;
|
||||||
|
+
|
||||||
|
+ // Filesysten Paths
|
||||||
|
+ QString lastArchivePath;
|
||||||
|
+ bool lastArchivePathModified;
|
||||||
|
+ QString lastExportPath;
|
||||||
|
+ bool lastExportPathModified;
|
||||||
|
} Settings;
|
||||||
|
|
||||||
|
extern Settings globalSettings;
|
||||||
|
diff --git a/src/pmchart/openviewdialog.cpp b/src/pmchart/openviewdialog.cpp
|
||||||
|
index d2eefa028..ed5a9f943 100644
|
||||||
|
--- a/src/pmchart/openviewdialog.cpp
|
||||||
|
+++ b/src/pmchart/openviewdialog.cpp
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
/*
|
||||||
|
- * Copyright (c) 2013, Red Hat.
|
||||||
|
- * Copyright (c) 2007-2009, Aconex. All Rights Reserved.
|
||||||
|
+ * Copyright (c) 2013,2021 Red Hat.
|
||||||
|
+ * Copyright (c) 2007-2009 Aconex. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@@ -36,36 +36,16 @@ OpenViewDialog::OpenViewDialog(QWidget *parent) : QDialog(parent)
|
||||||
|
|
||||||
|
QDir dir;
|
||||||
|
QChar sep(pmPathSeparator());
|
||||||
|
- QString sys = my.systemDir = pmGetConfig("PCP_VAR_DIR");
|
||||||
|
- my.systemDir.append(sep);
|
||||||
|
- my.systemDir.append("config");
|
||||||
|
- my.systemDir.append(sep);
|
||||||
|
- my.systemDir.append("kmchart");
|
||||||
|
- if (dir.exists(my.systemDir))
|
||||||
|
- pathComboBox->addItem(fileIconProvider->icon(QFileIconProvider::Folder),
|
||||||
|
- my.systemDir);
|
||||||
|
- my.systemDir = sys;
|
||||||
|
- my.systemDir.append(sep);
|
||||||
|
- my.systemDir.append("config");
|
||||||
|
- my.systemDir.append(sep);
|
||||||
|
- my.systemDir.append("pmchart");
|
||||||
|
+ my.systemDir = pmGetConfig("PCP_VAR_DIR");
|
||||||
|
+ my.systemDir.append(sep).append("config");
|
||||||
|
+ my.systemDir.append(sep).append("pmchart");
|
||||||
|
if (dir.exists(my.systemDir))
|
||||||
|
pathComboBox->addItem(fileIconProvider->icon(QFileIconProvider::Folder),
|
||||||
|
my.systemDir);
|
||||||
|
|
||||||
|
- QString home = my.userDir = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append(".pcp");
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append("kmchart");
|
||||||
|
- if (dir.exists(my.userDir))
|
||||||
|
- pathComboBox->addItem(fileIconProvider->icon(QFileIconProvider::Folder),
|
||||||
|
- my.userDir);
|
||||||
|
- my.userDir = home;
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append(".pcp");
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append("pmchart");
|
||||||
|
+ QString home = my.userDir = QDir::homePath();
|
||||||
|
+ my.userDir.append(sep).append(".pcp");
|
||||||
|
+ my.userDir.append(sep).append("pmchart");
|
||||||
|
if (dir.exists(my.userDir))
|
||||||
|
pathComboBox->addItem(fileIconProvider->icon(QFileIconProvider::Folder),
|
||||||
|
my.userDir);
|
||||||
|
@@ -245,10 +225,17 @@ void OpenViewDialog::archiveAdd()
|
||||||
|
af->setAcceptMode(QFileDialog::AcceptOpen);
|
||||||
|
af->setWindowTitle(tr("Add Archive"));
|
||||||
|
af->setIconProvider(fileIconProvider);
|
||||||
|
- af->setDirectory(QDir::toNativeSeparators(QDir::homePath()));
|
||||||
|
+ af->setDirectory(globalSettings.lastArchivePath);
|
||||||
|
|
||||||
|
- if (af->exec() == QDialog::Accepted)
|
||||||
|
+ if (af->exec() == QDialog::Accepted) {
|
||||||
|
al = af->selectedFiles();
|
||||||
|
+ QString path = QFileInfo(al.at(0)).dir().absolutePath();
|
||||||
|
+ if (globalSettings.lastArchivePath != path) {
|
||||||
|
+ globalSettings.lastArchivePath = path;
|
||||||
|
+ globalSettings.lastArchivePathModified = true;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (QStringList::Iterator it = al.begin(); it != al.end(); ++it) {
|
||||||
|
QString archive = *it;
|
||||||
|
if ((sts = archiveGroup->use(PM_CONTEXT_ARCHIVE, archive)) < 0) {
|
||||||
|
diff --git a/src/pmchart/recorddialog.cpp b/src/pmchart/recorddialog.cpp
|
||||||
|
index 35242078a..69a8a89c8 100644
|
||||||
|
--- a/src/pmchart/recorddialog.cpp
|
||||||
|
+++ b/src/pmchart/recorddialog.cpp
|
||||||
|
@@ -33,26 +33,7 @@ void RecordDialog::languageChange()
|
||||||
|
|
||||||
|
void RecordDialog::init(Tab *tab)
|
||||||
|
{
|
||||||
|
- QChar sep(pmPathSeparator());
|
||||||
|
- QString pmlogger = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- QString view, folio, archive;
|
||||||
|
-
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append(".pcp");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append("pmlogger");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- view = folio = archive = pmlogger;
|
||||||
|
-
|
||||||
|
- view.append("[date].view");
|
||||||
|
- viewLineEdit->setText(view);
|
||||||
|
- folio.append("[date].folio");
|
||||||
|
- folioLineEdit->setText(folio);
|
||||||
|
- archive.append("[host]");
|
||||||
|
- archive.append(sep);
|
||||||
|
- archive.append("[date]");
|
||||||
|
- archiveLineEdit->setText(archive);
|
||||||
|
-
|
||||||
|
+ initText();
|
||||||
|
my.tab = tab;
|
||||||
|
my.units = QmcTime::Seconds;
|
||||||
|
deltaLineEdit->setText(
|
||||||
|
@@ -62,6 +43,23 @@ void RecordDialog::init(Tab *tab)
|
||||||
|
allGadgetsRadioButton->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void RecordDialog::initText()
|
||||||
|
+{
|
||||||
|
+ QChar sep(pmPathSeparator());
|
||||||
|
+
|
||||||
|
+ my.viewText = globalSettings.lastArchivePath;
|
||||||
|
+ my.viewText.append(sep).append("[date].view");
|
||||||
|
+ viewLineEdit->setText(my.viewText);
|
||||||
|
+
|
||||||
|
+ my.folioText = globalSettings.lastArchivePath;
|
||||||
|
+ my.folioText.append(sep).append("[date].folio");
|
||||||
|
+ folioLineEdit->setText(my.folioText);
|
||||||
|
+
|
||||||
|
+ my.archiveText = globalSettings.lastArchivePath;
|
||||||
|
+ my.archiveText.append(sep).append("[host]").append(sep).append("[date]");
|
||||||
|
+ archiveLineEdit->setText(my.archiveText);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void RecordDialog::selectedRadioButton_clicked()
|
||||||
|
{
|
||||||
|
selectedRadioButton->setChecked(true);
|
||||||
|
@@ -83,53 +81,41 @@ void RecordDialog::deltaUnitsComboBox_activated(int value)
|
||||||
|
|
||||||
|
void RecordDialog::viewPushButton_clicked()
|
||||||
|
{
|
||||||
|
- RecordFileDialog view(this);
|
||||||
|
+ initText();
|
||||||
|
|
||||||
|
- QChar sep(pmPathSeparator());
|
||||||
|
- QString pmlogger = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append(".pcp");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append("pmlogger");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
+ RecordFileDialog view(this);
|
||||||
|
+ view.setDirectory(my.viewText);
|
||||||
|
|
||||||
|
- view.setDirectory(pmlogger);
|
||||||
|
- if (view.exec() == QDialog::Accepted)
|
||||||
|
- viewLineEdit->setText(view.selectedFiles().at(0));
|
||||||
|
+ if (view.exec() == QDialog::Accepted) {
|
||||||
|
+ QString selection = view.selectedFiles().at(0);
|
||||||
|
+ viewLineEdit->setText(selection);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecordDialog::folioPushButton_clicked()
|
||||||
|
{
|
||||||
|
- RecordFileDialog folio(this);
|
||||||
|
+ initText();
|
||||||
|
|
||||||
|
- QChar sep(pmPathSeparator());
|
||||||
|
- QString pmlogger = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append(".pcp");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append("pmlogger");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
+ RecordFileDialog folio(this);
|
||||||
|
+ folio.setDirectory(my.folioText);
|
||||||
|
|
||||||
|
- folio.setDirectory(pmlogger);
|
||||||
|
- if (folio.exec() == QDialog::Accepted)
|
||||||
|
- folioLineEdit->setText(folio.selectedFiles().at(0));
|
||||||
|
+ if (folio.exec() == QDialog::Accepted) {
|
||||||
|
+ QString selection = folio.selectedFiles().at(0);
|
||||||
|
+ folioLineEdit->setText(selection);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
void RecordDialog::archivePushButton_clicked()
|
||||||
|
{
|
||||||
|
- RecordFileDialog archive(this);
|
||||||
|
+ initText();
|
||||||
|
|
||||||
|
- QChar sep(pmPathSeparator());
|
||||||
|
- QString pmlogger = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append(".pcp");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
- pmlogger.append("pmlogger");
|
||||||
|
- pmlogger.append(sep);
|
||||||
|
+ RecordFileDialog archive(this);
|
||||||
|
+ archive.setDirectory(my.archiveText);
|
||||||
|
|
||||||
|
- archive.setDirectory(pmlogger);
|
||||||
|
- if (archive.exec() == QDialog::Accepted)
|
||||||
|
- archiveLineEdit->setText(archive.selectedFiles().at(0));
|
||||||
|
+ if (archive.exec() == QDialog::Accepted) {
|
||||||
|
+ QString selection = archive.selectedFiles().at(0);
|
||||||
|
+ archiveLineEdit->setText(selection);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
// substitute "local:" or "localhost" with actual hostname
|
||||||
|
diff --git a/src/pmchart/recorddialog.h b/src/pmchart/recorddialog.h
|
||||||
|
index 784530353..67011b934 100644
|
||||||
|
--- a/src/pmchart/recorddialog.h
|
||||||
|
+++ b/src/pmchart/recorddialog.h
|
||||||
|
@@ -47,11 +47,17 @@ protected slots:
|
||||||
|
virtual void languageChange();
|
||||||
|
|
||||||
|
private:
|
||||||
|
+ void initText(void);
|
||||||
|
+
|
||||||
|
struct {
|
||||||
|
Tab *tab;
|
||||||
|
QString delta;
|
||||||
|
QmcTime::DeltaUnits units;
|
||||||
|
|
||||||
|
+ QString viewText;
|
||||||
|
+ QString folioText;
|
||||||
|
+ QString archiveText;
|
||||||
|
+
|
||||||
|
QString view;
|
||||||
|
QString folio;
|
||||||
|
QStringList hosts;
|
||||||
|
diff --git a/src/pmchart/saveviewdialog.cpp b/src/pmchart/saveviewdialog.cpp
|
||||||
|
index b0363a19f..1a8b094f4 100644
|
||||||
|
--- a/src/pmchart/saveviewdialog.cpp
|
||||||
|
+++ b/src/pmchart/saveviewdialog.cpp
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
/*
|
||||||
|
- * Copyright (c) 2014 Red Hat.
|
||||||
|
+ * Copyright (c) 2014,2021 Red Hat.
|
||||||
|
* Copyright (c) 2007-2009, Aconex. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
@@ -33,22 +33,14 @@ SaveViewDialog::SaveViewDialog(QWidget* parent) : QDialog(parent)
|
||||||
|
SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
|
||||||
|
this, SLOT(dirListView_selectionChanged()));
|
||||||
|
|
||||||
|
+ my.hostDynamic = true;
|
||||||
|
+ my.sizeDynamic = true;
|
||||||
|
+
|
||||||
|
QDir dir;
|
||||||
|
QChar sep(pmPathSeparator());
|
||||||
|
QString home = my.userDir = QDir::toNativeSeparators(QDir::homePath());
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append(".pcp");
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append("kmchart");
|
||||||
|
- if (!dir.exists(my.userDir)) {
|
||||||
|
- my.userDir = home;
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append(".pcp");
|
||||||
|
- my.userDir.append(sep);
|
||||||
|
- my.userDir.append("pmchart");
|
||||||
|
- }
|
||||||
|
- my.hostDynamic = true;
|
||||||
|
- my.sizeDynamic = true;
|
||||||
|
+ my.userDir.append(sep).append(".pcp");
|
||||||
|
+ my.userDir.append(sep).append("pmchart");
|
||||||
|
|
||||||
|
pathComboBox->addItem(fileIconProvider->icon(QFileIconProvider::Folder),
|
||||||
|
my.userDir);
|
||||||
|
diff --git a/src/pmchart/view.cpp b/src/pmchart/view.cpp
|
||||||
|
index 16633243f..4fc79fd09 100644
|
||||||
|
--- a/src/pmchart/view.cpp
|
||||||
|
+++ b/src/pmchart/view.cpp
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006, Ken McDonell. All Rights Reserved.
|
||||||
|
- * Copyright (c) 2013, Red Hat Inc.
|
||||||
|
+ * Copyright (c) 2013,2021 Red Hat.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License as published by the
|
||||||
|
@@ -281,37 +281,17 @@ bool OpenViewDialog::openView(const char *path)
|
||||||
|
|
||||||
|
strcpy(_fname, path);
|
||||||
|
if ((f = fopen(_fname, "r")) == NULL) {
|
||||||
|
- // not found, start the great hunt
|
||||||
|
- // try user's pmchart dir ...
|
||||||
|
+ // not found, try users pmchart dir
|
||||||
|
pmsprintf(_fname, sizeof(_fname),
|
||||||
|
"%s%c" ".pcp%c" "pmchart%c" "%s",
|
||||||
|
(const char *)homepath.toLatin1(), sep, sep, sep, path);
|
||||||
|
if ((f = fopen(_fname, "r")) == NULL) {
|
||||||
|
- // try system pmchart dir
|
||||||
|
+ // not found, try system pmchart dir
|
||||||
|
pmsprintf(_fname, sizeof(_fname),
|
||||||
|
"%s%c" "config%c" "pmchart%c" "%s",
|
||||||
|
pmGetConfig("PCP_VAR_DIR"), sep, sep, sep, path);
|
||||||
|
- if ((f = fopen(_fname, "r")) == NULL) {
|
||||||
|
- // try user's kmchart dir
|
||||||
|
- pmsprintf(_fname, sizeof(_fname),
|
||||||
|
- "%s%c" ".pcp%c" "kmchart%c" "%s",
|
||||||
|
- (const char *)homepath.toLatin1(),
|
||||||
|
- sep, sep, sep, path);
|
||||||
|
- if ((f = fopen(_fname, "r")) == NULL) {
|
||||||
|
- // try system kmchart dir
|
||||||
|
- pmsprintf(_fname, sizeof(_fname),
|
||||||
|
- "%s%c" "config%c" "kmchart%c" "%s",
|
||||||
|
- pmGetConfig("PCP_VAR_DIR"),
|
||||||
|
- sep, sep, sep, path);
|
||||||
|
- if ((f = fopen(_fname, "r")) == NULL) {
|
||||||
|
- pmsprintf(_fname, sizeof(_fname),
|
||||||
|
- "%s%c" "config%c" "pmchart%c" "%s",
|
||||||
|
- pmGetConfig("PCP_VAR_DIR"),
|
||||||
|
- sep, sep, sep, path);
|
||||||
|
- goto noview;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ if ((f = fopen(_fname, "r")) == NULL)
|
||||||
|
+ goto noview;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// check for executable and __pmProcessPipe() as needed
|
33
redhat-bugzilla-1950263.patch
Normal file
33
redhat-bugzilla-1950263.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
commit 6528e1b09ad948a8bf82e03ad2f10c1a296078af
|
||||||
|
Author: Nathan Scott <nathans@redhat.com>
|
||||||
|
Date: Tue Apr 20 11:02:26 2021 +1000
|
||||||
|
|
||||||
|
qa: specify PCP libraries only on libpcp_web link lines
|
||||||
|
|
||||||
|
Tweaks the changes from commit c9bd0cc4e9b so that testsuite
|
||||||
|
sources linking with libpcp_web don't pull in 3rd party libs
|
||||||
|
(which may not be installed) like uv, ssl, crypto.
|
||||||
|
|
||||||
|
Resolves Red Hat BZ #1950263
|
||||||
|
|
||||||
|
diff --git a/qa/src/GNUlocaldefs b/qa/src/GNUlocaldefs
|
||||||
|
index 3b5873c25..13fc09831 100644
|
||||||
|
--- a/qa/src/GNUlocaldefs
|
||||||
|
+++ b/qa/src/GNUlocaldefs
|
||||||
|
@@ -538,13 +538,13 @@ check_pmiend_fdleak: check_pmiend_fdleak.c
|
||||||
|
|
||||||
|
httpfetch: httpfetch.c
|
||||||
|
rm -f $@
|
||||||
|
- $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) $(PCP_WEBLIB)
|
||||||
|
+ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_pmda -lpcp_web -lpcp_mmv
|
||||||
|
json_test: json_test.c
|
||||||
|
rm -f $@
|
||||||
|
- $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) $(PCP_WEBLIB)
|
||||||
|
+ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_pmda -lpcp_web -lpcp_mmv
|
||||||
|
sha1int2ext: sha1int2ext.o
|
||||||
|
rm -f $@
|
||||||
|
- $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) $(PCP_WEBLIB)
|
||||||
|
+ $(CCF) $(CDEFS) -o $@ $@.c $(LDLIBS) -lpcp_pmda -lpcp_web -lpcp_mmv
|
||||||
|
|
||||||
|
# --- need libpcp_fault
|
||||||
|
#
|
2590
redhat-bugzilla-1956608.patch
Normal file
2590
redhat-bugzilla-1956608.patch
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user