[rkward-cvs] SF.net SVN: rkward:[2508] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri May 29 09:56:37 UTC 2009


Revision: 2508
          http://rkward.svn.sourceforge.net/rkward/?rev=2508&view=rev
Author:   tfry
Date:     2009-05-29 09:56:37 +0000 (Fri, 29 May 2009)

Log Message:
-----------
Add check for matching version of rkward R library

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/makedist.sh
    trunk/rkward/rkward/rbackend/rinterface.cpp
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R
    trunk/rkward/rkward/rbackend/rthread.cpp
    trunk/rkward/techdocs/release_recipe

Added Paths:
-----------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/ver.R

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/ChangeLog	2009-05-29 09:56:37 UTC (rev 2508)
@@ -1,5 +1,5 @@
 - Remove support for R 2.6.x and earlier		TODO: clean up more (browser, internal.R, RCallbackArgs, RData?), adjust debian control
-- Add basic check for a correct installation of the RKWard resource files
+- Add basic checks for a correct installation of the RKWard resource files
 - Remove "What to expect" dialog at startup
 - Make keyboard shorcuts configurable
 - Add option to add only single line commands from script editor to the console history

Modified: trunk/rkward/makedist.sh
===================================================================
--- trunk/rkward/makedist.sh	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/makedist.sh	2009-05-29 09:56:37 UTC (rev 2508)
@@ -7,10 +7,10 @@
 DISTDIR=$BASEDIR/disttemp/$DISTDIRREL
 mkdir $DISTDIR
 
-#prepare version.h
+#prepare version information
 echo "/* Version number of package */" > $BASEDIR/rkward/version.h
 echo "#define VERSION \"$VERSION\"" >> $BASEDIR/rkward/version.h
-#prepare resource.ver
+echo "\".rk.app.version\" <- \"$VERSION\"" > $BASEDIR/rkward/rbackend/rpackages/rkward/R/ver.R
 echo "$VERSION" > $BASEDIR/rkward/resource.ver
 
 cp -a AUTHORS CMakeLists.txt COPYING ChangeLog TODO INSTALL NOTES README configure $DISTDIR

Modified: trunk/rkward/rkward/rbackend/rinterface.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rinterface.cpp	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/rkward/rbackend/rinterface.cpp	2009-05-29 09:56:37 UTC (rev 2508)
@@ -204,18 +204,24 @@
 		int* err_p = static_cast<int*> (ev->data ());
 		int err = *err_p;
 		delete err_p;
-		QString message = i18n ("There was a problem starting the R backend. The following error(s) occurred:\n");
+		QString message = i18n ("<p>There was a problem starting the R backend. The following error(s) occurred:</p>\n");
 		if (err & RThread::LibLoadFail) {
-			message.append (i18n ("\t- The 'rkward' R-library could not be loaded. This library is needed for communication between R and RKWard and many things will not work properly if this library is not present. Likely RKWard will even crash. The 'rkward' R-library should have been included in your distribution or RKWard, and should have been set up when you ran 'make install'. Please try 'make install' again and check for any errors. You should quit RKWard now.\n"));
+			message.append (i18n ("</p>\t- The 'rkward' R-library either could not be loaded at all, or not in the correct version. This may lead to all sorts of errors, from single missing features to complete failure to function. The most likely cause is that the last installation did not place all files in the correct place. However, in some cases, left-overs from a previous installation that was not cleanly removed may be the cause.</p>\
+			<p><b>You should quit RKWard, now, and fix your installation</b>. For help with that, see <a href=\"http://p.sf.net/rkward/compiling\">http://p.sf.net/rkward/compiling</a>.</p>\n"));
 		}
 		if (err & RThread::SinkFail) {
-			message.append (i18n ("\t-There was a problem opening the files needed for communication with R. Most likely this is due to an incorrect setting for the location of these files. Check whether you have correctly configured the location of the log-files (Settings->Configure Settings->Logfiles) and restart RKWard.\n"));
+			message.append (i18n ("<p>\t-There was a problem opening the files needed for communication with R. Most likely this is due to an incorrect setting for the location of these files. Check whether you have correctly configured the location of the log-files (Settings->Configure Settings->Logfiles) and restart RKWard.</p>\n"));
 		}
 		if (err & RThread::OtherFail) {
-			message.append (i18n ("\t-An unspecified error occurred that is not yet handled by RKWard. Likely RKWard will not function properly. Please check your setup.\n"));
+			message.append (i18n ("<p>\t-An unspecified error occurred that is not yet handled by RKWard. Likely RKWard will not function properly. Please check your setup.</p>\n"));
 		}
