Commit e674afa6 authored by Philip Müller's avatar Philip Müller

[pkg-upd] 0.9.0-4

parent 05a2bbd7
......@@ -13,7 +13,7 @@ pkgbase=octopi
pkgname=('octopi' 'octopi-repoeditor' 'octopi-pacmanhelper' 'octopi-cachecleaner'
'octopi-notifier-qt5' 'octopi-notifier-frameworks')
pkgver=0.9.0
pkgrel=3
pkgrel=5
# This is the release package so the below _gitcommit variable should (usually) be commented out.
#_gitcommit=
arch=('i686' 'x86_64')
......@@ -26,15 +26,9 @@ if [ "${_gitcommit}" != "" ]; then
else
source=("octopi-${pkgver}.tar.gz::https://github.com/aarnt/octopi/archive/v${pkgver}.tar.gz")
fi
source+=('revert-3935abc.patch'
'revert-c413caa.patch'
'revert-a9d9eb3.patch'
'revert-e861352.patch')
source+=('https://github.com/aarnt/octopi/commit/a9d9eb3.diff')
sha256sums=('f6c7fe6bbcc26a79b1e455a42a8dc906bee4edd1b386b4f76178f006f4d7f822'
'1c2a35683273639d418450d3733ede492001eb406841a9cd6b16173a1fd7ad1d'
'9f488022cfa15219d39458d8916cb1b413ef0d977f90cc283d8e63e4284cd301'
'0531aa7afe0eccc1c8c80eb5729b5998ee0b9f453037b15c496f5503684214fe'
'c533ce04ac3cd892533c6b01724205213fe93fc2d59d8bfdd65153f921f5ffb2')
'276ac962d432e3ee07d70f54682e8f371040f719cfe6ebba0528ac8d701ea5a7')
prepare() {
......@@ -52,10 +46,7 @@ prepare() {
sed -i 's|#KSTATUS|KSTATUS|' notifier-frameworks/octopi-notifier/octopi-notifier.pro
# fix network detection
patch -Rp1 -i $srcdir/revert-e861352.patch
patch -Rp1 -i $srcdir/revert-a9d9eb3.patch
patch -Rp1 -i $srcdir/revert-c413caa.patch
patch -Rp1 -i $srcdir/revert-3935abc.patch
patch -Rp1 -i $srcdir/a9d9eb3.diff
}
build() {
......
From 3935abcd821650620828c44b424398ac363847a7 Mon Sep 17 00:00:00 2001
From: Alexandre Arnt <falso@correio.com>
Date: Wed, 6 Jun 2018 17:03:14 -0300
Subject: [PATCH] - BugFix: Another way to test network connectivity.
---
src/unixcommand.cpp | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/unixcommand.cpp b/src/unixcommand.cpp
index 191b818..788c139 100644
--- a/src/unixcommand.cpp
+++ b/src/unixcommand.cpp
@@ -30,7 +30,7 @@
#include <QFileInfo>
#include <QByteArray>
#include <QTextStream>
-#include <QtNetwork/QNetworkInterface>
+#include <QtNetwork>
/*
* Collection of methods to execute many Unix commands
@@ -608,7 +608,23 @@ bool UnixCommand::hasInternetConnection()
*/
bool UnixCommand::doInternetPingTest()
{
- QProcess ping;
+ QTcpSocket socket;
+ QString hostname = "www.google.com";
+
+ socket.connectToHost(hostname, 80);
+ if (socket.waitForConnected(5000))
+ return true;
+ else
+ {
+ hostname = "www.baidu.com";
+ socket.connectToHost(hostname, 80);
+ if (socket.waitForConnected(5000))
+ return true;
+ else
+ return false;
+ }
+
+/* QProcess ping;
int res;
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LANG", "C");
@@ -638,6 +654,7 @@ bool UnixCommand::doInternetPingTest()
ping.close();
return (res == 0); //ZERO code means ping was alive!
+*/
}
/*
From a9d9eb30d37e97369cfc64204fe0bde9e0e29918 Mon Sep 17 00:00:00 2001
From: Alexandre Arnt <falso@correio.com>
Date: Sun, 6 May 2018 18:23:46 -0300
Subject: [PATCH] - BugFix: Exec internet tests before some commands in Octopi
and Notifier.
---
CHANGELOG | 2 +-
notifier/octopi-notifier/mainwindow.cpp | 32 +++++++++++++++++++++++++++++++-
notifier/octopi-notifier/mainwindow.h | 1 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 49f1936..bb9044a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -21,7 +21,7 @@
Find line edit is always focused when the program starts.
Prevent user to install partial upgrades in his system (only some of the outdated packages).
BugFix: Do not let program display an avalanche of internet related errors.
- BugFix: Exec internet tests before some commands.
+ BugFix: Exec internet tests before some commands in Octopi and Notifier.
BugFix: Parser was not outputing repository errors when syncinc.
BugFix: repoeditor now runs as normal user and asks for root password on save.
BugFix: If Notifier hid Octopi and was closed, Octopi's window would stay hidden.
diff --git a/notifier/octopi-notifier/mainwindow.cpp b/notifier/octopi-notifier/mainwindow.cpp
index 3dadbb0..3b92b91 100644
--- a/notifier/octopi-notifier/mainwindow.cpp
+++ b/notifier/octopi-notifier/mainwindow.cpp
@@ -179,7 +179,7 @@ void MainWindow::pacmanHelperTimerTimeout()
{
static bool firstTime=true;
- if (!UnixCommand::hasInternetConnection() || m_commandExecuting != ectn_NONE) return;
+ if (/*!UnixCommand::hasInternetConnection() ||*/ m_commandExecuting != ectn_NONE) return;
if (firstTime)
{
@@ -337,6 +337,8 @@ bool MainWindow::_isSUAvailable()
*/
void MainWindow::doSystemUpgrade()
{
+ if (!isInternetAvailable()) return;
+
//If, for whatever reason, the pacman db is locked, let's ask for lock removal
if (PacmanExec::isDatabaseLocked())
{
@@ -616,11 +618,39 @@ void MainWindow::afterPacmanHelperSyncDatabase()
}
}
+/*
+ * Checks if Internet connection is up/down
+ */
+bool MainWindow::isInternetAvailable()
+{
+ bool res=true;
+
+ //First we create a fake window to act as about dialog's parent
+ //Otherwise the dialog appears at a random screen point!
+ QMainWindow *fake = new QMainWindow();
+ fake->setWindowIcon(m_icon);
+ fake->setVisible(false);
+ QScreen *sc = QGuiApplication::primaryScreen();
+ fake->setGeometry(sc->geometry());
+
+ //Test if Internet access exists
+ if (!UnixCommand::hasInternetConnection())
+ {
+ QMessageBox::critical(fake, StrConstants::getError(), StrConstants::getInternetUnavailableError());
+ res=false;
+ delete fake;
+ }
+
+ return res;
+}
+
/*
* Called every time user selects "Sync databases..." menu option
*/
void MainWindow::syncDatabase()
{
+ if (!isInternetAvailable()) return;
+
//If, for whatever reason, the pacman db is locked, let's ask for lock removal
if (PacmanExec::isDatabaseLocked())
{
diff --git a/notifier/octopi-notifier/mainwindow.h b/notifier/octopi-notifier/mainwindow.h
index 738c22f..4e28479 100644
--- a/notifier/octopi-notifier/mainwindow.h
+++ b/notifier/octopi-notifier/mainwindow.h
@@ -114,6 +114,7 @@ private slots:
PacmanHelperClient *m_pacmanHelperClient;
bool _isSUAvailable();
+ bool isInternetAvailable();
void initActions();
void initSystemTrayIcon();
void sendNotification(const QString &msg);
From c413caadd11883ffcebf13ce515fb17bc23ebd27 Mon Sep 17 00:00:00 2001
From: Alexandre Arnt <falso@correio.com>
Date: Sun, 6 May 2018 19:55:25 -0300
Subject: [PATCH] - BugFix: sysinfo tests for internet connection.
---
src/mainwindow.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 602f3b8..8fb816a 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1698,6 +1698,8 @@ void MainWindow::ptpbSysInfo()
if (!UnixCommand::hasTheExecutable("curl") ||
m_commandExecuting != ectn_NONE) return;
+ if (!isInternetAvailable()) return;
+
disableTransactionActions();
m_commandExecuting = ectn_SYSINFO;
clearTabOutput();
From e8613527b65fda27213e65e1b0f345480a085445 Mon Sep 17 00:00:00 2001
From: Alexandre Arnt <falso@correio.com>
Date: Sat, 21 Apr 2018 19:08:41 -0300
Subject: [PATCH] BugFix: Exec internet tests before some commands.
---
src/mainwindow.h | 1 +
src/mainwindow_events.cpp | 2 ++
src/mainwindow_news.cpp | 7 +++++++
src/mainwindow_transaction.cpp | 23 +++++++++++++++++++++++
src/unixcommand.cpp | 4 ++--
6 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/src/mainwindow.h b/src/mainwindow.h
index c6ae4c5..66a5223 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -303,6 +303,7 @@ public slots:
void ensureTabVisible(const int index);
bool isPropertiesTabWidgetVisible();
bool isSUAvailable();
+ bool isInternetAvailable();
void writeToTabOutput(const QString &msg, TreatURLLinks treatURLLinks = ectn_TREAT_URL_LINK);
void initTabOutput();
diff --git a/src/mainwindow_events.cpp b/src/mainwindow_events.cpp
index 54fb070..ebcb099 100644
--- a/src/mainwindow_events.cpp
+++ b/src/mainwindow_events.cpp
@@ -121,6 +121,8 @@ void MainWindow::keyPressEvent(QKeyEvent
{
if (UnixCommand::getLinuxDistro() == ectn_KAOS && ui->actionUseInstantSearch->isChecked()) return;
+ if (!isInternetAvailable()) return;
+
m_progressWidget->setMaximum(100);
m_progressWidget->setValue(0);
m_progressWidget->show();
diff --git a/src/mainwindow_news.cpp b/src/mainwindow_news.cpp
index 1deaef1..5749db4 100644
--- a/src/mainwindow_news.cpp
+++ b/src/mainwindow_news.cpp
@@ -49,6 +49,13 @@ void MainWindow::refreshDistroNews(bool searchForLatestNews, bool gotoNewsTab)
if (searchForLatestNews)
{
+ if (!isInternetAvailable())
+ {
+ ui->actionGetNews->setEnabled(true);
+ ui->twProperties->setCurrentIndex(ctn_TABINDEX_NEWS);
+ return;
+ }
+
LinuxDistro distro = UnixCommand::getLinuxDistro();
if (gotoNewsTab)
diff --git a/src/mainwindow_transaction.cpp b/src/mainwindow_transaction.cpp
index b46f663..7813d0c 100644
--- a/src/mainwindow_transaction.cpp
+++ b/src/mainwindow_transaction.cpp
@@ -671,6 +671,23 @@ void MainWindow::onPressDelete()
}
}
+/*
+ * Checks if Internet connection is up/down
+ */
+bool MainWindow::isInternetAvailable()
+{
+ bool res=true;
+
+ //Test if Internet access exists
+ if (!UnixCommand::hasInternetConnection())
+ {
+ QMessageBox::critical(this, StrConstants::getError(), StrConstants::getInternetUnavailableError());
+ res=false;
+ }
+
+ return res;
+}
+
/*
* Checks if some SU utility is available...
* Returns false if not!
@@ -727,6 +744,8 @@ void MainWindow::doSyncDatabase()
//if (!doRemovePacmanLockFile()) return;
if (!isSUAvailable()) return;
+ if (!isInternetAvailable()) return;
+
//Let's synchronize kcp database too...
if (UnixCommand::getLinuxDistro() == ectn_KAOS && UnixCommand::hasTheExecutable(ctn_KCP_TOOL) && !UnixCommand::isRootRunning())
UnixCommand::execCommandAsNormalUser("kcp -u");
@@ -843,6 +862,8 @@ void MainWindow::doSystemUpgrade(SystemUpgradeOptions systemUpgradeOptions)
if (!isSUAvailable()) return;
+ if(!isInternetAvailable()) return;
+
qApp->processEvents();
int res;
@@ -1683,6 +1704,8 @@ void MainWindow::toggleSystemActions(const bool value)
*/
void MainWindow::commitTransaction()
{
+ if (!isInternetAvailable()) return;
+
//Are there any remove actions to be commited?
if(getRemoveTransactionParentItem()->rowCount() > 0 && getInstallTransactionParentItem()->rowCount() > 0)
{
diff --git a/src/unixcommand.cpp b/src/unixcommand.cpp
index 013564a..f48483b 100644
--- a/src/unixcommand.cpp
+++ b/src/unixcommand.cpp
@@ -595,10 +595,10 @@ bool UnixCommand::hasInternetConnection()
}
//It seems to be alright, but let's make a ping to see the result
- /*if (result == true)
+ if (result == true)
{
result = UnixCommand::doInternetPingTest();
- }*/
+ }
return result;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment