Hi,
I'm building CDE on openSUSE 13.2 and I have found some issue with ksh.
As repoterd here: 
http://sourceforge.net/p/cdesktopenv/discussion/general/thread/7a63a375/
there are some "test: : arithmetic syntax error" messages and the build hangs.
The build succeed on openSUSE 13.1 which uses ksh 93u 2012-08-01, but 
openSUSE 13.2 has ksh 93v 2014-06-25 and apparently the script in the cde source
  programs/dtksh/ksh93/ship/shipin
is not compatible with the newer ksh version.

Problem 1
on line 586 of shipin this line of code is executed:
  if      test "$new" -gt "$old"
when this happens the variable "old" is empty. The old version of ksh treats
such variable has having value 0, the new version gives arithmetic syntax error.
A fix that works with both version is to change the line like this:
  if      test "$new" -gt "${old:-0}"
The same identical problem happens at line 615. The same code exists at line 
572, but such line is not executed during my build.

Problem 2
on line 1314 of shipin this line of code is executed:
  s=\`wc pic.o\`
when the shell (93v 2014-06-25) executes "wc pic.o" it hangs.
This is a problem with the builtin wc command. If I use /usr/bin/wc then
everything is ok. The script hangs also at line 1328 running the same command.
A fix that makes the script work with both versions of ksh is to add the line:
  builtin -d wc
at the beginning of the script. Of course an OS provided version of wc must be
available, but I think that's always true.

Attached you can find a patch that fixes these problems with the ksh build.

By the way in the "Contributing to CDE" wiki page there are this couple of 
lines:
DtKsh:
    Investigate build against newer ksh93. This is problematic due to license 
reasons (EPL is incompatible to (L)GPL).
Are they refering to the problems I reported? If so, once the patch is committed
the page can be updated.

Giacomo
diff -Nraub cde-2.2.3/programs/dtksh/ksh93/ship/shipin cde-2.2.3.patch/programs/dtksh/ksh93/ship/shipin
--- cde-2.2.3/programs/dtksh/ksh93/ship/shipin	2015-05-09 19:09:11.000000000 -0400
+++ cde-2.2.3.patch/programs/dtksh/ksh93/ship/shipin	2015-11-13 13:28:05.193405665 -0400
@@ -64,6 +64,9 @@
 	;;
 esac
 
+# disable the builtin wc because ksh may hang during the execution later of "wc pic.o"
+builtin -d wc
+
 #
 # this script may be overwritten while it is being executed
 # so copy it and exec from the copy
@@ -569,7 +572,8 @@
 		eval _ship${_cmd_}_=
 		continue
 	fi
-	if	test "$new" -gt "$old"
+	# the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0
+	if	test "$new" -gt "${old:-0}"
 	then	case $_suf_ in
 		?*)	cp ship$_cmd_$_suf_ SHIP$_cmd_$_suf_ ;;
 		esac
@@ -583,7 +587,8 @@
 		case $_suf_ in
 		.c)	test -f $f && ./$f </dev/null >/dev/null 2>&1 || old=0 ;;
 		esac
-		if	test "$new" -gt "$old"
+		# the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0
+		if	test "$new" -gt "${old:-0}"
 		then	case $old in
 			""|0)	;;
 			*)	cp ship$_cmd_ SHIP$_cmd_ ;;
@@ -612,7 +617,8 @@
 	esac
 	case $_flg_ in
 	*B*)	f=$BIN/$_cmd_; eval old=$_stamp_
-		if	test "$new" -gt "$old"
+		# the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0
+		if	test "$new" -gt "${old:-0}"
 		then	if	test ! -d $BIN
 			then	mkdir $BIN
 			fi
------------------------------------------------------------------------------
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to