-		KMessageBox::error (0, message, i18n ("Error starting R"));
-		r_thread->unlock (RThread::Startup);
+		QString details = runningCommand()->fullOutput();
+		if (!details.isEmpty ()) {
+			// WORKAROUND for stupid KMessageBox behavior. (kdelibs 4.2.3)
+			// If length of details <= 512, it tries to show the details as a QLabel.
+			details = details.replace('<', "<").replace('\n', "<br>").leftJustified (513);
+		}
+		KMessageBox::detailedError (0, message, details, i18n ("Error starting R"), KMessageBox::Notify | KMessageBox::AllowLink);
 	} else {
 		RK_ASSERT (false);
 	}
@@ -380,7 +386,7 @@
 			bool ok;
 			RKComponentMap::ComponentInvocationMode mode = RKComponentMap::ManualSubmit;
 			if (request->call[2] == "auto") mode = RKComponentMap::AutoSubmit;
-			else if (request->call[2] == "submit.or.fail") mode = RKComponentMap::AutoSubmitOrFail;
+			else if (request->call[2] == "submit") mode = RKComponentMap::AutoSubmitOrFail;
 			ok = RKComponentMap::invokeComponent (request->call[1], request->call.mid (3), mode, &message);
 
 			if (message.isEmpty ()) {

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2009-05-29 09:56:37 UTC (rev 2508)
@@ -320,7 +320,7 @@
 	.Call ("rk.edit.files", file, title, name)
 }
 
-"rk.call.plugin" <- function (plugin, ..., submit.mode = c ("manual", "auto", "submit.or.fail")) {
+"rk.call.plugin" <- function (plugin, ..., submit.mode = c ("manual", "auto", "submit")) {
 	# prepare arguments
 	settings <- list (...)
 	callstrings <- list ()

Added: trunk/rkward/rkward/rbackend/rpackages/rkward/R/ver.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/ver.R	                        (rev 0)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/ver.R	2009-05-29 09:56:37 UTC (rev 2508)
@@ -0,0 +1 @@
+".rk.app.version" <- "0.5.1-pre1"

Modified: trunk/rkward/rkward/rbackend/rthread.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rthread.cpp	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/rkward/rbackend/rthread.cpp	2009-05-29 09:56:37 UTC (rev 2508)
@@ -22,6 +22,7 @@
 #include "../settings/rksettingsmodulegeneral.h"
 #include "../rkglobals.h"
 #include "../rkward.h"		// for startup options
+#include "../version.h"
 
 #include "../debug.h"
 
@@ -78,12 +79,14 @@
 	// in RInterface::RInterface() we create a fake RCommand to capture all the output/errors during startup
 	MUTEX_LOCK;
 	current_command = RCommandStack::regular_stack->currentCommand ();
+	all_current_commands.append (current_command);
 	RK_ASSERT (current_command);
 	MUTEX_UNLOCK;
 
 	if ((err = initialize ())) {
 		int* err_c = new int;
 		*err_c = err;
+		flushOutput ();		// to make errors/warnings available to the main thread
 		qApp->postEvent (RKGlobals::rInterface (), new RKRBackendEvent (RKRBackendEvent::RStartupError, err_c));
 	}
 	qApp->postEvent (RKGlobals::rInterface (), new RKRBackendEvent (RKRBackendEvent::RStarted));
@@ -510,6 +513,8 @@
 	
 	runCommandInternal ("library (\"rkward\")\n", &error);
 	if (error) status |= LibLoadFail;
+	runCommandInternal (QString ("stopifnot(.rk.app.version==\"%1\")\n").arg (VERSION), &error);
+	if (error) status |= LibLoadFail;
 
 // find out about standard library locations
 	unsigned int c;

Modified: trunk/rkward/techdocs/release_recipe
===================================================================
--- trunk/rkward/techdocs/release_recipe	2009-05-28 21:04:16 UTC (rev 2507)
+++ trunk/rkward/techdocs/release_recipe	2009-05-29 09:56:37 UTC (rev 2508)
@@ -1,11 +1,5 @@
-This procedure helps working around a number of strange problems while creating releases, such as .moc-files not being generated, generated files not being removed, autotools being run again (with bad results) for no good reason... The following procedure seems to eliminate those problems, and thus should be followed for releases. Some items may also serve to keep the package lean.
+Since RKWard 0.5.0 and the use of cmake, creating a new source .tar.gz is as easy as:
 
-make clean
-make dist
-unpack tarball and cd there
-rm -rf admin/.svn
-make -f Makefile.svn
-rm rkward/rkward_skel.cpp
-touch config.h.in
-rm -r autom4te.cache
-repackage tarball
+./makedist.sh VERSION
+
+in the toplevel source directory. Be sure to keep your sources clean, when producing official releases, tough. (If in doubt, get a clean SVN-checkout, and use that).
\ No newline at end of file


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list