From: Robert Nelson Date: Wed, 1 Nov 2006 04:53:27 +0000 (+0000) Subject: Ignore UTF-8 marker at the start of .conf files. X-Git-Tag: Release-2.0.0~328 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b18f11080d87758b5f809ee6e032d1f3fe87b1eb;p=bacula%2Fbacula Ignore UTF-8 marker at the start of .conf files. Add stab2cv to 3rd party dependencies. This is a utility I wrote that is licensed under the GPL and available on SourceForge. It converts the stab debugging info generated by gcc into Codeview format. Currently it just translates function names to global symbols. This is sufficient to get reasonable stack traces from Dr Watson and to look at minidumps. Fix bug # 699 - winbacula client crashes whilerunning bat scripts. Enable Windows XP look and feel for the tray icons and wx-console. Add Windows specific FileSet example to bacula-dir.conf. Reorganize Start menu so that documentation and configuration are in subfolders. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3589 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/lib/lex.c b/bacula/src/lib/lex.c index 13b2cb9ab2..2fa93a7d13 100644 --- a/bacula/src/lib/lex.c +++ b/bacula/src/lib/lex.c @@ -324,6 +324,7 @@ lex_get_token(LEX *lf, int expect) int ch; int token = T_NONE; bool esc_next = false; + int unicode_count = 0; Dmsg0(dbglvl, "enter lex_get_token\n"); while (token == T_NONE) { @@ -395,6 +396,16 @@ lex_get_token(LEX *lf, int expect) lf->state = lex_include; begin_str(lf, 0); break; + case 0xEF: + if (lf->line_no != 1 || lf->col_no != 1) + { + lf->state = lex_string; + begin_str(lf, ch); + break; + } + lf->state = lex_unicode_mark; + unicode_count = 1; + break; default: lf->state = lex_string; begin_str(lf, ch); @@ -526,6 +537,27 @@ lex_get_token(LEX *lf, int expect) } add_str(lf, ch); break; + case lex_unicode_mark: + if (ch == L_EOF) { + token = T_ERROR; + break; + } + unicode_count++; + if (unicode_count == 2) { + if (ch != 0xBB) { + token = T_ERROR; + break; + } + } else if (unicode_count == 3) { + if (ch != 0xBF) { + token = T_ERROR; + break; + } + token = T_UNICODE_MARK; + lf->state = lex_none; + break; + } + break; } Dmsg4(dbglvl, "ch=%d state=%s token=%s %c\n", ch, lex_state_to_str(lf->state), lex_tok_to_str(token), ch); diff --git a/bacula/src/lib/lex.h b/bacula/src/lib/lex.h index 1a05225d0e..bf0bd1aac1 100644 --- a/bacula/src/lib/lex.h +++ b/bacula/src/lib/lex.h @@ -46,6 +46,8 @@ #define T_COMMA 111 #define T_EOL 112 #define T_ERROR 200 +#define T_UNICODE_MARK 201 + /* * The following will be returned only if * the appropriate expect flag has been set @@ -69,7 +71,8 @@ enum lex_state { lex_identifier, lex_string, lex_quoted_string, - lex_include + lex_include, + lex_unicode_mark }; /* Lex scan options */ diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index fb18ada83c..b3f6804312 100755 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -813,6 +813,9 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type) if (token == T_EOL) { break; } + if (token == T_UNICODE_MARK) { + break; + } if (token != T_IDENTIFIER) { scan_err1(lc, _("Expected a Resource name identifier, got: %s"), lc->str); return 0; @@ -827,7 +830,7 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error, int err_type) } if (state == p_none) { scan_err1(lc, _("expected resource name, got: %s"), lc->str); - return 0; + return 0; } break; case p_resource: diff --git a/bacula/src/win32/External-mingw32 b/bacula/src/win32/External-mingw32 index 2241801c26..41cc421069 100644 --- a/bacula/src/win32/External-mingw32 +++ b/bacula/src/win32/External-mingw32 @@ -35,3 +35,4 @@ MTX|http://superb-west.dl.sourceforge.net/sourceforge/mtx/mtx-1.3.9.tar.gz #MT|ftp://ftp.ibiblio.org/pub/linux/system/backup/mt-st-0.9b.tar.gz MT|http://www.ibiblio.org/pub/linux/system/backup/mt-st-0.9b.tar.gz SED|ftp://mirrors.kernel.org/gnu/sed/sed-4.1.5.tar.gz +STAB2CV|http://superb-west.dl.sourceforge.net/sourceforge/stab2cv/stab2cv-0.1.tar.bz2 diff --git a/bacula/src/win32/build-depkgs-mingw32 b/bacula/src/win32/build-depkgs-mingw32 index dc5a31fb79..49838f3bcd 100644 --- a/bacula/src/win32/build-depkgs-mingw32 +++ b/bacula/src/win32/build-depkgs-mingw32 @@ -99,7 +99,7 @@ get_source() rm -rf ${SRC_DIR} [ "${MAKE_DIR}" = "true" ] && mkdir ${SRC_DIR} && cd ${SRC_DIR} echo Extracting ${ARCHIVE} - ${ARCHIVER} ${ARCHIVE} &> ${ARCHIVE}.log + ${ARCHIVER} ${ARCHIVE} 2>&1 > ${ARCHIVE}.log cd ${SRC_DIR} return 0 fi @@ -174,7 +174,7 @@ process_pcre() --host=mingw32 \ --prefix=${DEPPKG_DIR} \ --enable-utf8 \ - --enable-unicode-properties &>make.log + --enable-unicode-properties 2>&1 >make.log fi echo Building PCRE do_make Makefile PREFIX=${DEPPKG_DIR} all @@ -213,7 +213,7 @@ process_openssl() shared zlib-dynamic \ threads \ --with-zlib-include=${DEPPKG_DIR}/include \ - mingw32 &> make.log + mingw32 2>&1 > make.log fi echo Building openssl perl util/mkdef.pl 32 libeay no-static-engine >ms/libeay32.def @@ -334,7 +334,7 @@ process_scons() { get_source "${URL_SCONS}" "${DIR_SCONS}" "${MKD_SCONS}" echo Installing scons - if python setup.py install --prefix=${DEPPKG_DIR}/scons &> make.log + if python setup.py install --prefix=${DEPPKG_DIR}/scons 2>&1 > make.log then : else @@ -413,7 +413,7 @@ process_sed() echo Configuring sed ./configure --host=mingw32 \ --prefix=${DEPPKG_DIR} \ - --disable-nls &>make.log + --disable-nls 2>&1 >make.log fi echo Building sed do_make Makefile all @@ -421,6 +421,23 @@ process_sed() do_make Makefile install } +process_stab2cv() +{ + if get_source "${URL_STAB2CV}" "${DIR_STAB2CV}" "${MKD_STAB2CV}" + then + # echo Patching stab2cv + # >patch.log + # do_patch stab2cv.patch + echo Configuring stab2cv + ./configure --prefix=${DEPPKG_DIR}/tools \ + 2>&1 >make.log + fi + echo Building stab2c + do_make Makefile + echo Installing stab2c + do_make Makefile install +} + if [ "$#" -eq 0 ] then process_zlib @@ -436,6 +453,7 @@ then process_mtx process_mt process_sed + process_stab2cv else for dependency in "$@" do diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index b01c6ca2e5..001e82bc57 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -1628,6 +1628,11 @@ GetApplicationName(const char *cmdline, char **pexe, const char **pargs) pExeEnd = current; } + if (*pargs == NULL) + { + *pargs = current; + } + bool bHasPathSeparators = pExeStart != pBasename; /* We have pointers to all the useful parts of the name */ diff --git a/bacula/src/win32/dird/Makefile b/bacula/src/win32/dird/Makefile index 9ac9599b13..de5b657b70 100644 --- a/bacula/src/win32/dird/Makefile +++ b/bacula/src/win32/dird/Makefile @@ -98,7 +98,7 @@ clean: $(BINDIR)/bacula-dir.exe: $(DIRD_OBJS) $(LIBS_CATS) $(LIBS_BACULA) $(call link_winapp,$(DIRD_LIBS)) -$(OBJDIR)/winres.res: ../libwin32/winres.rc +$(OBJDIR)/winres.res: winres.rc $(WINDRES) $(INCLUDE_ICONS) -O coff $< -o $@ include ../Makefile.rules diff --git a/bacula/src/win32/dird/dird.vcproj b/bacula/src/win32/dird/dird.vcproj index fc985cdedd..724f669b03 100644 --- a/bacula/src/win32/dird/dird.vcproj +++ b/bacula/src/win32/dird/dird.vcproj @@ -66,6 +66,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" + AdditionalIncludeDirectories="../libwin32" /> + + + + + + diff --git a/bacula/src/win32/dird/winres.rc b/bacula/src/win32/dird/winres.rc new file mode 100644 index 0000000000..48b4d7f724 --- /dev/null +++ b/bacula/src/win32/dird/winres.rc @@ -0,0 +1,76 @@ +#include +#include +#include "winres.h" +#include "../../version.h" + +/* NB: Internationalization of this file will require some work... */ +#define N_(s) s + +///////////////////////////////////////////////////////////////////////////// +// +// Icons +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_BACULA ICON "bacula.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,1,0,0 + PRODUCTVERSION 1,1,0,0 + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0 // +#endif + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E0" // Lang=US English, CharSet=Windows Multiligual + BEGIN + VALUE "Comments", "by Kern Sibbald\0" + VALUE "CompanyName", " \0" + VALUE "FileDescription", "Bacula Director for Win32\0" + VALUE "FileVersion", VERSION "\0" + VALUE "InternalName", "Bacula\0" + VALUE "LegalCopyright", "Copyright Kern Sibbald, 1999-2006\0" + VALUE "LegalTrademarks", "Licensed under GNU GPL 2.0\0" + VALUE "OriginalFilename", "bacula-fd.exe\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Bacula - Win32 Version\0" + VALUE "ProductVersion", VERSION + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 // US English, Multilingual + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BACULABMP BITMAP DISCARDABLE "bacula.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDI_BACULA "Bacula" +END diff --git a/bacula/src/win32/filed/Makefile b/bacula/src/win32/filed/Makefile index b887e5c7d3..6e2cab8bb0 100644 --- a/bacula/src/win32/filed/Makefile +++ b/bacula/src/win32/filed/Makefile @@ -57,7 +57,8 @@ FILED_LIBS = \ -lole32 \ -loleaut32 \ -lwsock32 \ - -luuid + -luuid \ + -lcomctl32 ###################################################################### diff --git a/bacula/src/win32/filed/bacula-fd.manifest b/bacula/src/win32/filed/bacula-fd.manifest new file mode 100644 index 0000000000..95deb2f34f --- /dev/null +++ b/bacula/src/win32/filed/bacula-fd.manifest @@ -0,0 +1,21 @@ + + + + Bacula File daemon for Win32 + + + + + + + diff --git a/bacula/src/win32/filed/baculafd.vcproj b/bacula/src/win32/filed/baculafd.vcproj index 2ac1bf3aa8..9efc132f77 100644 --- a/bacula/src/win32/filed/baculafd.vcproj +++ b/bacula/src/win32/filed/baculafd.vcproj @@ -68,7 +68,7 @@ /> + + diff --git a/bacula/src/win32/filed/winmain.cpp b/bacula/src/win32/filed/winmain.cpp index 5b540af89c..9636380099 100644 --- a/bacula/src/win32/filed/winmain.cpp +++ b/bacula/src/win32/filed/winmain.cpp @@ -25,6 +25,12 @@ #include #include +#undef _WIN32_IE +#define _WIN32_IE 0x0401 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#include + extern int BaculaMain(int argc, char *argv[]); extern void terminate_filed(int sig); extern DWORD g_error; @@ -65,6 +71,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, main_pid = getpid(); main_tid = pthread_self(); + INITCOMMONCONTROLSEX initCC = { + sizeof(INITCOMMONCONTROLSEX), + ICC_STANDARD_CLASSES + }; + + InitCommonControlsEx(&initCC); + /* * Funny things happen with the command line if the * execution comes from c:/Program Files/bacula/bacula.exe diff --git a/bacula/src/win32/installer/Makefile b/bacula/src/win32/installer/Makefile index 61708ffb21..c5f449c382 100644 --- a/bacula/src/win32/installer/Makefile +++ b/bacula/src/win32/installer/Makefile @@ -112,7 +112,7 @@ installer: $(INSTALL_EXE) clean: @echo "Cleaning `pwd`" - $(CMD_ECHO)-rm -f $(INSTALL_EXE) $(BACULA_BINARIES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(SSL_FILES) + $(CMD_ECHO)-rm -f $(INSTALL_EXE) $(BACULA_BINARIES) $(DEPKGS_BINARIES) $(NONGCC_BINARIES) $(NONGCC_LIBRARIES) $(SSL_FILES) $(DIRD_FILES) $(CMD_ECHO)-rm -f $(BACULA_BINARIES) $(addsuffix .dbg,$(basename $(BACULA_BINARIES))) $(CMD_ECHO)-rm -f $(DEPKGS_BINARIES) $(addsuffix .dbg,$(basename $(DEPKGS_BINARIES))) $(CMD_ECHO)-rm -f *.exe @@ -121,10 +121,10 @@ clean: # Rules # -define Strip_Binary +define Convert_Binary $$(notdir $(1)): $(1) - $(ECHO_CMD)cp -f $$^ $$@ - $$(call makedbg,$$@) + $(ECHO_CMD)cp -f $$^ $$@ ; \ + $(STAB2CV) $$@ endef define Copy_Binary @@ -132,13 +132,13 @@ $$(notdir $(1)): $(1) $(ECHO_CMD)cp -f $$^ $$@ endef -$(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Strip_Binary,$(file)))) +$(foreach file,$(addprefix $(DEPKGS)/bin/, $(DEPKGS_BINARIES)),$(eval $(call Convert_Binary,$(file)))) $(foreach file,$(addprefix $(DEPKGS)/bin/, $(NONGCC_BINARIES)),$(eval $(call Copy_Binary,$(file)))) $(foreach file,$(addprefix $(DEPKGS)/lib/, $(NONGCC_LIBRARIES)),$(eval $(call Copy_Binary,$(file)))) -$(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Strip_Binary,$(file)))) +$(foreach file,$(addprefix $(BINDIR)/, $(BACULA_BINARIES)),$(eval $(call Convert_Binary,$(file)))) $(foreach file,$(addprefix $(DEPKGS)/ssl/, $(SSL_FILES)),$(eval $(call Copy_Binary,$(file)))) diff --git a/bacula/src/win32/installer/bacula-dir.conf.in b/bacula/src/win32/installer/bacula-dir.conf.in index d609e85ee9..a65bf1ed1b 100644 --- a/bacula/src/win32/installer/bacula-dir.conf.in +++ b/bacula/src/win32/installer/bacula-dir.conf.in @@ -28,7 +28,7 @@ JobDefs { Type = Backup Level = Incremental Client = @client_name@ - FileSet = "Full Set" + FileSet = "Test Set" Schedule = "WeeklyCycle" Storage = File Messages = Standard @@ -76,20 +76,23 @@ Job { Name = "RestoreFiles" Type = Restore Client=@client_name@ - FileSet="Full Set" + FileSet="Test Set" Storage = File Pool = Default Messages = Standard Where = "C:\\tmp\\bacula-restores" } - +# +# Note: Windows path separators do NOT work correctly in FileSets. +# # List of files to be backed up FileSet { - Name = "Full Set" + Name = "Test Set" Include { Options { signature = MD5 + ignore case = yes } # # Put your list of files here, preceded by 'File =', one per line @@ -97,26 +100,128 @@ FileSet { # # File = + + + Bacula Storage daemon for Win32 + + + + + + + diff --git a/bacula/src/win32/stored/baculasd/baculasd.vcproj b/bacula/src/win32/stored/baculasd/baculasd.vcproj index 4fc4417e72..8d72b7f9fa 100644 --- a/bacula/src/win32/stored/baculasd/baculasd.vcproj +++ b/bacula/src/win32/stored/baculasd/baculasd.vcproj @@ -67,7 +67,7 @@ /> + + diff --git a/bacula/src/win32/stored/baculasd/winmain.cpp b/bacula/src/win32/stored/baculasd/winmain.cpp index b665df7934..3230340c68 100644 --- a/bacula/src/win32/stored/baculasd/winmain.cpp +++ b/bacula/src/win32/stored/baculasd/winmain.cpp @@ -25,6 +25,12 @@ #include #include +#undef _WIN32_IE +#define _WIN32_IE 0x0501 +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#include + extern int BaculaMain(int argc, char *argv[]); extern void terminate_stored(int sig); extern DWORD g_error; @@ -64,6 +70,13 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, main_pid = getpid(); main_tid = pthread_self(); + INITCOMMONCONTROLSEX initCC = { + sizeof(INITCOMMONCONTROLSEX), + ICC_STANDARD_CLASSES + }; + + InitCommonControlsEx(&initCC); + /* * Funny things happen with the command line if the * execution comes from c:/Program Files/bacula/bacula.exe diff --git a/bacula/src/win32/stored/baculasd/winres.rc b/bacula/src/win32/stored/baculasd/winres.rc index 129fd58709..78f64b151c 100644 --- a/bacula/src/win32/stored/baculasd/winres.rc +++ b/bacula/src/win32/stored/baculasd/winres.rc @@ -79,6 +79,13 @@ BEGIN END END + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "bacula-sd.manifest" + ///////////////////////////////////////////////////////////////////////////// // // Bitmap diff --git a/bacula/src/win32/wx-console/wx-console.manifest b/bacula/src/win32/wx-console/wx-console.manifest new file mode 100644 index 0000000000..ef25e4796a --- /dev/null +++ b/bacula/src/win32/wx-console/wx-console.manifest @@ -0,0 +1,21 @@ + + + + Bacula wx Console for Win32 + + + + + + + diff --git a/bacula/src/win32/wx-console/wx-console.vcproj b/bacula/src/win32/wx-console/wx-console.vcproj index 960f10ea19..ee93c79d59 100644 --- a/bacula/src/win32/wx-console/wx-console.vcproj +++ b/bacula/src/win32/wx-console/wx-console.vcproj @@ -48,8 +48,8 @@ UsePrecompiledHeader="0" BrowseInformation="1" WarningLevel="3" - Detect64BitPortabilityProblems="false" SuppressStartupBanner="true" + Detect64BitPortabilityProblems="false" DebugInformationFormat="4" /> + + + + - - diff --git a/bacula/src/wx-console/wx-console_private.rc b/bacula/src/wx-console/wx-console_private.rc index 9cc0d98f63..5672be173a 100644 --- a/bacula/src/wx-console/wx-console_private.rc +++ b/bacula/src/wx-console/wx-console_private.rc @@ -1,2 +1,8 @@ A ICON MOVEABLE PURE LOADONCALL DISCARDABLE "wx-console.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// RT_MANIFEST +// +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wx-console.manifest"