rpms/bltk/devel bltk-1.0.9-conf_home.patch, NONE, 1.1 bltk-1.0.9-bltk_paths.patch, 1.1, 1.2 bltk-1.0.9-cond_install.patch, 1.1, 1.2 bltk-1.0.9-installed.patch, 1.1, 1.2 bltk-1.0.9-opt_developer.patch, 1.1, 1.2 bltk-1.0.9-opt_game.patch, 1.1, 1.2 bltk-1.0.9-opt_office.patch, 1.1, 1.2 bltk-1.0.9-opt_player.patch, 1.1, 1.2 bltk-1.0.9-opt_reader.patch, 1.1, 1.2 bltk.spec, 1.5, 1.6

Jiri Skala jskala at fedoraproject.org
Fri Jul 31 08:43:59 UTC 2009


Author: jskala

Update of /cvs/extras/rpms/bltk/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30959

Modified Files:
	bltk-1.0.9-bltk_paths.patch bltk-1.0.9-cond_install.patch 
	bltk-1.0.9-installed.patch bltk-1.0.9-opt_developer.patch 
	bltk-1.0.9-opt_game.patch bltk-1.0.9-opt_office.patch 
	bltk-1.0.9-opt_player.patch bltk-1.0.9-opt_reader.patch 
	bltk.spec 
Added Files:
	bltk-1.0.9-conf_home.patch 
Log Message:
* Fri Jul 31 2009 Jiri Skala <jskala at redhat.com> 1.0.9-5
- bltk.conf can be located in ~/.bltk


bltk-1.0.9-conf_home.patch:
 parseconf.c |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

--- NEW FILE bltk-1.0.9-conf_home.patch ---
diff -up bltk-1.0.9/tools/bltk/parseconf.c.conf_home bltk-1.0.9/tools/bltk/parseconf.c
--- bltk-1.0.9/tools/bltk/parseconf.c.conf_home	2009-07-31 10:11:51.812041537 +0200
+++ bltk-1.0.9/tools/bltk/parseconf.c	2009-07-31 10:14:00.747294693 +0200
@@ -47,7 +47,8 @@
 
 #include "bltk.h"
 
-#define BLTK_CONF                   "/etc/bltk.conf"
+#define BLTK_CONF                   "bltk.conf"
+#define BLTK_HOME                   ".bltk"
 
 typedef struct para_item_str_t
 {
@@ -221,12 +222,24 @@ void
 param_load_conf()
 {
   char str[STR_LEN];
+  char conf_file[STR_LEN];
   char name[STR_LEN], val[STR_LEN];
   int index, len;
 	FILE *f;
 
-  if ((f = fopen(BLTK_CONF, "rt")) != NULL)
+
+  sprintf(conf_file, "%s/%s/%s", getenv("HOME"), BLTK_HOME, BLTK_CONF);
+  if ((f = fopen(conf_file, "rt")) == NULL)
   {
+    sprintf(conf_file, "/etc/%s", BLTK_CONF);
+    f = fopen(conf_file, "rt");
+  }
+
+  if (f != NULL)
+  {
+    sprintf(str, "BLTK_CONF=%s", conf_file);
+    putenv(strdup(str));
+
     while (fgets(str, STR_LEN, f) != NULL)
     {
       if ((len = strlen(str)) > 0 && str[len-1] == '\n')
@@ -264,7 +277,7 @@ param_load_defaults()
 
   if (bltk_home == NULL)
   {
-    sprintf(str, "%s/.bltk", getenv("HOME"));
+    sprintf(str, "%s/%s", getenv("HOME"), BLTK_HOME);
     bltk_home = strdup(str);
   } else if (bltk_home[0] == '~') {
     sprintf(str, "%s%s", getenv("HOME"), bltk_home+1);

bltk-1.0.9-bltk_paths.patch:
 Makefile                  |    2 -
 bltk_func.sh              |   77 ++++++++++++++++++++++++++++++++++++++++++++++
 bltk_plot.sh              |   48 +++++++++++++++++++---------
 bltk_report.sh            |   60 ++++++++++++++++++++++++-----------
 bltk_report_check.sh      |   50 ++++++++++++++++++++---------
 bltk_report_compress.sh   |   51 ++++++++++++++++++++----------
 bltk_report_table.sh      |   50 ++++++++++++++++++++---------
 bltk_report_uncompress.sh |   51 ++++++++++++++++++++----------
 8 files changed, 288 insertions(+), 101 deletions(-)

Index: bltk-1.0.9-bltk_paths.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-bltk_paths.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-bltk_paths.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-bltk_paths.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -43,7 +43,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -102,7 +102,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -166,7 +166,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -235,7 +235,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -302,7 +302,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -366,7 +366,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +
@@ -451,7 +451,7 @@
 +    then
 +      RETCODE=2
 +    else
-+      [ -f /etc/bltk.conf ] && . /etc/bltk.conf
++      [ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
 +      [ -z $BLTK_HOME ] && BLTK_HOME=~/.bltk
 +

bltk-1.0.9-cond_install.patch:
 wl_developer/bltk_wl_developer_install.sh |   17 ++++++++++-----
 wl_office/bltk_wl_office_install.sh       |   33 +++++++++++++++++-------------
 wl_player/bltk_wl_player_install.sh       |   22 ++++++++++++--------
 3 files changed, 45 insertions(+), 27 deletions(-)

Index: bltk-1.0.9-cond_install.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-cond_install.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-cond_install.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-cond_install.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -5,7 +5,7 @@ diff -up bltk-1.0.9/wl_developer/bltk_wl
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
@@ -37,7 +37,7 @@ diff -up bltk-1.0.9/wl_office/bltk_wl_of
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
@@ -95,7 +95,7 @@ diff -up bltk-1.0.9/wl_player/bltk_wl_pl
  
  PLAYER_INSTALL_FLAGS=" --disable-ivtv"
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }

bltk-1.0.9-installed.patch:
 bltk_check.sh     |    3 ++-
 bltk_wl_common.sh |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

Index: bltk-1.0.9-installed.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-installed.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-installed.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-installed.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -4,7 +4,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  source `dirname $0`/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }

bltk-1.0.9-opt_developer.patch:
 bltk_wl_developer.sh |   26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

Index: bltk-1.0.9-opt_developer.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-opt_developer.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-opt_developer.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-opt_developer.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -4,7 +4,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }

bltk-1.0.9-opt_game.patch:
 bltk_wl_game.sh |   29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

Index: bltk-1.0.9-opt_game.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-opt_game.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-opt_game.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-opt_game.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -27,7 +27,7 @@
  
  set -x 
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }

bltk-1.0.9-opt_office.patch:
 tools/bltk/bltk_wl_common.sh        |   24 +++++++++++--
 wl_office/bltk_wl_office.sh         |   64 ++++++++++++++++++++++++++++--------
 wl_office/bltk_wl_office_run_app.sh |    4 +-
 3 files changed, 74 insertions(+), 18 deletions(-)

Index: bltk-1.0.9-opt_office.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-opt_office.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-opt_office.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-opt_office.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -4,7 +4,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  unalias -a
  
@@ -22,7 +22,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
 +
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }
@@ -156,7 +156,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  unalias -a
  

bltk-1.0.9-opt_player.patch:
 bltk_wl_player.sh             |   49 ++++++++++++++++++++++--------------------
 bltk_wl_player_make_binary.sh |   16 ++++++++-----
 2 files changed, 36 insertions(+), 29 deletions(-)

Index: bltk-1.0.9-opt_player.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-opt_player.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-opt_player.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-opt_player.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -28,7 +28,7 @@
  
 +BLTK_PLAYER_PROG_FLG=
 +
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }

