[education/rkward] rkward: More diagnostics for failure to copy package

Thomas Friedrichsmeier null at kde.org
Sat Jun 25 08:29:21 BST 2022


Git commit ea0f9409fb448d0130e72fe1f25e2404f56b9d2f by Thomas Friedrichsmeier.
Committed on 25/06/2022 at 07:29.
Pushed by tfry into branch 'master'.

More diagnostics for failure to copy package

M  +5    -3    rkward/rkward.cpp

https://invent.kde.org/education/rkward/commit/ea0f9409fb448d0130e72fe1f25e2404f56b9d2f

diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 0908bbe0..9f502736 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -378,11 +378,13 @@ void RKWardMainWindow::startR () {
 		QString package = QDir (packages_path).absoluteFilePath (packages[i]);
 		if (RKSettingsModuleGeneral::rkwardVersionChanged ()) {
 			RK_DEBUG(APP, DL_INFO, "RKWard version changed. Discarding cached package at %s", qPrintable (package));
-			QFile::remove (package);
+			RK_ASSERT(QFile::remove(package));
 		}
 		if (!QFileInfo::exists(package)) {
-			RK_DEBUG(APP, DL_INFO, "Copying rkward R source package to %s", qPrintable (package));
-			RK_ASSERT(QFile::copy (RKCommonFunctions::getRKWardDataDir () + "/rpackages/" + packages[i], package));
+			QString source = RKCommonFunctions::getRKWardDataDir() + "/rpackages/" + packages[i];
+			RK_ASSERT(QFileInfo::exists(source));
+			RK_DEBUG(APP, DL_INFO, "Copying rkward R source package %s to %s", qPrintable(source), qPrintable(package));
+			RK_ASSERT(QFile::copy(source, package));
 		}
 	}
 


More information about the rkward-tracker mailing list