Blame SOURCES/bltk-1.0.9-opt_reader.patch

16f2df
--- orig-1.0.9/wl_reader/bltk_wl_reader.sh	2009-04-10 09:14:20.000000000 +0200
16f2df
+++ curr-1.0.9-1/wl_reader/bltk_wl_reader.sh	2009-07-17 11:03:55.065881503 +0200
16f2df
@@ -38,6 +38,7 @@
16f2df
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16f2df
 #
16f2df
 
16f2df
+[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
16f2df
 
16f2df
 source `dirname $0`/../../bin/bltk_wl_common
16f2df
 [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
16f2df
@@ -48,6 +49,13 @@
16f2df
 
16f2df
 XSE_PROG="bltk_wl_reader_xse"
16f2df
 
16f2df
+WL_READER_WORKING_DIR=${WL_READER_WORKING_DIR:-"~/.bltk"}
16f2df
+cd $WL_READER_WORKING_DIR
16f2df
+WL_READER_WORKING_DIR=`pwd`
16f2df
+cd $OLDPWD
16f2df
+
16f2df
+export USER_DELAY_TMP=$BLTK_HOME/user_delay.tmp
16f2df
+
16f2df
 startup()
16f2df
 {
16f2df
 	trap 'cleanup 1; exit 1' 1 2 3 15
16f2df
@@ -58,35 +66,35 @@
16f2df
 ###	wl_check_install reader
16f2df
 ###	wl_check_error $?
16f2df
 
16f2df
-	if [[ -z $BLTK_WL_PROG ]]
16f2df
+	if [[ -z $BLTK_READER_PROG ]]
16f2df
 	then
16f2df
-		export BLTK_WL_PROG=$DEF_BROWSER
16f2df
-		export BLTK_WL_PROG_FLG=
16f2df
+		export BLTK_READER_PROG=$DEF_BROWSER
16f2df
+		export BLTK_READER_PROG_FLG=
16f2df
 	fi
16f2df
 
16f2df
-	wl_check_prog $BLTK_WL_PROG
16f2df
+	wl_check_prog $BLTK_READER_PROG
16f2df
 	wl_check_error $?
16f2df
 
16f2df
-	wl_check_run_prog $BLTK_WL_PROG
16f2df
+	wl_check_run_prog $BLTK_READER_PROG
16f2df
 	wl_check_error $?
16f2df
 
16f2df
-	echo "Browser	$BLTK_WL_PROG"
16f2df
+	echo "Browser	$BLTK_READER_PROG"
16f2df
 
16f2df
-	wl_check_all_run_prog $BLTK_WL_PROG
16f2df
+	wl_check_all_run_prog $BLTK_READER_PROG
16f2df
 	wl_check_error $?
16f2df
 
16f2df
 	tmp_reader_file=/tmp/$DEF_FILE
16f2df
 
16f2df
-	if [[ $BLTK_WL_FILE = DEBUG ]]
16f2df
+	if [[ $BLTK_READER_FILE = DEBUG ]]
16f2df
 	then
16f2df
-		BLTK_WL_FILE=
16f2df
+		BLTK_READER_FILE=
16f2df
 	fi
16f2df
 
16f2df
-	if [[ ! -z $BLTK_WL_FILE ]]
16f2df
+	if [[ ! -z $BLTK_READER_FILE ]]
16f2df
 	then
16f2df
-		reader_file=$BLTK_WL_FILE
16f2df
+		reader_file=$BLTK_READER_FILE
16f2df
 		title="$BLTK_WL_TITLE"
16f2df
-		flags="$BLTK_WL_PROG_FLG"
16f2df
+		flags="$BLTK_READER_PROG_FLG"
16f2df
 	else
16f2df
 		default_flg=TRUE
16f2df
 		reader_file=$DEF_FILE
16f2df
@@ -139,13 +147,13 @@
16f2df
 {
16f2df
 	ST_TIME=`$BLTK_TIME_CMD`
16f2df
 
16f2df
-	rm -f ./user_delay.tmp
16f2df
+	rm -f $USER_DELAY_TMP
16f2df
 
16f2df
-	CMD="$BLTK_WL_PROG $BLTK_WL_PROG_FLG $reader_file"
16f2df
+	CMD="$BLTK_READER_PROG $BLTK_WL_PROG_FLG $reader_file"
16f2df
 	$CMD &
16f2df
 	wl_check_error $? "$CMD failed"
16f2df
 
16f2df
-	BLTK_WL_ALL_PROC_NAME="$BLTK_WL_ALL_PROC_NAME $BLTK_WL_PROG"
16f2df
+	BLTK_WL_ALL_PROC_NAME="$BLTK_WL_ALL_PROC_NAME $BLTK_READER_PROG"
16f2df
 
16f2df
 	windowid=`bltk_winid -S "$title"`
16f2df
 	wl_check_error $? "Cannot get windowid of $BLTK_WL_PRO"
16f2df
@@ -157,11 +165,17 @@
16f2df
 
16f2df
 	CMD="$BLTK_WL_BIN/$XSE_PROG"
16f2df
 	$CMD
16f2df
+	if [ -f $BLTK_STOP_FNAME ]
16f2df
+	then
16f2df
+		ps -eopid,cmd | grep $BLTK_READER_PROG | sed 's/^ *//' | sed 's/ .*$//' | xargs kill -s SIGKILL
16f2df
+		exit 0
16f2df
+	fi
16f2df
+
16f2df
 	wl_check_error $? "$CMD failed"
16f2df
 
16f2df
 	BLTK_WL_PROC_NAME="$BLTK_WL_PROC_NAME $XSE_PROG"
16f2df
 
16f2df
-	CMD="cat ./user_delay.tmp"
16f2df
+	CMD="cat $USER_DELAY_TMP"
16f2df
 	DELAY_TIME=`$CMD`
16f2df
 	wl_check_error $? "$CMD failed"
16f2df
 
16f2df
@@ -200,7 +214,12 @@
16f2df
 	exit $1
16f2df
 }
16f2df
 
16f2df
-startup
16f2df
-run
16f2df
-cleanup 0
16f2df
+if [ "$WL_READER_ENABLED" = "YES" ]
16f2df
+then
16f2df
+	startup
16f2df
+	run
16f2df
+	cleanup 0
16f2df
+else
16f2df
+	exit 0
16f2df
+fi
16f2df
 
16f2df
--- orig-1.0.9/wl_reader/bltk_wl_reader_xse.c	2009-04-10 09:14:20.000000000 +0200
16f2df
+++ curr-1.0.9-1/wl_reader/bltk_wl_reader_xse.c	2009-07-17 11:03:55.065881503 +0200
16f2df
@@ -108,7 +108,7 @@
16f2df
 		}
16f2df
 	}
16f2df
 
16f2df
-	env = getenv("BLTK_WL_PROG");
16f2df
+	env = getenv("BLTK_READER_PROG");
16f2df
 	if (env && strcmp(env, "konqueror") == 0) {
16f2df
 		scen[LINE_QUIT].string = "Q";
16f2df
 	}