bltk-1.0.9-opt_reader.patch:
 bltk_wl_reader.sh    |   57 ++++++++++++++++++++++++++++++++++-----------------
 bltk_wl_reader_xse.c |    2 -
 2 files changed, 39 insertions(+), 20 deletions(-)

Index: bltk-1.0.9-opt_reader.patch
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk-1.0.9-opt_reader.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- bltk-1.0.9-opt_reader.patch	29 Jul 2009 13:48:31 -0000	1.1
+++ bltk-1.0.9-opt_reader.patch	31 Jul 2009 08:43:58 -0000	1.2
@@ -4,7 +4,7 @@
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  #
  
-+. /etc/bltk.conf
++[ -f "$BLTK_CONF" ] && . "$BLTK_CONF"
  
  source `dirname $0`/../../bin/bltk_wl_common
  [[ $? != 0 ]] && { echo "bltk tree corrupted"; exit 2; }


Index: bltk.spec
===================================================================
RCS file: /cvs/extras/rpms/bltk/devel/bltk.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -p -r1.5 -r1.6
--- bltk.spec	29 Jul 2009 13:48:31 -0000	1.5
+++ bltk.spec	31 Jul 2009 08:43:58 -0000	1.6
@@ -1,6 +1,6 @@
 Name:		bltk
 Version:	1.0.9
-Release:	4%{?dist}
+Release:	5%{?dist}
 Summary:	The BLTK measures notebook battery life under any workload
 
 Group:		Applications/System
@@ -28,6 +28,7 @@ Patch12: bltk-1.0.9-opt_reader.patch
 Patch13: bltk-1.0.9-installed.patch
 Patch14: bltk-1.0.9-sudo.patch
 Patch15: bltk-1.0.9-xse.patch
+Patch16: bltk-1.0.9-conf_home.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -67,6 +68,7 @@ The following workloads are currently im
 %patch13 -p1 -b .installed
 %patch14 -p1 -b .sudo
 %patch15 -p1 -b .xse
+%patch16 -p1 -b .conf_home
 
 %build
 export CFLAGS="$RPM_OPT_FLAGS"
@@ -231,6 +233,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/bltk/wl_reader/war_and_peace.html
 
 %changelog
+* Fri Jul 31 2009 Jiri Skala <jskala at redhat.com> 1.0.9-5
+- bltk.conf can be located in ~/.bltk
+
 * Tue Jul 28 2009 Jiri Skala <jskala at redhat.com> 1.0.9-4
 - added man mages
 - splitted patch to more files




More information about the fedora-extras-commits mailing list