[SCM] BOINC packaging branch, master, updated. debian/6.10.17+dfsg-3-211-ge598e81

Steffen Moeller moeller at debian.org
Sat Apr 9 13:14:28 UTC 2011


The following commit has been merged in the master branch:
commit d686def09bca9aae9fa4e20b0f6299a9b7cf66f0
Author: Steffen Moeller <moeller at debian.org>
Date:   Tue Mar 29 17:48:19 2011 +0200

    Reverting all changes up upstream's files in master.

diff --git a/Makefile.am b/Makefile.am
index 058c70e..5a5b9b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,10 +21,10 @@ if ENABLE_CLIENT
 endif
 
 if ENABLE_MANAGER
-CLIENTGUI_SUBDIRS = clientgui clientgui/res locale
-##if BUILD_X11_SCREENSAVER
-##	CLIENTGUI_SUBDIRS += clientscr
-##endif 
+	CLIENTGUI_SUBDIRS = clientgui clientgui/res locale
+	if BUILD_X11_SCREENSAVER
+		CLIENTGUI_SUBDIRS += clientscr
+	endif 
 endif
 
 # ORDER MATTERS below.  One must build dependencies FIRST, then things
diff --git a/api/Makefile.am b/api/Makefile.am
index 5956b65..d2cf273 100644
--- a/api/Makefile.am
+++ b/api/Makefile.am
@@ -16,12 +16,12 @@ graphics2_files = \
     gutil.cpp \
     gutil_text.cpp \
     reduce_lib.cpp \
+    texfont.cpp \
     texture.cpp \
+    txf_util.cpp \
     graphics2.cpp \
     graphics2_unix.cpp
 
-# removed:  texfont.cpp txf_util.cpp
-
 if OS_DARWIN
     graphics2_files += mac_icon.cpp
     graphics2_files += macglutfix.m
diff --git a/api/graphics2_unix.cpp b/api/graphics2_unix.cpp
index 15b35ad..54ef255 100644
--- a/api/graphics2_unix.cpp
+++ b/api/graphics2_unix.cpp
@@ -45,6 +45,8 @@ static int win=0;
 static int checkparentcounter=0;
 
 #ifdef __APPLE__
+#include <sys/param.h>  // for MAXPATHLEN
+
 static bool need_show = false;
 #endif
 
@@ -222,7 +224,8 @@ void boinc_graphics_loop(int argc, char** argv, const char* title) {
     }
 
 #ifdef __APPLE__
-    char *dir=get_current_dir_name();
+    char dir [MAXPATHLEN];
+    getcwd(dir, MAXPATHLEN);
 #endif
     for (int i=1; i<argc; i++) {
         if (!strcmp(argv[i], "--fullscreen")) {
@@ -234,10 +237,7 @@ void boinc_graphics_loop(int argc, char** argv, const char* title) {
     glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0);      
 #ifdef __APPLE__
     // Apparently glut changed our working directory in OS 10.3.9
-    if (chdir(dir)) {
-	# some error message should be here;
-    }
-    free(dir);
+    chdir(dir);
 #endif
     glutMainLoop();
 }
diff --git a/api/mac_icon.cpp b/api/mac_icon.cpp
index 4a9604d..80bc0c9 100644
--- a/api/mac_icon.cpp
+++ b/api/mac_icon.cpp
@@ -30,6 +30,7 @@
 */
 
 #include <Carbon/Carbon.h>
+#include <sys/param.h>  // for MAXPATHLEN
 #include <sys/stat.h>
 
 #include "boinc_api.h"
@@ -140,13 +141,12 @@ static char * PersistentFGets(char *buf, size_t buflen, FILE *f) {
 
 void getPathToThisApp(char* pathBuf, size_t bufSize) {
     FILE *f;
-    char *buf; // A fixed buffer of MAXPATHLEN is too much and not required to fix this way
-    char *c;
+    char buf[MAXPATHLEN], *c;
     pid_t myPID = getpid();
     int i;
     struct stat stat_buf;
     
-    strncpy(pathBuf, GRAPHICS_APP_FILENAME, bufSize);
+    strcpy(pathBuf, GRAPHICS_APP_FILENAME);
     if (!stat(pathBuf, &stat_buf)) {
        // stat() returns zero on success
        return;
@@ -159,12 +159,8 @@ void getPathToThisApp(char* pathBuf, size_t bufSize) {
     // (or the soft-link to it.)  So all we need for the path to this 
     // application is the file name.  We use the -c option so ps strips off 
     // any command-line arguments for us.
-    buf=(char*)malloc(sizeof(char)*(20+100));
-    if (!buf)
-        return;
-    snprintf(buf, 20+100-1, "ps -wcp %d -o command=", myPID);
+    sprintf(buf, "ps -wcp %d -o command=", myPID);
     f = popen(buf,  "r");
-    free(buf); buf=(char*)NULL;
     if (!f)
         return;
     PersistentFGets(pathBuf, bufSize, f);  // Skip over line of column headings
diff --git a/api/txf_util.cpp b/api/txf_util.cpp
index fc57b95..7121152 100644
--- a/api/txf_util.cpp
+++ b/api/txf_util.cpp
@@ -26,15 +26,14 @@
 #include "filesys.h"
 #include "boinc_api.h"
 
-//#include "texfont.h"
+#include "texfont.h"
 #include "txf_util.h"
 
 #ifndef _MAX_PATH
 #define _MAX_PATH 256
 #endif 
 
-//static TexFont* txf[TXF_NUM_FONT];
-static void* txf[TXF_NUM_FONT];
+static TexFont* txf[TXF_NUM_FONT];
 
 // load fonts. call once.
 //
diff --git a/api/txf_util.h b/api/txf_util.h
index be006a6..93a1599 100644
--- a/api/txf_util.h
+++ b/api/txf_util.h
@@ -21,8 +21,6 @@
 #ifndef _TXF_UTIL_
 #define _TXF_UTIL_
 
-#include <GL/gl.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/client/check_security.cpp b/client/check_security.cpp
index 40876b8..1686a4c 100644
--- a/client/check_security.cpp
+++ b/client/check_security.cpp
@@ -23,12 +23,7 @@
 #include <unistd.h>
 #include <pwd.h>	// getpwnam
 #include <grp.h>
-
-#include <sys/param.h>  // for MAXPATHLEN, not available e.g. for HURD
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 40000
-#endif
-
+#include <sys/param.h>  // for MAXPATHLEN
 #include <dirent.h>
 #include <cerrno>
 
diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp
index 3433328..cd90f7b 100644
--- a/client/hostinfo_unix.cpp
+++ b/client/hostinfo_unix.cpp
@@ -1098,8 +1098,8 @@ int GetMaxCPUTemperature() {
 // see if Virtualbox is installed
 //
 int HOST_INFO::get_virtualbox_version() {
-    char path[500]; // less than MAXPATHLEN and more than required below
-    char cmd [500+35];
+    char path[MAXPATHLEN];
+    char cmd [MAXPATHLEN+35];
     char *newlinePtr;
     FILE* fd;
 
diff --git a/client/switcher.cpp b/client/switcher.cpp
index cd0a263..237feda 100644
--- a/client/switcher.cpp
+++ b/client/switcher.cpp
@@ -27,6 +27,9 @@
 #include <cstdio>
 #include <cstring>
 #include <cerrno>
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>  // for MAXPATHLEN
+#endif
 #include <pwd.h>	// getpwuid
 #include <grp.h>
 
@@ -49,9 +52,10 @@ int main(int argc, char** argv) {
     strcpy(group_name, "boinc_project");
 
 #if 0           // For debugging only
-    char *current_dir=get_current_dir_name();
+    char	current_dir[MAXPATHLEN];
+
+    getcwd( current_dir, sizeof(current_dir));
     fprintf(stderr, "current directory = %s\n", current_dir);
-    free(current_dir); current_dir=NULL;
     
     for (int i=0; i<argc; i++) {
         fprintf(stderr, "switcher arg %d: %s\n", i, argv[i]);
diff --git a/clientgui/common/wxFlatNotebookImages.h b/clientgui/common/wxFlatNotebookImages.h
index 9796141..ffd3b6c 100644
--- a/clientgui/common/wxFlatNotebookImages.h
+++ b/clientgui/common/wxFlatNotebookImages.h
@@ -25,7 +25,7 @@ namespace FNB
 	// Images used by the control
 	////////////////////////////////////////////////////////////
 	/* XPM */
-	static const char *left_arrow_disabled_xpm[] = {
+	static char *left_arrow_disabled_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -57,7 +57,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *x_button_pressed_xpm[] = {
+	static char *x_button_pressed_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -90,7 +90,7 @@ namespace FNB
 
 
 	/* XPM */
-	static const char *left_arrow_xpm[] = {
+	static char *left_arrow_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -122,7 +122,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *x_button_hilite_xpm[] = {
+	static char *x_button_hilite_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -154,7 +154,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *x_button_xpm[] = {
+	static char *x_button_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -186,7 +186,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *left_arrow_pressed_xpm[] = {
+	static char *left_arrow_pressed_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -218,7 +218,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *left_arrow_hilite_xpm[] = {
+	static char *left_arrow_hilite_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -250,7 +250,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *right_arrow_disabled_xpm[] = {
+	static char *right_arrow_disabled_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -282,7 +282,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *right_arrow_hilite_xpm[] = {
+	static char *right_arrow_hilite_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -314,7 +314,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *right_arrow_pressed_xpm[] = {
+	static char *right_arrow_pressed_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -347,7 +347,7 @@ namespace FNB
 
 
 	/* XPM */
-	static const char *right_arrow_xpm[] = {
+	static char *right_arrow_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"    16    16        8            1",
 			/* colors */
@@ -381,7 +381,7 @@ namespace FNB
 	const int tab_x_size = 9;
 
 	/* XPM */
-	static const char *tab_x_button_pressed_xpm[] = {
+	static char *tab_x_button_pressed_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"     9     9        8            1",
 			/* colors */
@@ -406,7 +406,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *tab_x_button_xpm[] = {
+	static char *tab_x_button_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"     9     9        8            1",
 			/* colors */
@@ -431,7 +431,7 @@ namespace FNB
 	};
 
 	/* XPM */
-	static const char *tab_x_button_hilite_xpm[] = {
+	static char *tab_x_button_hilite_xpm[] = {
 		/* width height num_colors chars_per_pixel */
 		"     9     9        8            1",
 			/* colors */
diff --git a/clientscr/gfx_switcher.cpp b/clientscr/gfx_switcher.cpp
index 939f574..68f4474 100644
--- a/clientscr/gfx_switcher.cpp
+++ b/clientscr/gfx_switcher.cpp
@@ -27,12 +27,8 @@
 #include <cstring>
 #include <cerrno>
 #ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>  // for MAXPATHLEN, not available e.g. for HURD
+#include <sys/param.h>  // for MAXPATHLEN
 #endif
-#ifndef MAXPATHLEN
-#define MAXPATHLEN 40000
-#endif
-
 #include <pwd.h>	// getpwuid
 #include <grp.h>
 
@@ -88,9 +84,10 @@ int main(int argc, char** argv) {
 
     // NOTE: call print_to_log_file only after switching user and group
 #if 0           // For debugging only
-    char	*current_dir = get_current_dir_name();
+    char	current_dir[MAXPATHLEN];
+
+    getcwd( current_dir, sizeof(current_dir));
     print_to_log_file( "current directory = %s", current_dir);
-    free(current_dir); current_dir=(char *) NULL;
     
     for (int i=0; i<argc; i++) {
          print_to_log_file("switcher arg %d: %s", i, argv[i]);
diff --git a/clientscr/mac_saver_module.cpp b/clientscr/mac_saver_module.cpp
index abc962e..b59ad77 100644
--- a/clientscr/mac_saver_module.cpp
+++ b/clientscr/mac_saver_module.cpp
@@ -30,6 +30,7 @@
 #include <unistd.h>
 #include <limits.h>
 #include <sys/stat.h>
+#include <sys/param.h>  // for MAXPATHLEN
 
 #include "gui_rpc_client.h"
 #include "common_defs.h"
diff --git a/generate_svn_version.sh b/generate_svn_version.sh
index 41add3c..b90f9bc 100644
--- a/generate_svn_version.sh
+++ b/generate_svn_version.sh
@@ -7,9 +7,7 @@ echo "#ifndef SVN_VERSION_H" > $TMPFILE
 echo "#define SVN_VERSION_H" >> $TMPFILE
 echo "" >> $TMPFILE
 
-if [ -d debian ]; then
-    CMD=""
-elif [ -d .git ]; then
+if [ -d .git ]; then
     CMD="git svn info"
 elif [ -d .svn ]; then
     CMD="svn info"
diff --git a/samples/sleeper/Makefile b/samples/sleeper/Makefile
index d5cf8f7..13492ec 100644
--- a/samples/sleeper/Makefile
+++ b/samples/sleeper/Makefile
@@ -1,43 +1,29 @@
 # This should work on Linux.  Modify as needed for other platforms.
 
-# Change the following to match your installation
-BOINC_DIR = /usr/include/boinc
+BOINC_DIR = ../..
 BOINC_API_DIR = $(BOINC_DIR)/api
 BOINC_LIB_DIR = $(BOINC_DIR)/lib
 
 CXXFLAGS = -g \
-    -I../.. \
-    -I../../api \
-    -I../../lib \
-    -L../../lib \
     -I$(BOINC_DIR) \
     -I$(BOINC_LIB_DIR) \
     -I$(BOINC_API_DIR) \
     -L$(BOINC_API_DIR) \
     -L$(BOINC_LIB_DIR) \
+    -L.
 
-PROGS= sleeper
-EXTRA_SOURCES=
+PROGS = sleeper
 
 all: $(PROGS)
 
-LIBS=libstdc++.a libboinc_api.a libboinc.a
-
-$(LIBS):
-	if [ -r "../../lib/$@" ]; then \
-		ln -sf "../../lib/$@" . ; \
-	elif [ -r "../../api/$@" ]; then \
-		ln -sf "../../api/$@" . ; \
-	else \
-		ln -sf `g++ -print-file-name=$@` ; \
-	fi
+libstdc++.a:
+	ln -s `g++ -print-file-name=libstdc++.a`
 
 clean:
-	rm -f $(PROGS) *.o *.a
+	rm $(PROGS)
 
 distclean:
-	/bin/rm -f $(PROGS) *.o $(LIBS)
-
-$(PROGS):  $(LIBS)
-	g++ $(CXXFLAGS) -Wl,--as-needed -o $@ $(@).cpp $(EXTRA_SOURCES) -L . $(LIBS) -pthread
+	/bin/rm -f $(PROGS) *.o libstdc++.a
 
+sleeper: sleeper.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a
+	g++ $(CXXFLAGS) -o sleeper sleeper.o libstdc++.a -pthread -lboinc_api -lboinc
diff --git a/samples/wrapper/Makefile b/samples/wrapper/Makefile
index 4cf869f..8b6f5b2 100644
--- a/samples/wrapper/Makefile
+++ b/samples/wrapper/Makefile
@@ -1,43 +1,30 @@
 # This should work on Linux.  Modify as needed for other platforms.
 
 # Change the following to match your installation
-BOINC_DIR = /usr/include/boinc
+BOINC_DIR = ../..
 BOINC_API_DIR = $(BOINC_DIR)/api
 BOINC_LIB_DIR = $(BOINC_DIR)/lib
 
 CXXFLAGS = -g \
-    -I../.. \
-    -I../../api \
-    -I../../lib \
-    -L../../lib \
     -I$(BOINC_DIR) \
     -I$(BOINC_LIB_DIR) \
     -I$(BOINC_API_DIR) \
     -L$(BOINC_API_DIR) \
     -L$(BOINC_LIB_DIR) \
+    -L.
 
-PROGS= wrapper
-EXTRA_SOURCES=
+PROGS = wrapper
 
 all: $(PROGS)
 
-LIBS=libstdc++.a libboinc_api.a libboinc.a
-
-$(LIBS):
-	if [ -r "../../lib/$@" ]; then \
-		ln -sf "../../lib/$@" . ; \
-	elif [ -r "../../api/$@" ]; then \
-		ln -sf "../../api/$@" . ; \
-	else \
-		ln -sf `g++ -print-file-name=$@` ; \
-	fi
+libstdc++.a:
+	ln -s `g++ -print-file-name=libstdc++.a`
 
 clean:
-	rm -f $(PROGS) *.o *.a
+	rm $(PROGS) *.o
 
 distclean:
-	/bin/rm -f $(PROGS) *.o $(LIBS)
-
-$(PROGS):  $(LIBS)
-	g++ $(CXXFLAGS) -Wl,--as-needed -o $@ $(@).cpp $(EXTRA_SOURCES) -L . $(LIBS) -pthread
+	/bin/rm -f $(PROGS) *.o libstdc++.a
 
+wrapper: wrapper.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a
+	g++ $(CXXFLAGS) -o wrapper wrapper.o libstdc++.a -pthread -lboinc_api -lboinc
diff --git a/samples/wrapper/wrapper.cpp b/samples/wrapper/wrapper.cpp
index add597e..fdd2db9 100644
--- a/samples/wrapper/wrapper.cpp
+++ b/samples/wrapper/wrapper.cpp
@@ -25,7 +25,7 @@
 // - checkpointing
 //      (at the level of task; or potentially within task)
 //
-// See http://boinc.berkeley.edu/trac/wiki/WrapperApp for details
+// See http://boinc.berkeley.edu/wrapper.php for details
 // Contributor: Andrew J. Younge (ajy4490 at umiacs.umd.edu)
 
 #include <stdio.h>
diff --git a/tools/calculate_credit_multiplier b/tools/calculate_credit_multiplier
index f512dc5..192d6b6 100755
--- a/tools/calculate_credit_multiplier
+++ b/tools/calculate_credit_multiplier
@@ -23,7 +23,7 @@ fi
 MYSQL="mysql -D $dbname -h $dbhost -u $dbuser -N -B"
 MYSQL_R="mysql -D $dbname -h $replica_dbhost -u $dbuser -N -B"
 
-median_host_query() {
+function median_host_query() {
   $MYSQL --execute="
      create temporary table medians (id int auto_increment primary key)
        select $1 from host 
@@ -40,7 +40,7 @@ median_host_query() {
      drop table ids;"
 }
 
-get_recent_credited_results() {
+function get_recent_credited_results() {
   $MYSQL_R --execute="
     set session transaction isolation level read uncommitted;
     create temporary table recent_results 
diff --git a/tools/db_query b/tools/db_query
index 02aaf54..f5649da 100755
--- a/tools/db_query
+++ b/tools/db_query
@@ -1,4 +1,4 @@
-#!/usr/bin/tcsh
+#! /bin/csh
 
 set CIVDATE = `date "+%Y:%m:%d:%H:%M"`
 set UNIXDATE = `perl -e 'print time()'`
diff --git a/tools/watch_tcp b/tools/watch_tcp
index 5686014..3f4eede 100755
--- a/tools/watch_tcp
+++ b/tools/watch_tcp
@@ -1,4 +1,4 @@
-#!/usr/bin/tcsh
+#! /bin/csh 
 # 
 # by jeffc 
 # 

-- 
BOINC packaging



More information about the pkg-boinc-commits mailing list