This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/osx in repository x2goclient. discards aaf9f1f src/configdialog.cpp: whitespace only. discards 7a2ed4c src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) discards acce573 src/pulsemanager.cpp: backport fix for 422. discards 73a6e7e src/pulsemanager.cpp: backport fix for 526. discards 62d3e84 src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) discards 6a12481 src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. discards 2db96e7 src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. discards 0932473 pulsemanager.cpp: remove config.pa while doing post-exit cleanups. discards 9d1fe54 macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". discards ad68cd6 macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. discards 3722238 pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. discards 39fa4bc pulsemanager.cpp: use record and playback member variables. discards f6b328c pulsemanager.h: more moving around. discards 22daf91 pulsemanager.cpp: fix compile error in startup sound function. discards 7e73594 pulsemanager.cpp: reorder member variables in initializer list. discards 6cd6988 pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. discards 3d42f28 pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. discards 131b42a pulsemanager.cpp: add algorithm for actually extracting PA version number. discards 3012c60 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. discards 7dbf8a6 pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. discards 67552b3 pulsemanager.cpp: fix some error messages by removing redundant newlines. discards 99a49f8 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. discards 5c22897 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. discards 95ee2ae pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. discards 78643ee pulsemanager.cpp: add "dummy" start_linux () function. discards a30165b pulsemanager.cpp: reorder member variables in initialization list. discards c53d4de pulsemanager.cpp: another typo fix: findPort -> find_port. discards 0ed1861 pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). discards feec5f5 pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. discards dd9c392 pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. discards c670a3a pulsemanager.cpp: typo fix in member variable name server_working_dir_. discards 2bfa676 pulsemanager.h: whitespace only. discards a69e768 pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. discards 75ef184 pulsemanager.cpp: only play startup sound if DEBUG macro is defined. discards 50ad65f pulsemanager.cpp: make generate_client_config () Windows-compatible. discards 3a1bce6 pulsemanager.cpp: make generate_server_config () Windows-compatible. discards 5a20975 pulsemanager.cpp: also load module-esound-protocol-tcp module. discards e52ff77 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. discards d2c3d83 pulsemanager.cpp: let start_osx () use start_generic (). discards fa56149 pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. discards f3720d7 pulsemanager.cpp: add Windows stuff to initial env in constructor. discards 5141e8f pulsemanager.cpp: add cleanup support to on_pulse_finished (). discards 6b3a078 pulsemanager.cpp: add Windows support to shutdown (). discards e65b370 pulsemanager.{cpp,h}: new function create_client_dir (). discards 3935584 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. discards 0a0034c pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. discards 8360918 pulsemanager.{cpp,h}: fixup preprocessor usage. discards f4ad932 pulsemanager.cpp: reformat only. discards 20bf0ef pulsemanager.{cpp,h}: rename relaunch () to restart (). discards a35ee6a pulsemanager.{cpp,h}: add ESD support. discards 3efe4e9 pulsemanager.h: add std:: namespace selector for uint32_t version variables. discards 8625d74 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. discards 23d3108 pulsemanager.cpp: reformat only. discards c4da1e5 pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. discards 0264a7e pulsemanager.cpp: use initializer list for constructor. discards f563c1f pulsemanager.{cpp,h}: reformat only. discards fa5156d pulsemanager.cpp: minor non-behavior changing fixes. discards b08739e pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. discards da543b4 macbuild.sh: rewrite ID line detection algorithm. discards 57cd357 macbuild.sh: copy "special" files, so that they can be removed later on. discards 17a962b macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. discards 1218836 macbuild.sh: more debug messages and a whitespace change. discards 8ca7054 macbuild.sh: spelling fix. discards 74de1c7 macbuild.sh: merge deduplicate.sh content in. discards 0a2c3d2 deduplicate.sh: replace tabs with two spaces. No functional changes. discards 58ff7dc macbuild.sh: replace tabs with two spaces. No functional changes. discards 3cf5a0a deduplicate.sh: remove some noisy debug output. discards 6a71983 deduplicate.sh: add WARNING to status message. discards 36ecadb deduplicate.sh: fix wrong return value capture. discards 2008d1f deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. discards f0db22a deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. discards c6bf20a deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. discards 84bf10f deduplicate.sh: more temporary debugging output in fixup section. discards f922e32 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. discards c05ccba deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. discards 781e1e8 deduplicate.sh: actually include file name in install_name_tool pseudo output. discards b2131ca deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. discards c27aded deduplicate.sh: unstub fixup section. discards 9764cbb deduplicate.sh: add more useful information in fixup section's error message. discards e379247 deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. discards 5f34458 deduplicate.sh: prevent word splitting when parsing otool's output. discards 448ad3d deduplicate.sh: debug parse_otool_output fiercely for the time being. discards fd5a9e3 deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. discards c7f6ca7 deduplicate.sh: change exit to return in parse_otool_output. discards 445b919 deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. discards 28e6af0 deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. discards 2e1ed3d deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. discards b730e32 deduplicate.sh: correctly unset an array element. discards b59aa35 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. discards 8e71b52 deduplicate.sh: non-functional: change WARNING to ERROR in error messages. discards df17df1 deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. discards 13baa86 deduplicate.sh: add missed local variable declaration. discards 04b84a9 deduplicate.sh: add duplicates-to-real mapping. discards 6540806 deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. discards 8cf32d7 macbuild.sh: also install libraries into staging area with intermediate library path. discards 3ea2c50 macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. discards d27e414 macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. discards 9732a38 macbuild.sh: add the correct file path to the library bundling array. discards a365ffb macbuild.sh: check current file name against regex, not a (now) full path. discards 2a87234 macbuild.sh: use while-read-loop and find to actually recurse through directories. discards e362dd5 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. discards cb0aac7 macbuild.sh: add some more debugging output. discards f6a2141 macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. discards b299694 macbuild.sh: add Linux library file name scheme regex as a precaution. discards 2959330 macbuild.sh: add work-in-progress PulseAudio bundling. discards 38aa584 macbuild.sh: add phase output for bundling nxproxy. discards ec2d622 macbuild.sh: copy PulseAudio libraries and binaries. discards eafd1c7 macbuild.sh: define PulseAudio libraries and binaries to be later copied. discards c8648c1 macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. discards 67d2222 macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. discards 2c96b01 macbuild.sh: add new repeat_str() helper function. discards 128be61 macbuild.sh: add new get_nesting_level() helper function. discards 5f5dda8 macbuild.sh: add new lazy_canonical_path() helper function. discards 9dbcb79 macbuild.sh: add new dependency_error() helper function. discards 2aa213e macbuild.sh: add new MACPORTS_PREFIX detection/variable. discards a0cdfb2 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. discards 9eabfd0 pulsemanager.{cpp,h}: new class for PulseAudio management. discards bbc17ae compat.h: include QtCore/qglobal.h for Q_OS_... macros. discards 3f1bcba compat.{cpp,h}: remove inline keyword, because function is not defined in header file. discards e9720ca compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. discards 8f5ad74 onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. discards 07f15a7 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. discards b48e93a {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. discards e4ab18c x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. discards c64758c unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. discards b3f8776 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. discards 8123a55 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. discards 1830532 x2goclient.cpp: create new argv array on the heap instead of on the stack. discards 19be364 x2goclient.cpp: fix string comparison. discards c0a42d6 x2goclient.cpp: fix compile problems introduced with the last commit. discards f06b1b3 x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. discards 3577701 x2goclient.cpp: clean up. discards 264782e unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. discards dcca2f5 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. discards 56eb1fd unixhelper.cpp: kill process group on error. discards 3bd8aed x2goclient.cpp: return return value of unixhelper::unix_cleanup(). discards 251d5c2 unixhelper.{cpp,h}: add documentation/comments. discards f8a3094 unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. discards e129f8f unixhelper.h: forgot to declare type of unix_cleanup() function. discards 43a7000 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. discards 2e1f6fa x2goclient.cpp: fix std::edit -> std::exit typo. discards 46a54de x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. discards 89978bd x2goclient.cpp: add myself to copyright header. discards c3999c9 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. discards dd60e45 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. discards 604271f x2goclient.cpp: wrap X2Go Client main function and use that. discards 96eab54 unixhelper.{cpp,h}: implement cleanup program for process group. discards 974b66c {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. adds c28a95b misc {src/,x2goclient.pro}: port to Qt5. adds 71c5703 src/{ongetpass,onmainwindow}.cpp: fixup QPlastiqueStyle usage on Qt5. adds 6da2be5 x2goclient.spec: whitespace only. adds 84df138 res/i18n/x2goclient_fi.ts: update Finnish translation file. adds 3772ad2 src/onmainwindow.cpp: add (default) MacPorts prefix, /usr/local/bin and /opt/X11/bin to x2goclient's environment and child environments before starting xmodmap. Fixes: #1019. adds 864a093 src/x2goutils.{cpp,h}: add new function add_to_path () to add multiple entries to a PATH-like string if they do not exist in there yet. adds 2ace014 src/onmainwindow.cpp: replace old code to modify the PATH value with the new add_to_path () function. adds c788a14 src/{onmainwindow,sshmasterconnection}.{cpp,h}: add support for ANSI X9.9 OTP tokens. Fixes: #1027. adds 128d498 src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only changes following up the #1027 patch. new ab40796 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. new 2bce4c6 unixhelper.{cpp,h}: implement cleanup program for process group. new a804870 x2goclient.cpp: wrap X2Go Client main function and use that. new 27766a3 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. new d7d1603 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. new 9daef6f x2goclient.cpp: add myself to copyright header. new 7f59be4 x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. new d88ccb7 x2goclient.cpp: fix std::edit -> std::exit typo. new 60be517 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. new e9df0f4 unixhelper.h: forgot to declare type of unix_cleanup() function. new b7a2467 unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. new 6c5b966 unixhelper.{cpp,h}: add documentation/comments. new 8afb4da x2goclient.cpp: return return value of unixhelper::unix_cleanup(). new 48599b7 unixhelper.cpp: kill process group on error. new ef137a5 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. new 2bc5721 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. new 7a43641 x2goclient.cpp: clean up. new 3052b8d x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. new 1107cd6 x2goclient.cpp: fix compile problems introduced with the last commit. new 49b9264 x2goclient.cpp: fix string comparison. new 466e229 x2goclient.cpp: create new argv array on the heap instead of on the stack. new 8f1295f unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. new 0c5dbd3 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. new 957e1e1 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. new 5e376ba x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. new e4206ac {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. new 4a26eb1 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. new f660a1b onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. new 43518a7 compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. new 780b82f compat.{cpp,h}: remove inline keyword, because function is not defined in header file. new d5c66e3 compat.h: include QtCore/qglobal.h for Q_OS_... macros. new 74247ba pulsemanager.{cpp,h}: new class for PulseAudio management. new 564c715 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. new bcc3481 macbuild.sh: add new MACPORTS_PREFIX detection/variable. new 16fd81a macbuild.sh: add new dependency_error() helper function. new 8c99a93 macbuild.sh: add new lazy_canonical_path() helper function. new 4c988a3 macbuild.sh: add new get_nesting_level() helper function. new 2314ad4 macbuild.sh: add new repeat_str() helper function. new 563b20e macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. new 9b8be1f macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. new aa85e38 macbuild.sh: define PulseAudio libraries and binaries to be later copied. new 645b1dd macbuild.sh: copy PulseAudio libraries and binaries. new d48c444 macbuild.sh: add phase output for bundling nxproxy. new 0d9deae macbuild.sh: add work-in-progress PulseAudio bundling. new 5802d2a macbuild.sh: add Linux library file name scheme regex as a precaution. new 66d40e8 macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. new 6761ac0 macbuild.sh: add some more debugging output. new c717c37 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. new b1e5fe5 macbuild.sh: use while-read-loop and find to actually recurse through directories. new ae79f80 macbuild.sh: check current file name against regex, not a (now) full path. new 2f005e7 macbuild.sh: add the correct file path to the library bundling array. new e434544 macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. new 5918631 macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. new 765dcfb macbuild.sh: also install libraries into staging area with intermediate library path. new c530eef deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. new 0fb2a1b deduplicate.sh: add duplicates-to-real mapping. new 39e861f deduplicate.sh: add missed local variable declaration. new ec0269c deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. new ceaa0c6 deduplicate.sh: non-functional: change WARNING to ERROR in error messages. new 84060c4 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. new 2a16ae3 deduplicate.sh: correctly unset an array element. new c3f6f60 deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. new abf719b deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. new c7fafa7 deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. new e040697 deduplicate.sh: change exit to return in parse_otool_output. new ce08cb5 deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. new eff4178 deduplicate.sh: debug parse_otool_output fiercely for the time being. new 97aa892 deduplicate.sh: prevent word splitting when parsing otool's output. new 92c1b77 deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. new e801c03 deduplicate.sh: add more useful information in fixup section's error message. new 06b19f6 deduplicate.sh: unstub fixup section. new d232392 deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. new bab2f89 deduplicate.sh: actually include file name in install_name_tool pseudo output. new 2a33416 deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. new 8737ec4 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. new 11f3aba deduplicate.sh: more temporary debugging output in fixup section. new bf1f5b9 deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. new 0e2f781 deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. new 8e33c92 deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. new e650e53 deduplicate.sh: fix wrong return value capture. new 39bde7f deduplicate.sh: add WARNING to status message. new 6af973f deduplicate.sh: remove some noisy debug output. new 94d439f macbuild.sh: replace tabs with two spaces. No functional changes. new 0e5b5c0 deduplicate.sh: replace tabs with two spaces. No functional changes. new 9355769 macbuild.sh: merge deduplicate.sh content in. new bbf6fa1 macbuild.sh: spelling fix. new 4417d8f macbuild.sh: more debug messages and a whitespace change. new 7caaa1f macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. new d3e2966 macbuild.sh: copy "special" files, so that they can be removed later on. new 485eee4 macbuild.sh: rewrite ID line detection algorithm. new 735f7f4 pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. new 9de3b64 pulsemanager.cpp: minor non-behavior changing fixes. new 4ecd20c pulsemanager.{cpp,h}: reformat only. new 223e608 pulsemanager.cpp: use initializer list for constructor. new 921e76e pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. new 12e3064 pulsemanager.cpp: reformat only. new 5a215c1 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. new b3af061 pulsemanager.h: add std:: namespace selector for uint32_t version variables. new 0aded3b pulsemanager.{cpp,h}: add ESD support. new 0f371b8 pulsemanager.{cpp,h}: rename relaunch () to restart (). new 751468f pulsemanager.cpp: reformat only. new 0732df6 pulsemanager.{cpp,h}: fixup preprocessor usage. new 09aa5a4 pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. new 4777d20 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. new 50a3854 pulsemanager.{cpp,h}: new function create_client_dir (). new db5cba0 pulsemanager.cpp: add Windows support to shutdown (). new 0f33e9c pulsemanager.cpp: add cleanup support to on_pulse_finished (). new 6689ed4 pulsemanager.cpp: add Windows stuff to initial env in constructor. new 554524c pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. new 546fbbb pulsemanager.cpp: let start_osx () use start_generic (). new 2918435 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. new 53d18eb pulsemanager.cpp: also load module-esound-protocol-tcp module. new bab4e4d pulsemanager.cpp: make generate_server_config () Windows-compatible. new 792c8d0 pulsemanager.cpp: make generate_client_config () Windows-compatible. new 2665b8e pulsemanager.cpp: only play startup sound if DEBUG macro is defined. new e5a74df pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. new f40b416 pulsemanager.h: whitespace only. new cc214a0 pulsemanager.cpp: typo fix in member variable name server_working_dir_. new 96ed535 pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. new 6cfdbad pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. new 581e38b pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). new ea3b3f4 pulsemanager.cpp: another typo fix: findPort -> find_port. new b34cab4 pulsemanager.cpp: reorder member variables in initialization list. new 7bf8af9 pulsemanager.cpp: add "dummy" start_linux () function. new df8cec3 pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. new 9cc8467 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. new 7234892 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. new 3ab2387 pulsemanager.cpp: fix some error messages by removing redundant newlines. new 6232d91 pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. new 406fce6 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. new 20d8507 pulsemanager.cpp: add algorithm for actually extracting PA version number. new 1664b9d pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. new b3f6213 pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. new 09abea1 pulsemanager.cpp: reorder member variables in initializer list. new 5e2e528 pulsemanager.cpp: fix compile error in startup sound function. new 2d09a70 pulsemanager.h: more moving around. new 957430a pulsemanager.cpp: use record and playback member variables. new 1bd937d pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. new a39a24a macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. new 1e70466 macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". new fd08fbe pulsemanager.cpp: remove config.pa while doing post-exit cleanups. new e999dee src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. new 049fd32 src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. new 0b309c8 src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) new 394de39 src/pulsemanager.cpp: backport fix for 526. new 0213f62 src/pulsemanager.cpp: backport fix for 422. new 09cf96a src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) new 83a4d7d src/configdialog.cpp: whitespace only. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (aaf9f1f) \ N -- N -- N refs/heads/bugfix/osx (83a4d7d) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 148 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 26 +++++++++++ res/i18n/x2goclient_fi.ts | 12 ++--- src/SVGFrame.cpp | 4 +- src/SVGFrame.h | 4 +- src/configdialog.cpp | 2 +- src/configdialog.h | 2 +- src/cupsprint.cpp | 30 ++++++------- src/cupsprintersettingsdialog.cpp | 2 +- src/cupsprintersettingsdialog.h | 2 +- src/editconnectiondialog.cpp | 2 +- src/editconnectiondialog.h | 2 +- src/exportdialog.cpp | 2 +- src/exportdialog.h | 2 +- src/httpbrokerclient.cpp | 24 ++++++++++ src/imgframe.cpp | 2 +- src/imgframe.h | 2 +- src/ongetpass.cpp | 6 +++ src/onmainwindow.cpp | 88 +++++++++++++++++++++++++++++-------- src/onmainwindow.h | 1 + src/onmainwindow_privat.h | 7 ++- src/sessionbutton.cpp | 4 +- src/sessionexplorer.cpp | 5 +++ src/sessionmanagedialog.cpp | 2 +- src/sessionmanagedialog.h | 2 +- src/sshmasterconnection.cpp | 51 ++++++++++++--------- src/sshmasterconnection.h | 1 + src/x2goutils.cpp | 88 +++++++++++++++++++++++++++++++++++++ src/x2goutils.h | 12 +++++ x2goclient.pro | 1 + x2goclient.spec | 22 +++++----- 30 files changed, 320 insertions(+), 90 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ab40796b14fbc2b77f95ad48f4435f9a7cca2ab0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 14 22:21:34 2015 +0100 {unixhelper.{cpp,h},x2goclient.pro{maemo}}: add unixhelper stub. --- debian/changelog | 1 + src/unixhelper.cpp | 23 +++++++++++++++++++++++ src/unixhelper.h | 29 +++++++++++++++++++++++++++++ x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 5 files changed, 61 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 77f7d12..dd56dae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -24,6 +24,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium new add_to_path () function. - src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only changes following up the #1027 patch. + - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp new file mode 100644 index 0000000..221bdb2 --- /dev/null +++ b/src/unixhelper.cpp @@ -0,0 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef Q_OS_UNIX + + +#endif /* defined (Q_OS_UNIX) */ diff --git a/src/unixhelper.h b/src/unixhelper.h new file mode 100644 index 0000000..31d983e --- /dev/null +++ b/src/unixhelper.h @@ -0,0 +1,29 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef Q_OS_UNIX + +#ifndef UNIXHELPER_H +#define UNIXHELPER_H + + + +#endif /* !defined (UNIXHELPER_H) */ + +#endif /* defined (Q_OS_UNIX) */ diff --git a/x2goclient.pro b/x2goclient.pro index febffb9..34da16e 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -79,7 +79,8 @@ HEADERS += src/configdialog.h \ src/folderbutton.h \ src/folderexplorer.h \ src/non_modal_messagebox.h \ - src/help.h + src/help.h \ + src/unixhelper.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -122,7 +123,8 @@ SOURCES += src/sharewidget.cpp \ src/folderbutton.cpp \ src/folderexplorer.cpp \ src/non_modal_messagebox.cpp \ - src/help.cpp + src/help.cpp \ + src/unixhelper.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index ac2eacf..63cc3d8 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -35,7 +35,8 @@ HEADERS += src/configdialog.h \ src/settingswidget.h \ src/sharewidget.h \ src/clicklineedit.h \ - src/help.h + src/help.h \ + src/unixhelper.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -62,7 +63,8 @@ SOURCES += src/sharewidget.cpp \ src/embedwidget.cpp \ src/wapi.cpp \ src/clicklineedit.cpp \ - src/help.cpp + src/help.cpp \ + src/unixhelper.cpp TEMPLATE = app TARGET = -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2bce4c63be1a98c45a17782284baf78bc1c02607 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 14 23:57:49 2015 +0100 unixhelper.{cpp,h}: implement cleanup program for process group. --- debian/changelog | 1 + src/unixhelper.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/unixhelper.h | 9 +++++++++ 3 files changed, 48 insertions(+) diff --git a/debian/changelog b/debian/changelog index dd56dae..2d7918e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/{onmainwindow,sshmasterconnection}.cpp: refactoring and whitespace only changes following up the #1027 patch. - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. + - unixhelper.{cpp,h}: implement cleanup program for process group. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 221bdb2..545c2c1 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -19,5 +19,43 @@ #ifdef Q_OS_UNIX +#include <csignal> +#include <unistd.h> +#include <iostream> +#include <cstring> +#include <cerrno> +#include <cstdlib> + +#include "unixhelper.h" + +void unixhelper::kill_pgroup (int signal) { + if (SIGHUP == signal) { + /* Try to kill via SIGTERM first. */ + if (0 != killpg (getpgrp (), SIGTERM)) { + std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; + } + + /* Grant a grace period of (at least) 5 seconds. */ + sleep (5); + + /* Don't handle any errors here, because we die anyway. */ + killpg (getpgrp (), SIGKILL); + } +} + + +int unixhelper::unix_cleanup () { + if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + std::exit (1); + } + + std::signal (SIGHUP, kill_pgroup); + + /* Sleep forever... at least one second in each run. */ + for (;;) { + sleep (1); + } +} #endif /* defined (Q_OS_UNIX) */ diff --git a/src/unixhelper.h b/src/unixhelper.h index 31d983e..fab611e 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -22,7 +22,16 @@ #ifndef UNIXHELPER_H #define UNIXHELPER_H +class unixhelper { + public: + unixhelper () {} + ~unixhelper () {} + unix_cleanup (); + private: + unixhelper (const unixhelper &other); + void kill_pgroup (int signal); +}; #endif /* !defined (UNIXHELPER_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9daef6f3d552ef3d523d9e1fc5945c25161a68c2 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:36:35 2015 +0100 x2goclient.cpp: add myself to copyright header. --- debian/changelog | 1 + src/x2goclient.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 96d66cc..1cace3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium leader. If that fails, fork, terminate the parent and execute setsid() in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. + - x2goclient.cpp: add myself to copyright header. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index f56bed2..44c41d3 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -1,6 +1,7 @@ /************************************************************************** * Copyright (C) 2005-2016 by Oleksandr Shneyder * * o.shneyder@phoca-gmbh.de * +* Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 27766a306ecb25ce718ed0e77df5831c3b2f687a Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:27:23 2015 +0100 x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. --- debian/changelog | 2 ++ src/x2goclient.cpp | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/debian/changelog b/debian/changelog index 25e7821..6d12fdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -27,6 +27,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. - unixhelper.{cpp,h}: implement cleanup program for process group. - x2goclient.cpp: wrap X2Go Client main function and use that. + - x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup + helper. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index fb63fe5..df15858 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -15,12 +15,45 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ +#include <iostream> +#include <unistd.h> +#include <cstring> +#include <cerrno> +#include <cstdlib> + +#include "unixhelper.h" #include "ongetpass.h" int wrap_x2go_main (int argc, char **argv) { return (x2goMain (argc, argv)); } +#ifdef Q_OS_UNIX +int fork_helper (int argc, char **argv) { + /* Fork off to start helper process. */ + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Starting unixhelper. */ + unixhelper cleanup_helper (); + cleanup_helper.unix_cleanup (); + } + /* Error. */ + else if (-1 == tmp_pid) { + std::cerr << "Unable to create a new process for the UNIX cleanup watchdog: " << std::strerror (errno) << "\n"; + std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + + std::exit (EXIT_FAILURE); + } + /* Parent. */ + else { + /* Start real X2Go Client. */ + return (wrap_x2go_main (argc, argv)); + } +} +#endif /* defined (Q_OS_UNIX) */ + int main(int argc, char *argv[]) { return (wrap_x2go_main (argc, argv)); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d7d160369488f370320003af9b4feede579eb2d4 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:30:49 2015 +0100 x2goclient.cpp: use setsid() on UNIX to become session and process group leader. If that fails, fork, terminate the parent and execute setsid() in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. --- debian/changelog | 4 ++++ src/x2goclient.cpp | 43 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6d12fdf..96d66cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,10 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.cpp: wrap X2Go Client main function and use that. - x2goclient.cpp: add fork_helper() function to start up the UNIX cleanup helper. + - x2goclient.cpp: use setsid() on UNIX to become session and process group + leader. If that fails, fork, terminate the parent and execute setsid() + in the child process. Use fork_helper() to start the UNIX cleanup helper + in a child process and continue with the main application in the parent. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index df15858..f56bed2 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -54,7 +54,44 @@ int fork_helper (int argc, char **argv) { } #endif /* defined (Q_OS_UNIX) */ -int main(int argc, char *argv[]) -{ - return (wrap_x2go_main (argc, argv)); +int main (int argc, char **argv) { +#ifdef Q_OS_UNIX + if (-1 == setsid ()) { + std::cerr << "Unable to create a new process session: " << std::strerror (errno) << "\n"; + + std::cerr << "Trying to fork." << std::endl; + pid_t tmp_pid = fork (); + + /* Child. */ + if (0 == tmp_pid) { + /* Trying to get a new session and become session + process group leader again. */ + if (-1 == setsid ()) { + std::cerr << "Child was unable to create a new process session: " << std::strerror (errno) << "\n"; + std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + + std::exit (EXIT_FAILURE); + } + + /* By now, we should be session and group leader. */ + return (fork_helper (argc, argv)); + } + /* Error. */ + else if (-1 == tmp_pid) { + std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; + std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + + std::edit (EXIT_FAILURE); + } + /* Parent. Just die here. */ + else { + std::exit (EXIT_SUCCESS); + } + } + else { + /* setsid() worked. Starting helper and main program. */ + return (fork_helper (argc, argv)); + } +#else /* defined (Q_OS_UNIX) */ + return (wrap_x2go_main (argc, argv)); +#endif /* defined (Q_OS_UNIX) */ } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit a8048708cd49dc971b50191d6d6da8ec226fc451 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun Mar 15 00:03:42 2015 +0100 x2goclient.cpp: wrap X2Go Client main function and use that. --- debian/changelog | 1 + src/x2goclient.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2d7918e..25e7821 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium changes following up the #1027 patch. - {unixhelper.{cpp,h},x2goclient.pro{,.maemo}}: add unixhelper stub. - unixhelper.{cpp,h}: implement cleanup program for process group. + - x2goclient.cpp: wrap X2Go Client main function and use that. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 015bbce..fb63fe5 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -17,7 +17,11 @@ #include "ongetpass.h" +int wrap_x2go_main (int argc, char **argv) { + return (x2goMain (argc, argv)); +} + int main(int argc, char *argv[]) { - return x2goMain(argc,argv); + return (wrap_x2go_main (argc, argv)); } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d88ccb78d63a6632e69457060e41f0c90e3b0dd7 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:45:24 2015 +0100 x2goclient.cpp: fix std::edit -> std::exit typo. --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6106d1d..7886d8d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.cpp: add myself to copyright header. - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. + - x2goclient.cpp: fix std::edit -> std::exit typo. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 1e92536..f495796 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -82,7 +82,7 @@ int main (int argc, char **argv) { std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; - std::edit (EXIT_FAILURE); + std::exit (EXIT_FAILURE); } /* Parent. Just die here. */ else { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 7f59be470929f4cf51d8a6ca0446e8fbe75100cd Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 20:37:43 2015 +0100 x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. --- debian/changelog | 2 ++ src/x2goclient.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1cace3b..6106d1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,6 +34,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium in the child process. Use fork_helper() to start the UNIX cleanup helper in a child process and continue with the main application in the parent. - x2goclient.cpp: add myself to copyright header. + - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating + systems. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 44c41d3..1e92536 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -17,6 +17,7 @@ ***************************************************************************/ #include <iostream> +#include <sys/types.h> #include <unistd.h> #include <cstring> #include <cerrno> -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 60be5170439eb72d34fdb81d4163624a0b7f428e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:13:05 2015 +0100 unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. --- debian/changelog | 2 ++ src/unixhelper.cpp | 5 ++++- src/unixhelper.h | 9 ++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7886d8d..788864b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -37,6 +37,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.cpp: add legacy <sys/types.h> header needed for old operating systems. - x2goclient.cpp: fix std::edit -> std::exit typo. + - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX + defined on UNIX-based platforms. Move guards around. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 545c2c1..b326f35 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -17,6 +17,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +/* Necessary for Q_OS_UNIX! */ + +#include "unixhelper.h" + #ifdef Q_OS_UNIX #include <csignal> @@ -26,7 +30,6 @@ #include <cerrno> #include <cstdlib> -#include "unixhelper.h" void unixhelper::kill_pgroup (int signal) { if (SIGHUP == signal) { diff --git a/src/unixhelper.h b/src/unixhelper.h index fab611e..27cb735 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -17,11 +17,14 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifdef Q_OS_UNIX #ifndef UNIXHELPER_H #define UNIXHELPER_H +#include <QtCore/qglobal.h> + +#ifdef Q_OS_UNIX + class unixhelper { public: unixhelper () {} @@ -33,6 +36,6 @@ class unixhelper { void kill_pgroup (int signal); }; -#endif /* !defined (UNIXHELPER_H) */ - #endif /* defined (Q_OS_UNIX) */ + +#endif /* !defined (UNIXHELPER_H) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e9df0f4170a63ca8df260af2cc03712cc4f5c912 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:17:49 2015 +0100 unixhelper.h: forgot to declare type of unix_cleanup() function. --- debian/changelog | 1 + src/unixhelper.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 788864b..73d6e4a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -39,6 +39,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.cpp: fix std::edit -> std::exit typo. - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. + - unixhelper.h: forgot to declare type of unix_cleanup() function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.h b/src/unixhelper.h index 27cb735..9069b5d 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -29,7 +29,7 @@ class unixhelper { public: unixhelper () {} ~unixhelper () {} - unix_cleanup (); + int unix_cleanup (); private: unixhelper (const unixhelper &other); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b7a246740ccb1cfd59b13c08f58f87bc5f161d3d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 21:38:10 2015 +0100 unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. --- debian/changelog | 2 ++ src/unixhelper.cpp | 43 ++++++++++++++++++++++--------------------- src/unixhelper.h | 14 ++++---------- src/x2goclient.cpp | 3 +-- 4 files changed, 29 insertions(+), 33 deletions(-) diff --git a/debian/changelog b/debian/changelog index 73d6e4a..d906b81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,6 +40,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - unixhelper.{h,cpp}: also include <QtCore/qglobal.h> to have Q_OS_UNIX defined on UNIX-based platforms. Move guards around. - unixhelper.h: forgot to declare type of unix_cleanup() function. + - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a + (module) namespace, not a class. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index b326f35..b0729c6 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,34 +30,35 @@ #include <cerrno> #include <cstdlib> +namespace unixhelper { + void kill_pgroup (int signal) { + if (SIGHUP == signal) { + /* Try to kill via SIGTERM first. */ + if (0 != killpg (getpgrp (), SIGTERM)) { + std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; + } -void unixhelper::kill_pgroup (int signal) { - if (SIGHUP == signal) { - /* Try to kill via SIGTERM first. */ - if (0 != killpg (getpgrp (), SIGTERM)) { - std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; - } - - /* Grant a grace period of (at least) 5 seconds. */ - sleep (5); + /* Grant a grace period of (at least) 5 seconds. */ + sleep (5); - /* Don't handle any errors here, because we die anyway. */ - killpg (getpgrp (), SIGKILL); + /* Don't handle any errors here, because we die anyway. */ + killpg (getpgrp (), SIGKILL); + } } -} -int unixhelper::unix_cleanup () { - if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - std::exit (1); - } + int unix_cleanup () { + if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + std::exit (1); + } - std::signal (SIGHUP, kill_pgroup); + std::signal (SIGHUP, kill_pgroup); - /* Sleep forever... at least one second in each run. */ - for (;;) { - sleep (1); + /* Sleep forever... at least one second in each run. */ + for (;;) { + sleep (1); + } } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 9069b5d..fe86017 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -25,16 +25,10 @@ #ifdef Q_OS_UNIX -class unixhelper { - public: - unixhelper () {} - ~unixhelper () {} - int unix_cleanup (); - - private: - unixhelper (const unixhelper &other); - void kill_pgroup (int signal); -}; +namespace unixhelper { + int unix_cleanup (); + void kill_pgroup (int signal); +} #endif /* defined (Q_OS_UNIX) */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index f495796..7eb6511 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -38,8 +38,7 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - unixhelper cleanup_helper (); - cleanup_helper.unix_cleanup (); + unixhelper::unix_cleanup (); } /* Error. */ else if (-1 == tmp_pid) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6c5b96672b6c7722ddca87534c63ae617ce90e31 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:04:19 2015 +0100 unixhelper.{cpp,h}: add documentation/comments. --- debian/changelog | 1 + src/unixhelper.cpp | 4 ++++ src/unixhelper.h | 24 ++++++++++++++++++++++++ src/x2goclient.cpp | 2 ++ 4 files changed, 31 insertions(+) diff --git a/debian/changelog b/debian/changelog index d906b81..5960db3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -42,6 +42,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - unixhelper.h: forgot to declare type of unix_cleanup() function. - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. + - unixhelper.{cpp,h}: add documentation/comments. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index b0729c6..2ad0740 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -30,6 +30,8 @@ #include <cerrno> #include <cstdlib> +/* For documentation please see unixhelper.h. */ + namespace unixhelper { void kill_pgroup (int signal) { if (SIGHUP == signal) { @@ -51,6 +53,8 @@ namespace unixhelper { if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; std::exit (1); + + /* Anything here shall be unreachable. */ } std::signal (SIGHUP, kill_pgroup); diff --git a/src/unixhelper.h b/src/unixhelper.h index fe86017..a00d21b 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -26,7 +26,31 @@ #ifdef Q_OS_UNIX namespace unixhelper { + /* + * TODO: Unblocks all signals and + * installs a signal handler for SIGHUP, which calls kill_pgroup. + * + * TODO: Should signal unblocking or + * installing the signal handler fail, an emergency exit is performed + * and the whole process group killed. + * + * Loops indefinitely afterwards. + */ int unix_cleanup (); + + /* + * Kills the whole process group. + * First, SIGTERM is sent to the group. + * A 5 seconds grace period is granted to make sure + * processes exit cleanly on their own. + * Lastly, SIGKILL is sent to the group -- which also + * implies the demise of this program. + * + * signal may be any of: + * * -1 to indicate an error leading to emergency termination + * * SIGHUP as the standard signal that is sent when the + * group leeader dies + */ void kill_pgroup (int signal); } diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 7eb6511..e7ec69b 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -39,6 +39,8 @@ int fork_helper (int argc, char **argv) { if (0 == tmp_pid) { /* Starting unixhelper. */ unixhelper::unix_cleanup (); + + /* Anything here shall be unreachable. */ } /* Error. */ else if (-1 == tmp_pid) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 48599b7371b8f2b5fc238e7a3fb31cb82a586230 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:15:58 2015 +0100 unixhelper.cpp: kill process group on error. --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index 398b0bd..686e8a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -44,6 +44,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium (module) namespace, not a class. - unixhelper.{cpp,h}: add documentation/comments. - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). + - unixhelper.cpp: kill process group on error. [ Mike DePaulo ] * New upstream release (4.0.5.2): -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ef137a525a2738bb08b0775c6d11136008a7fc19 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:42:14 2015 +0100 unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. --- debian/changelog | 2 ++ src/unixhelper.cpp | 20 ++++++++++++++++++++ src/unixhelper.h | 10 +++++----- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 686e8a0..af77e13 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,6 +45,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - unixhelper.{cpp,h}: add documentation/comments. - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). - unixhelper.cpp: kill process group on error. + - unixhelper.{cpp,h}: implement signal unblocking in + unixhelper::unix_cleanup(). Update documentation. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2ad0740..f2cc11c 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -50,6 +50,26 @@ namespace unixhelper { int unix_cleanup () { + /* + * Unblock all signals first. + * Signal blocks are inherited, so you never you what is currently set. + */ + sigset_t empty_set; + if (0 != sigemptyset (&empty_set)) { + std::cerr << "Unable to fetch empty signal set: " << std::strerror (errno) << std::endl; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } + + if (0 != sigprocmask (SIG_SETMASK, &empty_set, NULL)) { + std::cerr << "Unable to set empty signal set: " << std::strerror (errno) << std::endl; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } + + /* Set up signal handler to ignore SIGTERM. */ if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; std::exit (1); diff --git a/src/unixhelper.h b/src/unixhelper.h index a00d21b..7ca8b43 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -27,12 +27,12 @@ namespace unixhelper { /* - * TODO: Unblocks all signals and - * installs a signal handler for SIGHUP, which calls kill_pgroup. + * Unblocks all signals and installs a signal handler for SIGHUP, + * which calls kill_pgroup. * - * TODO: Should signal unblocking or - * installing the signal handler fail, an emergency exit is performed - * and the whole process group killed. + * Should signal unblocking or installing the signal handler fail, + * an emergency exit is performed and + * the whole process group killed. * * Loops indefinitely afterwards. */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 8afb4daf9424e51fb65a5727dbd1ffe98d083890 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:14:46 2015 +0100 x2goclient.cpp: return return value of unixhelper::unix_cleanup(). --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5960db3..398b0bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -43,6 +43,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - {unixhelper.{cpp,h},x2goclient.cpp}: unixhelper should really be a (module) namespace, not a class. - unixhelper.{cpp,h}: add documentation/comments. + - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index e7ec69b..be070d8 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -38,7 +38,7 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - unixhelper::unix_cleanup (); + return (unixhelper::unix_cleanup ()); /* Anything here shall be unreachable. */ } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 7a4364139174218b8bfde77f322cd9c738788a8e Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 23:41:12 2015 +0100 x2goclient.cpp: clean up. We don't care if setsid() fails or succeeds and we certainly do not need to fork to force it to succeed. Whether we are a process group leader already or become one doesn't matter, if the end result is that we are process group leader. --- debian/changelog | 4 ++++ src/x2goclient.cpp | 42 ++++++++---------------------------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/debian/changelog b/debian/changelog index e92d3d8..c6beb42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -48,6 +48,10 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. - unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. + - x2goclient.cpp: clean up. We don't care if setsid() fails or succeeds + and we certainly do not need to fork to force it to succeed. Whether we + are a process group leader already or become one doesn't matter, if the + end result is that we are process group leader. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index be070d8..ad613fb 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -59,41 +59,15 @@ int fork_helper (int argc, char **argv) { int main (int argc, char **argv) { #ifdef Q_OS_UNIX - if (-1 == setsid ()) { - std::cerr << "Unable to create a new process session: " << std::strerror (errno) << "\n"; + /* + * setsid() may succeed and we become a session and process + * group leader, or it may fail indicating that we already + * are a process group leader. Either way is fine. + */ + setsid (); - std::cerr << "Trying to fork." << std::endl; - pid_t tmp_pid = fork (); - - /* Child. */ - if (0 == tmp_pid) { - /* Trying to get a new session and become session + process group leader again. */ - if (-1 == setsid ()) { - std::cerr << "Child was unable to create a new process session: " << std::strerror (errno) << "\n"; - std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; - - std::exit (EXIT_FAILURE); - } - - /* By now, we should be session and group leader. */ - return (fork_helper (argc, argv)); - } - /* Error. */ - else if (-1 == tmp_pid) { - std::cerr << "Error while forking: " << std::strerror (errno) << std::endl; - std::cerr << "Terminating. Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; - - std::exit (EXIT_FAILURE); - } - /* Parent. Just die here. */ - else { - std::exit (EXIT_SUCCESS); - } - } - else { - /* setsid() worked. Starting helper and main program. */ - return (fork_helper (argc, argv)); - } + /* We should be process group leader by now. */ + return (fork_helper (argc, argv)); #else /* defined (Q_OS_UNIX) */ return (wrap_x2go_main (argc, argv)); #endif /* defined (Q_OS_UNIX) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2bc57210a98409cc7e239c9aaee30d90abec69e0 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 23:08:13 2015 +0100 unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. --- debian/changelog | 1 + src/unixhelper.cpp | 33 ++++++++++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index af77e13..e92d3d8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -47,6 +47,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - unixhelper.cpp: kill process group on error. - unixhelper.{cpp,h}: implement signal unblocking in unixhelper::unix_cleanup(). Update documentation. + - unixhelper.cpp: port from std::signal() to sigaction(). Handle errors. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index f2cc11c..fdcaac9 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -69,15 +69,34 @@ namespace unixhelper { /* Anything here shall be unreachable. */ } - /* Set up signal handler to ignore SIGTERM. */ - if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - std::exit (1); - - /* Anything here shall be unreachable. */ + { + struct sigaction sig_action; + sig_action.sa_handler = SIG_IGN; + sig_action.sa_mask = empty_set; + sig_action.sa_flags = SA_RESTART; + + /* Set up signal handler to ignore SIGTERM. */ + if (0 != sigaction (SIGTERM, &sig_action, NULL)) { + std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } } - std::signal (SIGHUP, kill_pgroup); + { + struct sigaction sig_action; + sig_action.sa_handler = kill_pgroup; + sig_action.sa_mask = empty_set; + sig_action.sa_flags = SA_RESTART; + + if (0 != sigaction (SIGHUP, &sig_action, NULL)) { + std::cerr << "Unable to set up signal handler for SIGHUP: " << std::strerror (errno) << std::endl; + kill_pgroup (-1); + + /* Anything here shall be unreachable. */ + } + } /* Sleep forever... at least one second in each run. */ for (;;) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 3052b8d1ba848ad2e7dafac82c91facbadaccd96 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 01:04:33 2015 +0100 x2goclient.cpp: don't start the UNIX cleanup helper process right after forking. Introduce a new command line option --unixhelper and re-execute the main binary with this new option to indicate that the UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. --- debian/changelog | 5 ++++ src/x2goclient.cpp | 65 ++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index c6beb42..72c8cdc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -52,6 +52,11 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium and we certainly do not need to fork to force it to succeed. Whether we are a process group leader already or become one doesn't matter, if the end result is that we are process group leader. + - x2goclient.cpp: don't start the UNIX cleanup helper process right after + forking, but introduce a new command line option --unixhelper and + re-execute the main binary with this new option to indicate that the + UNIX cleanup helper tool is requested. It is necessary to call exec() + after fork on virtually all operating system, especially on OS X. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index ad613fb..3f11d55 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -22,6 +22,10 @@ #include <cstring> #include <cerrno> #include <cstdlib> +#include <string> +#include <algorithm> +#include <cctype> +#include <vector> #include "unixhelper.h" #include "ongetpass.h" @@ -38,7 +42,28 @@ int fork_helper (int argc, char **argv) { /* Child. */ if (0 == tmp_pid) { /* Starting unixhelper. */ - return (unixhelper::unix_cleanup ()); + std::vector<std::string> new_argv; + new_argv.push (std::string (argv[0])); + new_argv.push ("--unixhelper"); + + std::vector<const char *> new_argv_c_str; + for (const_iterator it = new_argv.begin (); it != new_argv.end (); ++it) { + new_argv_c_str.push ((*it).c_str ()); + } + new_argv_c_str.push (""); + + if (0 != execv (new_argv_c_str.data (), new_argv_c_str.data ())) { + std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" + << "Terminating and killing parent." << "\n" + << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + + pid_t parent_pid = getppid (); + if (0 != kill (parent_pid, SIGTERM)) { + std::cerr << "Failed to kill parent process: " << std::strerror (errno) << std::endl; + } + + std::exit (EXIT_FAILURE); + } /* Anything here shall be unreachable. */ } @@ -59,15 +84,35 @@ int fork_helper (int argc, char **argv) { int main (int argc, char **argv) { #ifdef Q_OS_UNIX - /* - * setsid() may succeed and we become a session and process - * group leader, or it may fail indicating that we already - * are a process group leader. Either way is fine. - */ - setsid (); - - /* We should be process group leader by now. */ - return (fork_helper (argc, argv)); + /* Scan program arguments for --unixhelper flag. */ + bool unix_helper_request = 0; + for (int i = 0; i < argc; ++i) { + std::string cur_arg (argv[i]); + + /* Make the current argument lowercase. */ + std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), std::tolower); + + if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { + unix_helper_request = 1; + break; + } + } + + if (unix_helper_request) { + /* We were instructed to start as the UNIX cleanup helper tool. */ + return (unixhelper::unix_cleanup ()); + } + else { + /* + * setsid() may succeed and we become a session and process + * group leader, or it may fail indicating that we already + * are a process group leader. Either way is fine. + */ + setsid (); + + /* We should be process group leader by now. */ + return (fork_helper (argc, argv)); + } #else /* defined (Q_OS_UNIX) */ return (wrap_x2go_main (argc, argv)); #endif /* defined (Q_OS_UNIX) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 1107cd66aea472ca3e189db124cdc4e7d9d0f303 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 03:06:15 2015 +0100 x2goclient.cpp: fix compile problems introduced with the last commit. --- debian/changelog | 1 + src/x2goclient.cpp | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 72c8cdc..0c245f5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -57,6 +57,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium re-execute the main binary with this new option to indicate that the UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. + - x2goclient.cpp: fix compile problems introduced with the last commit. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 3f11d55..895db0d 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -26,6 +26,7 @@ #include <algorithm> #include <cctype> #include <vector> +#include <csignal> #include "unixhelper.h" #include "ongetpass.h" @@ -43,16 +44,23 @@ int fork_helper (int argc, char **argv) { if (0 == tmp_pid) { /* Starting unixhelper. */ std::vector<std::string> new_argv; - new_argv.push (std::string (argv[0])); - new_argv.push ("--unixhelper"); + new_argv.push_back (std::string (argv[0])); + new_argv.push_back ("--unixhelper"); - std::vector<const char *> new_argv_c_str; - for (const_iterator it = new_argv.begin (); it != new_argv.end (); ++it) { - new_argv_c_str.push ((*it).c_str ()); + std::vector<char *> new_argv_c_str; + for (std::vector<std::string>::iterator it = new_argv.begin (); it != new_argv.end (); ++it) { + const char *elem = (*it).c_str (); + new_argv_c_str.push_back (strndup (elem, std::strlen (elem))); } - new_argv_c_str.push (""); - if (0 != execv (new_argv_c_str.data (), new_argv_c_str.data ())) { + /* Add null pointer as last element. */ + { + std::vector<char> tmp; + tmp.push_back (0); + new_argv_c_str.push_back (&tmp.front ()); + } + + if (0 != execv (new_argv_c_str.front (), &(new_argv_c_str.front ()))) { std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; @@ -66,6 +74,7 @@ int fork_helper (int argc, char **argv) { } /* Anything here shall be unreachable. */ + return (0); } /* Error. */ else if (-1 == tmp_pid) { @@ -90,7 +99,7 @@ int main (int argc, char **argv) { std::string cur_arg (argv[i]); /* Make the current argument lowercase. */ - std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), std::tolower); + std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), ::tolower); if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { unix_helper_request = 1; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 49b9264aa3fd3389ef8f3315dcb653cca0a83ab7 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 04:39:43 2015 +0100 x2goclient.cpp: fix string comparison. --- debian/changelog | 1 + src/x2goclient.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0c245f5..c2ef36d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -58,6 +58,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium UNIX cleanup helper tool is requested. It is necessary to call exec() after fork on virtually all operating system, especially on OS X. - x2goclient.cpp: fix compile problems introduced with the last commit. + - x2goclient.cpp: fix string comparison. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 895db0d..eee541f 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -101,7 +101,7 @@ int main (int argc, char **argv) { /* Make the current argument lowercase. */ std::transform (cur_arg.begin (), cur_arg.end (), cur_arg.begin (), ::tolower); - if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper"))) { + if ((!cur_arg.empty ()) && (cur_arg.compare ("--unixhelper") == 0)) { unix_helper_request = 1; break; } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 466e22900613a288715140dc3efc0aa419586816 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 05:51:03 2015 +0100 x2goclient.cpp: create new argv array on the heap instead of on the stack. Stack data will be invalid once the function goes out of scope (which is what execv is doing.) --- debian/changelog | 3 +++ src/x2goclient.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index c2ef36d..419db63 100644 --- a/debian/changelog +++ b/debian/changelog @@ -59,6 +59,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium after fork on virtually all operating system, especially on OS X. - x2goclient.cpp: fix compile problems introduced with the last commit. - x2goclient.cpp: fix string comparison. + - x2goclient.cpp: create new argv array on the heap instead of on the + stack. Stack data will be invalid once the function goes out of scope + (which is what execv is doing.) [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index eee541f..c8df342 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -47,20 +47,20 @@ int fork_helper (int argc, char **argv) { new_argv.push_back (std::string (argv[0])); new_argv.push_back ("--unixhelper"); - std::vector<char *> new_argv_c_str; + std::vector<char *> *new_argv_c_str = new (std::vector<char *>) (); for (std::vector<std::string>::iterator it = new_argv.begin (); it != new_argv.end (); ++it) { const char *elem = (*it).c_str (); - new_argv_c_str.push_back (strndup (elem, std::strlen (elem))); + new_argv_c_str->push_back (strndup (elem, std::strlen (elem))); } /* Add null pointer as last element. */ { - std::vector<char> tmp; - tmp.push_back (0); - new_argv_c_str.push_back (&tmp.front ()); + std::vector<char> *tmp = new (std::vector<char>) (); + tmp->push_back (0); + new_argv_c_str->push_back (&tmp->front ()); } - if (0 != execv (new_argv_c_str.front (), &(new_argv_c_str.front ()))) { + if (0 != execv (new_argv_c_str->front (), &(new_argv_c_str->front ()))) { std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" << "Terminating and killing parent." << "\n" << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 8f1295fe8b1255620e448b758951ed720acd684f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 21:08:46 2015 +0100 unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. --- debian/changelog | 2 ++ src/unixhelper.cpp | 8 ++++---- src/unixhelper.h | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 419db63..c03b2cd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -62,6 +62,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.cpp: create new argv array on the heap instead of on the stack. Stack data will be invalid once the function goes out of scope (which is what execv is doing.) + - unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period + to 10 seconds. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index fdcaac9..d4698df 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -40,8 +40,8 @@ namespace unixhelper { std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; } - /* Grant a grace period of (at least) 5 seconds. */ - sleep (5); + /* Grant a grace period of (at least) 10 seconds. */ + sleep (10); /* Don't handle any errors here, because we die anyway. */ killpg (getpgrp (), SIGKILL); @@ -98,9 +98,9 @@ namespace unixhelper { } } - /* Sleep forever... at least one second in each run. */ + /* Sleep forever... at least two seconds in each run. */ for (;;) { - sleep (1); + sleep (2); } } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 7ca8b43..9f213a8 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -28,7 +28,7 @@ namespace unixhelper { /* * Unblocks all signals and installs a signal handler for SIGHUP, - * which calls kill_pgroup. + * which calls kill_pgroup(). * * Should signal unblocking or installing the signal handler fail, * an emergency exit is performed and @@ -41,7 +41,7 @@ namespace unixhelper { /* * Kills the whole process group. * First, SIGTERM is sent to the group. - * A 5 seconds grace period is granted to make sure + * A 10 seconds grace period is granted to make sure * processes exit cleanly on their own. * Lastly, SIGKILL is sent to the group -- which also * implies the demise of this program. -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0c5dbd35af0cc061af35456b4a927a18be3011ba Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 21:15:08 2015 +0100 {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. --- debian/changelog | 2 ++ src/unixhelper.cpp | 9 ++++++++- src/unixhelper.h | 11 +++++++++-- src/x2goclient.cpp | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index c03b2cd..b3b8c11 100644 --- a/debian/changelog +++ b/debian/changelog @@ -64,6 +64,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium (which is what execv is doing.) - unixhelper.{cpp,h}: raise sleeping time to two seconds and grace period to 10 seconds. + - {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to + parent PID polling. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index d4698df..410c320 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -49,7 +49,7 @@ namespace unixhelper { } - int unix_cleanup () { + int unix_cleanup (const pid_t parent) { /* * Unblock all signals first. * Signal blocks are inherited, so you never you what is currently set. @@ -100,6 +100,13 @@ namespace unixhelper { /* Sleep forever... at least two seconds in each run. */ for (;;) { + pid_t cur_ppid = getppid (); + + /* cur_ppid should match parent, otherwise the parent died. */ + if (cur_ppid != parent) { + kill_pgroup (SIGHUP); + } + sleep (2); } } diff --git a/src/unixhelper.h b/src/unixhelper.h index 9f213a8..7511d4d 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -22,6 +22,7 @@ #define UNIXHELPER_H #include <QtCore/qglobal.h> +#include <unistd.h> #ifdef Q_OS_UNIX @@ -35,8 +36,12 @@ namespace unixhelper { * the whole process group killed. * * Loops indefinitely afterwards. + * + * In this loop, the current parent PID is polled and compared against + * the original value passed via parameter parent. + * Should they mismatch, the parent died and kill_pgroup() is called. */ - int unix_cleanup (); + int unix_cleanup (const pid_t parent); /* * Kills the whole process group. @@ -49,7 +54,9 @@ namespace unixhelper { * signal may be any of: * * -1 to indicate an error leading to emergency termination * * SIGHUP as the standard signal that is sent when the - * group leeader dies + * group leader dies under specific circumstances + * (we cannot rely that this always happens, though, + * so a polling solution is needed, see unix_cleanup().) */ void kill_pgroup (int signal); } diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index c8df342..2c334e1 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -109,7 +109,7 @@ int main (int argc, char **argv) { if (unix_helper_request) { /* We were instructed to start as the UNIX cleanup helper tool. */ - return (unixhelper::unix_cleanup ()); + return (unixhelper::unix_cleanup (getppid ())); } else { /* -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 957e1e12e178c59f23aa8ff2d17f2210371a19b3 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Mar 18 22:22:27 2015 +0100 unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. --- debian/changelog | 2 ++ src/unixhelper.cpp | 18 +++++++++++++----- src/unixhelper.h | 3 +++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index b3b8c11..59e46ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -66,6 +66,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium to 10 seconds. - {unixhelper.{cpp,h},x2goclient.cpp}: switch main cleanup handling to parent PID polling. + - unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 + and SIGUSR2. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 410c320..acdee33 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -28,7 +28,7 @@ #include <iostream> #include <cstring> #include <cerrno> -#include <cstdlib> +#include <vector> /* For documentation please see unixhelper.h. */ @@ -69,15 +69,23 @@ namespace unixhelper { /* Anything here shall be unreachable. */ } - { + std::vector<int> ignore_signals; + ignore_signals.push_back (SIGINT); + ignore_signals.push_back (SIGTERM); + ignore_signals.push_back (SIGPIPE); + ignore_signals.push_back (SIGQUIT); + ignore_signals.push_back (SIGUSR1); + ignore_signals.push_back (SIGUSR2); + + for (std::vector<int>::iterator it = ignore_signals.begin (); it != ignore_signals.end (); ++it) { struct sigaction sig_action; sig_action.sa_handler = SIG_IGN; sig_action.sa_mask = empty_set; sig_action.sa_flags = SA_RESTART; - /* Set up signal handler to ignore SIGTERM. */ - if (0 != sigaction (SIGTERM, &sig_action, NULL)) { - std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; + /* Set up signal handler to ignore the current signal. */ + if (0 != sigaction (*it, &sig_action, NULL)) { + std::cerr << "Unable to ignore signal " << strsignal (*it) << ": " << std::strerror (errno) << std::endl; kill_pgroup (-1); /* Anything here shall be unreachable. */ diff --git a/src/unixhelper.h b/src/unixhelper.h index 7511d4d..a34456e 100644 --- a/src/unixhelper.h +++ b/src/unixhelper.h @@ -35,6 +35,9 @@ namespace unixhelper { * an emergency exit is performed and * the whole process group killed. * + * The signals SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and + * SIGUSR2 are ignored. + * * Loops indefinitely afterwards. * * In this loop, the current parent PID is polled and compared against -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5e376ba60202637e704f2d4829bfa8c60db984b5 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Mar 20 04:02:06 2015 +0100 x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. --- debian/changelog | 2 ++ src/x2goclient.cpp | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 59e46ad..7649b07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -68,6 +68,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium parent PID polling. - unixhelper.{cpp,h}: ignore SIGINT, SIGTERM, SIGPIPE, SIGQUIT, SIGUSR1 and SIGUSR2. + - x2goclient.cpp: fix failing exec() call for the UNIX helper utility: + correctly terminate arguments vector. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index 2c334e1..df53ba1 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -54,11 +54,7 @@ int fork_helper (int argc, char **argv) { } /* Add null pointer as last element. */ - { - std::vector<char> *tmp = new (std::vector<char>) (); - tmp->push_back (0); - new_argv_c_str->push_back (&tmp->front ()); - } + new_argv_c_str->push_back (0); if (0 != execv (new_argv_c_str->front (), &(new_argv_c_str->front ()))) { std::cerr << "Failed to re-execute process as UNIX cleanup helper tool: " << std::strerror (errno) << "\n" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e4206ac5884f9bf740050fe29db36082d12f74b2 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 00:00:59 2015 +0100 {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. --- debian/changelog | 2 ++ src/appdialog.cpp | 22 ++++++++++++---------- src/configwidget.cpp | 6 ++---- src/onmainwindow.cpp | 5 ++++- src/unixhelper.cpp | 7 +++++++ 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7649b07..e3e18a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -70,6 +70,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium and SIGUSR2. - x2goclient.cpp: fix failing exec() call for the UNIX helper utility: correctly terminate arguments vector. + - {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile + warnings with GCC. Fix a few whitespace issues. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index 4b25ee9..327ffdc 100644 --- a/src/appdialog.cpp +++ b/src/appdialog.cpp @@ -156,16 +156,18 @@ void AppDialog::loadApps() break; } - QTreeWidgetItem* it; - if (app.category==Application::TOP) - it=new QTreeWidgetItem(treeWidget); - else - it=new QTreeWidgetItem(parent); - it->setText(0, app.name); - it->setToolTip(0,app.comment); - it->setIcon(0,app.icon); - it->setData(0, Qt::UserRole, app.exec); - it->setData(0, Qt::UserRole+1, app.comment); + if (parent) { + QTreeWidgetItem* it; + if (app.category==Application::TOP) + it=new QTreeWidgetItem(treeWidget); + else + it=new QTreeWidgetItem(parent); + it->setText(0, app.name); + it->setToolTip(0,app.comment); + it->setIcon(0,app.icon); + it->setData(0, Qt::UserRole, app.exec); + it->setData(0, Qt::UserRole+1, app.comment); + } } treeWidget->sortItems(0,Qt::AscendingOrder); } diff --git a/src/configwidget.cpp b/src/configwidget.cpp index d0f67ba..c450e48 100644 --- a/src/configwidget.cpp +++ b/src/configwidget.cpp @@ -24,8 +24,8 @@ ConfigWidget::ConfigWidget ( QString id, ONMainWindow * mw, { sessionId=id; mainWindow=mw; - miniMode=mw->retMiniMode(); - embedMode=embedMode= mw->getEmbedMode(); + miniMode=mw->retMiniMode(); + embedMode = mw->getEmbedMode(); if(embedMode) sessionId="embedded"; } @@ -34,5 +34,3 @@ ConfigWidget::ConfigWidget ( QString id, ONMainWindow * mw, ConfigWidget::~ConfigWidget() { } - - diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index 925085b..e7b1c70 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -4295,8 +4295,10 @@ void ONMainWindow::resumeSession ( const x2goSession& s ) if (! startXorgOnStart) startXOrg(); // #endif +#else /* defined (Q_OS_WIN) */ + UNUSED (rootless); +#endif /* defined (Q_OS_WIN) */ -#endif if ( fullscreen ) { geometry="fullscreen"; @@ -10887,6 +10889,7 @@ void ONMainWindow::slotEmbedIntoParentWindow() void ONMainWindow::processSessionConfig() { bool haveKey=false; + UNUSED (haveKey); config.command="KDE"; config.brokerNoAuth=false; diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index acdee33..d5aa67d 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -29,6 +29,7 @@ #include <cstring> #include <cerrno> #include <vector> +#include <cstdlib> /* For documentation please see unixhelper.h. */ @@ -117,6 +118,12 @@ namespace unixhelper { sleep (2); } + + /* + * Anything here shall be unreachable. + * But make compilers happy by returning something. + */ + return (EXIT_SUCCESS); } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 4a26eb163ce449d583cdceacca3d2cc7ed13eed0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 00:04:44 2015 +0100 appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. --- debian/changelog | 2 ++ src/appdialog.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index e3e18a4..858c381 100644 --- a/debian/changelog +++ b/debian/changelog @@ -72,6 +72,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium correctly terminate arguments vector. - {appdialog,configwidget,onmainwindow,unixhelper}.cpp: fix some compile warnings with GCC. Fix a few whitespace issues. + - appdialog.cpp: initialize parent in default case. Another GCC compile + warning fix. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/appdialog.cpp b/src/appdialog.cpp index 327ffdc..f41361c 100644 --- a/src/appdialog.cpp +++ b/src/appdialog.cpp @@ -153,6 +153,7 @@ void AppDialog::loadApps() parent=other; break; default: + parent = NULL; break; } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit f660a1b111042ec7e21666a86d0cdd06adf8bad7 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 03:58:18 2015 +0100 onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when starting sshd in user mode. Put the authorized_keys file in there. Check and set correct permissions for both the directory and authorized_keys file. Generalize some Windows-specific sections by using QDir and QFile. --- debian/changelog | 4 ++ src/onmainwindow.cpp | 183 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 126 insertions(+), 61 deletions(-) diff --git a/debian/changelog b/debian/changelog index 858c381..97fc2d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -74,6 +74,10 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium warnings with GCC. Fix a few whitespace issues. - appdialog.cpp: initialize parent in default case. Another GCC compile warning fix. + - onmainwindow.cpp: correctly use ~/.x2go/.ssh as ssh directory when + starting sshd in user mode. Put the authorized_keys file in there. Check + and set correct permissions for both the directory and authorized_keys + file. Generalize some Windows-specific sections by using QDir and QFile. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/onmainwindow.cpp b/src/onmainwindow.cpp index e7b1c70..724eefa 100644 --- a/src/onmainwindow.cpp +++ b/src/onmainwindow.cpp @@ -8196,43 +8196,54 @@ void ONMainWindow::slotRetExportDir ( bool result,QString output, QByteArray line = file.readLine(); file.close(); - QString authofname=homeDir; -#ifdef Q_OS_WIN - QDir dir; - dir.mkpath ( authofname+"\\.x2go\\.ssh" ); - x2goDebug<<"Creating "<<authofname+"\\.x2go\\.ssh"; + QDir authorized_keys_dir (homeDir); - authofname=wapiShortFileName ( authofname ) +"/.x2go"; -#endif - authofname+="/.ssh/authorized_keys" ; - file.setFileName ( authofname ); - if ( !file.open ( QIODevice::ReadOnly | QIODevice::Text ) ) - { - printSshDError_noAuthorizedKeysFile(); - QFile::remove - ( key+".pub" ); - return; + /* + * Do the user SSHD/global SSHD dance here and either use the + * private .x2go/.ssh or the global .ssh dir. + */ + if (userSshd) { + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/"); } + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.ssh/"); + QFile authorized_keys_file (authorized_keys_dir.absolutePath () + "/authorized_keys"); + + /* + * We do not try to create the file first. + * This has been already done in startX2goMount(). + * We wouldn't be here if that failed. + */ + if (!authorized_keys_file.open (QIODevice::ReadOnly | QIODevice::Text)) { + printSshDError_noAuthorizedKeysFile (); + QFile::remove (key + ".pub"); + return; + } - QTemporaryFile tfile ( authofname ); - tfile.open(); - tfile.setAutoRemove ( true ); - QTextStream out ( &tfile ); + QTemporaryFile tfile (authorized_keys_file.fileName ()); + tfile.open (); + tfile.setPermissions (QFile::ReadOwner | QFile::WriteOwner); + tfile.setAutoRemove (true); + QTextStream out (&tfile); - while ( !file.atEnd() ) - { - QByteArray newline = file.readLine(); - if ( newline!=line ) - out<<newline; + /* + * Copy the content of the authorized_keys file to our new temporary file + * and remove the public authorized key for the current "session" again. + */ + while (!authorized_keys_file.atEnd ()) { + QByteArray newline = authorized_keys_file.readLine (); + if (newline != line) + out << newline; } - file.close(); - tfile.close(); - file.remove(); - tfile.copy ( authofname ); - QFile::remove - ( key+".pub" ); + + authorized_keys_file.close (); + tfile.close (); + + authorized_keys_file.remove (); + + tfile.copy (authorized_keys_file.fileName ()); + QFile::remove (key + ".pub"); } @@ -9460,41 +9471,90 @@ void ONMainWindow::startX2goMount() QByteArray line = file.readLine(); file.close(); - QString authofname=homeDir; -#ifdef Q_OS_WIN - QDir tdir; - tdir.mkpath ( authofname+"\\.x2go\\.ssh" ); - x2goDebug<<"Creating "<<authofname+"\\.x2go\\.ssh"; + QDir authorized_keys_dir (homeDir); - authofname=wapiShortFileName ( authofname ) +"/.x2go"; -#endif - authofname+= "/.ssh/authorized_keys" ; + /* + * Do the user SSHD/global SSHD dance here and either use the + * private .x2go/.ssh or the global .ssh dir. + */ + if (userSshd) { + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.x2go/"); + } - QFile file1 ( authofname ); + authorized_keys_dir = QDir (authorized_keys_dir.absolutePath () + "/.ssh/"); + QFile authorized_keys_file (authorized_keys_dir.absolutePath () + "/authorized_keys"); - if ( !file1.open ( QIODevice::WriteOnly | QIODevice::Text | - QIODevice::Append ) ) - { - QString message=tr ( "Unable to write:\n" ) + authofname; - QMessageBox::critical ( 0l,tr ( "Error" ),message, - QMessageBox::Ok, - QMessageBox::NoButton ); - QFile::remove - ( fsExportKey+".pub" ); - return; + if (userSshd) { + x2goDebug << "Creating dir " << authorized_keys_dir.absolutePath (); + authorized_keys_dir.mkpath (authorized_keys_dir.absolutePath ()); + } + x2goDebug << "Potentially creating file " << authorized_keys_file.fileName (); + if (!authorized_keys_file.open (QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) { + QString message = tr ("Unable to create or append to file: ") + authorized_keys_file.fileName (); + QMessageBox::critical (0l, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + QFile::remove (fsExportKey + ".pub"); + return; } - directory* dir=getExpDir ( fsExportKey ); - bool rem=dir->isRemovable; - if ( !dir ) - return; - QTextStream out ( &file1 ); - out<<line; - file1.close(); +#ifdef Q_OS_UNIX + QFile::Permissions authorized_keys_file_perm = authorized_keys_file.permissions (); + QFile::Permissions authorized_keys_file_target_perm = QFile::ReadOwner | QFile::WriteOwner; + + bool permission_error = false; + + /* + * Try to set the permissions if they are wrong. + * (sshd would disallow such a file.) + */ + if (authorized_keys_file_perm != authorized_keys_file_target_perm) { + if (!authorized_keys_file.setPermissions (authorized_keys_file_target_perm)) { + /* FIXME: use a function for this... */ + QString message = tr ("Unable to change the permissions of file: ") + authorized_keys_file.fileName (); + message += "\n" + tr ("This is an error because sshd would deny such a file."); + QMessageBox::critical (NULL, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + permission_error = true; + } + } + + QFile::Permissions authorized_keys_dir_perm = QFile (authorized_keys_dir.absolutePath ()).permissions (); + QFile::Permissions authorized_keys_dir_target_perm = QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner; + + /* + * Try to set the permissions if they are wrong. + * (sshd would disallow such a directory.) + */ + if (authorized_keys_dir_perm != authorized_keys_dir_target_perm) { + if (!QFile (authorized_keys_dir.absolutePath ()).setPermissions (authorized_keys_dir_target_perm)) { + /* FIXME: use a function for this... */ + QString message = tr ("Unable to change the permissions of directory: ") + authorized_keys_dir.absolutePath (); + message += "\n" + tr ("This is an error because sshd would deny such a directory."); + QMessageBox::critical (NULL, tr ("Error"), message, + QMessageBox::Ok, QMessageBox::NoButton); + permission_error = true; + } + } - x2goDebug<<"Temporarily activated public key from file "<<fsExportKey<<".pub."<<endl; + if (permission_error) { + QFile::remove (fsExportKey + ".pub"); + return; + } +#endif /* defined (Q_OS_UNIX) */ + + directory* dir = getExpDir (fsExportKey); + bool rem = dir->isRemovable; + if (!dir) { + return; + } + + QTextStream out (&authorized_keys_file); + out << line; + authorized_keys_file.close (); + + x2goDebug << "Temporarily activated public key from file " << fsExportKey << ".pub."; QString passwd=getCurrentPass(); QString user=getCurrentUname(); @@ -10277,18 +10337,19 @@ void ONMainWindow::generateEtcFiles() QFile file ( etcDir +"/sshd_config" ); if ( !file.open ( QIODevice::WriteOnly | QIODevice::Text ) ) return; + QString authKeyPath = homeDir + "/.x2go/.ssh/authorized_keys"; #ifdef Q_OS_WIN - QString authKeyPath=cygwinPath ( homeDir+"/.x2go/.ssh/authorized_keys" ); - authKeyPath.replace(wapiGetUserName(),"%u"); -#endif + authKeyPath = cygwinPath (authKeyPath); + authKeyPath.replace (wapiGetUserName (), "%u"); +#endif /* defined (Q_OS_WIN) */ QTextStream out ( &file ); out<<"StrictModes no\n"<< "UsePrivilegeSeparation no\n"<< "PidFile \"" + varDir + "/sshd.pid\"\n" << + "AuthorizedKeysFile \"" << authKeyPath << "\"\n" << #ifdef Q_OS_WIN "Subsystem shell "<< wapiShortFileName ( appDir) +"/sh"+"\n"<< "Subsystem sftp "<< wapiShortFileName ( appDir) +"/sftp-server"+"\n"<< - "AuthorizedKeysFile \""<<authKeyPath<<"\""; #else "Subsystem sftp " /* This may need some sanitization, i.e., appDir could potentially include whitespace. */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 43518a7cb9e93f822efa8d016b7cdebf9bd2eaaf Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:30:54 2015 +0100 compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. --- debian/changelog | 2 ++ src/compat.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/compat.h | 38 ++++++++++++++++++++++++++++++++++++++ src/x2goclient.cpp | 1 + x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 6 files changed, 98 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 97fc2d9..f8bb7e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -78,6 +78,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium starting sshd in user mode. Put the authorized_keys file in there. Check and set correct permissions for both the directory and authorized_keys file. Generalize some Windows-specific sections by using QDir and QFile. + - compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. + Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/compat.cpp b/src/compat.cpp new file mode 100644 index 0000000..877d07b --- /dev/null +++ b/src/compat.cpp @@ -0,0 +1,49 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "compat.h" + +#ifdef Q_OS_DARWIN +/* + * strndup() is not available on 10.6 and below, define a compat version here. + * Shameless copy from libiberty. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +inline char *strndup (const char *s, size_t n) { + char *result; + size_t len = strlen (s); + + if (n < len) { + len = n; + } + + result = (char *) malloc (len + 1); + if (!result) { + return (0); + } + + result[len] = '\0'; + return ((char *) memcpy (result, s, len)); +} +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ +#endif /* defined (Q_OS_DARWIN) */ diff --git a/src/compat.h b/src/compat.h new file mode 100644 index 0000000..8b9d77e --- /dev/null +++ b/src/compat.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * Copyright (C) 2015 by Mihai Moldovan <ionic@ionic.de> +49 721 14595728 * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + + +#ifndef COMPAT_H +#define COMPAT_H + +#ifdef Q_OS_DARWIN +/* + * strndup() is not available on 10.6 and below, define a compat version here. + * Shameless copy from libiberty. + */ +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 +#include <stddef.h> +#include <string.h> +#include <stdlib.h> + +inline char *strndup (const char *s, size_t n); +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ +#endif /* defined (Q_OS_DARWIN) */ + +#endif /* !defined (COMPAT_H) */ diff --git a/src/x2goclient.cpp b/src/x2goclient.cpp index df53ba1..b201a4e 100644 --- a/src/x2goclient.cpp +++ b/src/x2goclient.cpp @@ -30,6 +30,7 @@ #include "unixhelper.h" #include "ongetpass.h" +#include "compat.h" int wrap_x2go_main (int argc, char **argv) { return (x2goMain (argc, argv)); diff --git a/x2goclient.pro b/x2goclient.pro index 34da16e..d0486e9 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -80,7 +80,8 @@ HEADERS += src/configdialog.h \ src/folderexplorer.h \ src/non_modal_messagebox.h \ src/help.h \ - src/unixhelper.h + src/unixhelper.h \ + src/compat.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -124,7 +125,8 @@ SOURCES += src/sharewidget.cpp \ src/folderexplorer.cpp \ src/non_modal_messagebox.cpp \ src/help.cpp \ - src/unixhelper.cpp + src/unixhelper.cpp \ + src/compat.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index 63cc3d8..905ef77 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -36,7 +36,8 @@ HEADERS += src/configdialog.h \ src/sharewidget.h \ src/clicklineedit.h \ src/help.h \ - src/unixhelper.h + src/unixhelper.h \ + src/compat.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -64,7 +65,8 @@ SOURCES += src/sharewidget.cpp \ src/wapi.cpp \ src/clicklineedit.cpp \ src/help.cpp \ - src/unixhelper.cpp + src/unixhelper.cpp \ + src/compat.cpp TEMPLATE = app TARGET = -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 780b82fed9f9f9754891e9ae4915015180f54797 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:40:41 2015 +0100 compat.{cpp,h}: remove inline keyword, because function is not defined in header file. --- debian/changelog | 2 ++ src/compat.cpp | 2 +- src/compat.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f8bb7e9..4a83af4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -80,6 +80,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium file. Generalize some Windows-specific sections by using QDir and QFile. - compat.{cpp,h}: new files. Implements strndup on OS X 10.6 and below. Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. + - compat.{cpp,h}: remove inline keyword, because function is not defined + in header file. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/compat.cpp b/src/compat.cpp index 877d07b..c443489 100644 --- a/src/compat.cpp +++ b/src/compat.cpp @@ -29,7 +29,7 @@ #include <string.h> #include <stdlib.h> -inline char *strndup (const char *s, size_t n) { +char *strndup (const char *s, size_t n) { char *result; size_t len = strlen (s); diff --git a/src/compat.h b/src/compat.h index 8b9d77e..36b71ef 100644 --- a/src/compat.h +++ b/src/compat.h @@ -31,7 +31,7 @@ #include <string.h> #include <stdlib.h> -inline char *strndup (const char *s, size_t n); +char *strndup (const char *s, size_t n); #endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ #endif /* defined (Q_OS_DARWIN) */ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d5c66e384c8bc11e1076e8767db374d51f1262c4 Author: Mihai Moldovan <ionic@ionic.de> Date: Sat Mar 21 23:51:37 2015 +0100 compat.h: include QtCore/qglobal.h for Q_OS_... macros. --- debian/changelog | 1 + src/compat.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4a83af4..815f405 100644 --- a/debian/changelog +++ b/debian/changelog @@ -82,6 +82,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium Add to x2goclient.cpp, x2goclient.pro and x2goclient.pro.maemo. - compat.{cpp,h}: remove inline keyword, because function is not defined in header file. + - compat.h: include QtCore/qglobal.h for Q_OS_... macros. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/compat.h b/src/compat.h index 36b71ef..39da9eb 100644 --- a/src/compat.h +++ b/src/compat.h @@ -17,10 +17,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ - #ifndef COMPAT_H #define COMPAT_H +#include <QtCore/qglobal.h> + #ifdef Q_OS_DARWIN /* * strndup() is not available on 10.6 and below, define a compat version here. -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 74247ba0714e32f250eb92684ceb78ad2504b522 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 29 02:34:13 2015 +0200 pulsemanager.{cpp,h}: new class for PulseAudio management. --- debian/changelog | 1 + src/pulsemanager.cpp | 270 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/pulsemanager.h | 92 +++++++++++++++++ 3 files changed, 363 insertions(+) diff --git a/debian/changelog b/debian/changelog index 815f405..4a5b26b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -83,6 +83,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - compat.{cpp,h}: remove inline keyword, because function is not defined in header file. - compat.h: include QtCore/qglobal.h for Q_OS_... macros. + - pulsemanager.{cpp,h}: new class for PulseAudio management. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp new file mode 100644 index 0000000..af1ba2b --- /dev/null +++ b/src/pulsemanager.cpp @@ -0,0 +1,270 @@ +/*************************************************************************** + * Copyright (C) 2012-2015 by Mihai Moldovan <ionic@ionic.de> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "pulsemanager.h" + +#ifndef DEBUG +#define DEBUG_UNDEF +#define DEBUG +#endif + +PulseManager::PulseManager () { + _pulse_X2Go = "/.x2go/pulse"; + + _pulse_dir = QDir (QDir::homePath ()); + _pulse_dir.mkpath (_pulse_dir.absolutePath () + _pulse_X2Go + "/tmp"); + _pulse_dir.cd (_pulse_X2Go.mid (1)); + + _env = QProcessEnvironment::systemEnvironment (); + _env.insert ("HOME", _pulse_dir.absolutePath ()); + _env.insert ("TEMP", _pulse_dir.absolutePath () + "/tmp"); + + _pulse_port = 4713; + + _state = QProcess::NotRunning; + + _pulse_server = 0; + + _app_dir = QApplication::applicationDirPath (); +} + +PulseManager::~PulseManager () { + if (_pulse_server && is_server_running ()) + shutdown (); + + delete (_pulse_server); +} + +void PulseManager::start () { + assert (!is_server_running ()); + + delete (_pulse_server); + + _pulse_server = new QProcess (0); + _state = QProcess::Starting; + +#ifdef Q_OS_DARWIN + start_osx (); +#elif defined (Q_OS_WIN) + start_win (); +#elif defined (Q_OS_LINUX) + start_linux (); +#endif +} + +void PulseManager::start_osx () { + find_port (); + + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); + + _pulse_server->setProcessEnvironment (_env); + + QStringList args; + args << "--exit-idle-time=-1" << "-n" + << "-F" << _pulse_dir.absolutePath () + "/config.pa" + << "-p" + << QDir (_app_dir + + "/../Frameworks/pulse-2.0/modules").absolutePath () + << "--high-priority"; +#ifdef DEBUG + args << "--log-level=debug"; +#endif + + _pulse_server->setWorkingDirectory (_app_dir + "/../exe/"); + _pulse_server->start (_app_dir + "/../exe/pulseaudio", args); + + if (_pulse_server->waitForStarted ()) { + x2goDebug << "pulse started with" << args << "waiting for finish..."; + _state = QProcess::Running; + + connect (_pulse_server, SIGNAL (finished (int)), + this, SLOT (on_pulse_finished (int))); + +#ifdef DEBUG + // Give PA a little time to come up. + QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); +#endif + } + } +} + +void PulseManager::find_port () { + QTcpSocket tcpSocket (0); + bool free = false; + + do { + tcpSocket.connectToHost ("127.0.0.1", _pulse_port); + + if (tcpSocket.waitForConnected (1000)) { + tcpSocket.close (); + free = false; + _pulse_port++; + } + else + free = true; + } while (!free); +} + +bool PulseManager::generate_server_config () { + QString config_file_name = _pulse_dir.absolutePath () + "/config.pa"; + QTemporaryFile config_tmp_file (_pulse_dir.absolutePath () + "/tmp/tmpconfig"); + X2goSettings settings ("settings"); + bool disable_input = false; + bool ret = false; + + disable_input = settings.setting ()->value ("soundnoinput", + (QVariant) false).toBool (); + + if (config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&config_tmp_file); + + config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + + QString::number (_pulse_port) << endl; + config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; + config_tmp_file_stream << "load-module module-coreaudio-detect"; + + if (disable_input) + config_tmp_file_stream << " record=0"; + + config_tmp_file_stream << endl; + + QFile config_file (config_file_name); + if (QFile::exists (config_file_name)) + QFile::remove (config_file_name); + + config_tmp_file.copy (config_file_name); + config_tmp_file.remove (); + + ret = true; + } + + return (ret); +} + +bool PulseManager::generate_client_config () { + QTemporaryFile client_config_tmp_file (_pulse_dir.absolutePath () + + "/tmp/tmpconfig"); + QString client_config_file_name (_pulse_dir.absolutePath () + "/.pulse/client.conf"); + bool ret = false; + + if (client_config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&client_config_tmp_file); + + config_tmp_file_stream << "autospawn=no" << endl; + config_tmp_file_stream << "daemon-binary=" + << QDir (_app_dir + + "/../exe/pulseaudio").absolutePath () + << endl; + + if (QFile::exists (client_config_file_name)) + QFile::remove (client_config_file_name); + + client_config_tmp_file.copy (client_config_file_name); + client_config_tmp_file.remove (); + + ret = true; + } + + return (ret); +} + +void PulseManager::cleanup_client_dir () { + // PA expects $HOME/.pulse/$HOST-runtime to be a symbolic link + // and will fail, if it's just a plain directory on Mac OS X. + // Delete it first. + QDir machine_dir (_pulse_dir.absolutePath () + "/.pulse/" + + QHostInfo::localHostName () + "-runtime"); + + if (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); + + if (machine_dir.exists ()) + machine_dir.remove (machine_dir.absolutePath ()); +} + +void PulseManager::slot_play_startup_sound () { + QProcess play_file (0); + + play_file.setWorkingDirectory (_pulse_server->workingDirectory ()); + play_file.setProcessEnvironment (_env); + play_file.start (_app_dir + "/../exe/paplay " + + _app_dir + "/../Resources/startup.wav"); + + if (play_file.waitForStarted ()) + play_file.waitForFinished (); +} + +void PulseManager::on_pulse_finished (int exit_code) { + if (!exit_code) + x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; + + QByteArray ba = _pulse_server->readAllStandardOutput (); + char *data = ba.data (); + std::cout << data; + ba = _pulse_server->readAllStandardError (); + data = ba.data (); + std::cout << data; + + _state = QProcess::NotRunning; + emit (sig_pulse_server_terminated ()); +} + +bool PulseManager::is_server_running () { + if (_pulse_server) + return (_pulse_server->state () == QProcess::Running); + else + return (false); +} + +void PulseManager::shutdown () { + QEventLoop loop; + + connect (this, SIGNAL (sig_pulse_server_terminated ()), + &loop, SLOT (quit ())); + + _pulse_server->terminate (); + + loop.exec (); +} + +int PulseManager::get_pulse_port () { + return (_pulse_port); +} + +void PulseManager::set_pulse_port (int pulse_port) { + _pulse_port = pulse_port; +} + +void PulseManager::relaunch () { + if (_pulse_server && is_server_running ()) + shutdown (); + + x2goDebug << "restarting pulse"; + start (); +} + +QProcess::ProcessState PulseManager::state () { + return (_state); +} + +#ifdef DEBUG_UNDEF +#undef DEBUG +#undef DEBUG_UNDEF +#endif diff --git a/src/pulsemanager.h b/src/pulsemanager.h new file mode 100644 index 0000000..fc0a989 --- /dev/null +++ b/src/pulsemanager.h @@ -0,0 +1,92 @@ +/*************************************************************************** + * Copyright (C) 2012-2015 by Mihai Moldovan <ionic@ionic.de> * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef PULSEMANAGER_H +#define PULSEMANAGER_H + +#ifdef NDEBUG +#define NDEBUG_DEFINE +#undef NDEBUG +#endif + +#include <iostream> +#include <QDir> +#include <QTcpSocket> +#include <QEventLoop> +#include <QTemporaryFile> +#include <QHostInfo> +#include <QProcess> +#include <QApplication> +#include <QTimer> +#include <assert.h> +#include "x2gologdebug.h" +#include "x2gosettings.h" + +class PulseManager: public QObject +{ + Q_OBJECT; + +public: + PulseManager (); + ~PulseManager (); + int get_pulse_port (); + void set_pulse_port (int pulse_port); + QProcess::ProcessState state (); + +public slots: + void start (); + void relaunch (); + +private: + PulseManager (const PulseManager &other); + void start_osx (); + // FIXME + void start_win (); + // FIXME + void start_linux (); + void find_port (); + bool generate_server_config (); + bool generate_client_config (); + void cleanup_client_dir (); + void shutdown (); + bool is_server_running (); + +private slots: + void on_pulse_finished (int exit_code); + void slot_play_startup_sound (); + +signals: + void sig_pulse_server_terminated (); + +private: + QString _pulse_X2Go; + QDir _pulse_dir; + QProcessEnvironment _env; + QProcess *_pulse_server; + int _pulse_port; + QProcess::ProcessState _state; + QString _app_dir; +}; + +#ifdef NDEBUG_DEFINE +#define NDEBUG +#undef NDEBUG_DEFINE +#endif + +#endif // PULSEMANAGER_H -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 564c715527160bb890959981f215708eeb5ca211 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 29 02:36:24 2015 +0200 x2goclient.pro{maemo}: reference new pulsemanager.{cpp,h} files. --- debian/changelog | 1 + x2goclient.pro | 6 ++++-- x2goclient.pro.maemo | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a5b26b..e7a4e2f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -84,6 +84,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium in header file. - compat.h: include QtCore/qglobal.h for Q_OS_... macros. - pulsemanager.{cpp,h}: new class for PulseAudio management. + - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/x2goclient.pro b/x2goclient.pro index d0486e9..b026390 100644 --- a/x2goclient.pro +++ b/x2goclient.pro @@ -81,7 +81,8 @@ HEADERS += src/configdialog.h \ src/non_modal_messagebox.h \ src/help.h \ src/unixhelper.h \ - src/compat.h + src/compat.h \ + src/pulsemanager.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -126,7 +127,8 @@ SOURCES += src/sharewidget.cpp \ src/non_modal_messagebox.cpp \ src/help.cpp \ src/unixhelper.cpp \ - src/compat.cpp + src/compat.cpp \ + src/pulsemanager.cpp LIBS += -lssh win32:LIBS += -lAdvAPI32 -lshell32 -lUser32 diff --git a/x2goclient.pro.maemo b/x2goclient.pro.maemo index 905ef77..4a06622 100644 --- a/x2goclient.pro.maemo +++ b/x2goclient.pro.maemo @@ -37,7 +37,8 @@ HEADERS += src/configdialog.h \ src/clicklineedit.h \ src/help.h \ src/unixhelper.h \ - src/compat.h + src/compat.h \ + src/pulsemanager.h SOURCES += src/sharewidget.cpp \ src/settingswidget.cpp \ @@ -66,7 +67,8 @@ SOURCES += src/sharewidget.cpp \ src/clicklineedit.cpp \ src/help.cpp \ src/unixhelper.cpp \ - src/compat.cpp + src/compat.cpp \ + src/pulsemanager.cpp TEMPLATE = app TARGET = -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bcc34818518ab19de61cc808d047b89b8d10df1b Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:16:27 2015 +0200 macbuild.sh: add new MACPORTS_PREFIX detection/variable. --- debian/changelog | 1 + macbuild.sh | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index e7a4e2f..c4e23a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -85,6 +85,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - compat.h: include QtCore/qglobal.h for Q_OS_... macros. - pulsemanager.{cpp,h}: new class for PulseAudio management. - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. + - macbuild.sh: add new MACPORTS_PREFIX detection/variable. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 64a93ec..6e37740 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -32,6 +32,7 @@ usage() { printf "\tDEBUG\t\t\t\tenables or disables debug builds [boolean]\n\t\t\t\t\tdefault: disabled\n" printf "\tBUNDLE\t\t\t\tenables or disables library bundling and the creation of a .dmg installer [boolean]\n\t\t\t\t\tdefault: enabled\n" printf "\tUNIVERSAL\t\t\tenables or disables x86 support. x86_64 support is always enabled [boolean]\n\t\t\t\t\tdefault: enabled\n" + printf "\tMACPORTS_PREFIX\t\t\tsets the (MacPorts) prefix used to detect PulseAudio and nxproxy binaries\n\t\t\t\t\tdefault: /opt/local/\n" printf "\n" printf "Boolean values help:\n" printf "\ta value of ${NO_VAL} will be treated as false\n" @@ -54,6 +55,16 @@ PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" NXPROXY="$(which nxproxy)" +# Try to find the MacPorts prefix. +typeset MACPORTS_PREFIX_SEARCH="" +if type -P port >/dev/null 2>&1; then + MACPORTS_PREFIX_SEARCH="$(type -P port)" + MACPORTS_PREFIX_SEARCH="${MACPORTS_PREFIX_SEARCH%%bin/port}" +else + # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. + # Try to guess. + MACPORTS_PREFIX_SEARCH="/opt/local/" +fi : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} @@ -61,6 +72,9 @@ NXPROXY="$(which nxproxy)" : ${DEBUG:="0"} : ${BUNDLE:="1"} : ${UNIVERSAL:="1"} +: ${MACPORTS_PREFIX:="${MACPORTS_PREFIX_SEARCH}"} + +unset MACPORTS_PREFIX_SEARCH FORCE_STDLIB="$(make_boolean "${FORCE_STDLIB}")" DEBUG="$(make_boolean "${DEBUG}")" @@ -114,10 +128,6 @@ pushd "${BUILD_DIR}" phase "Running lrelease" lrelease "${PROJECT}" - -# WILL BE REMOVED IN OTHER BRANCH - ONLY HERE FOR COMPAT REASONS -MACPORTS_PREFIX="/opt/local" - phase "Running qmake" qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ CONFIG+="${BUILD_ARCH}" \ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 16fd81ab7334df5bc1848875d184dc346e4981fd Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:19:59 2015 +0200 macbuild.sh: add new dependency_error() helper function. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index c4e23a9..235ca5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -86,6 +86,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: new class for PulseAudio management. - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. - macbuild.sh: add new MACPORTS_PREFIX detection/variable. + - macbuild.sh: add new dependency_error() helper function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 6e37740..83df7ea 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -41,6 +41,20 @@ usage() { exit 2 } +dependency_error() { + exec >&2 + + typeset element="${1}"; shift + typeset component="${1}"; shift + typeset type="${1}"; shift + + echo "${element} ${type} not found." + echo "Install ${component} -- e.g., via "port -vt install ${component}" if using MacPorts." + echo "If ${component} is already installed, try passing MACPORTS_PREFIX if the autodetected or default value (${MACPORTS_PREFIX}) does not match your setup." + + exit 3 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 4c988a3a4cf8858c7a914a4aa36c258f81cd85f9 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:22:49 2015 +0200 macbuild.sh: add new get_nesting_level() helper function. --- debian/changelog | 1 + macbuild.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0fe069c..97b3a80 100644 --- a/debian/changelog +++ b/debian/changelog @@ -88,6 +88,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add new MACPORTS_PREFIX detection/variable. - macbuild.sh: add new dependency_error() helper function. - macbuild.sh: add new lazy_canonical_path() helper function. + - macbuild.sh: add new get_nesting_level() helper function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 0c8e47b..5df4670 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -67,6 +67,20 @@ lazy_canonical_path() { printf "${old_path}" } +get_nesting_level() { +set -x + typeset -i level=0 + typeset path="${1}" + + while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do + i="$((${i} + 1))" + path="$(dirname "${path}")" + done + + printf "${level}" +set +x +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 8c99a93f9575f18eb0ffe69dd313d659be24a10c Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:21:31 2015 +0200 macbuild.sh: add new lazy_canonical_path() helper function. --- debian/changelog | 1 + macbuild.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 235ca5c..0fe069c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -87,6 +87,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - x2goclient.pro{,.maemo}: reference new pulsemanager.{cpp,h} files. - macbuild.sh: add new MACPORTS_PREFIX detection/variable. - macbuild.sh: add new dependency_error() helper function. + - macbuild.sh: add new lazy_canonical_path() helper function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 83df7ea..0c8e47b 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -55,6 +55,18 @@ dependency_error() { exit 3 } +lazy_canonical_path() { + typeset path="${1}" + + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done + + printf "${old_path}" +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2314ad4a78d5224fcd2202c088a24addb6490838 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:24:37 2015 +0200 macbuild.sh: add new repeat_str() helper function. --- debian/changelog | 1 + macbuild.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 97b3a80..2adaf79 100644 --- a/debian/changelog +++ b/debian/changelog @@ -89,6 +89,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add new dependency_error() helper function. - macbuild.sh: add new lazy_canonical_path() helper function. - macbuild.sh: add new get_nesting_level() helper function. + - macbuild.sh: add new repeat_str() helper function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 5df4670..e264e86 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -81,6 +81,22 @@ set -x set +x } +repeat_str() { # INPUT COUNT + typeset INPUT="${1:?"Error: no input string passed to ${FUNCNAME}()."}" + typeset COUNT="${2:?"Error: no count passed to ${FUNCNAME}()."}" + + typeset ret="" + typeset -i i=0 + while [ "${i}" -lt "${COUNT}" ]; do + ret="${ret}$(printf "${INPUT}")" + i=$((${i} + 1)) + done + + printf "${ret}" + + return 0 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 563b20ef04ffa733d7763ea73f4abccd40163639 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:28:02 2015 +0200 macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. --- debian/changelog | 1 + macbuild.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2adaf79..745903e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -90,6 +90,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add new lazy_canonical_path() helper function. - macbuild.sh: add new get_nesting_level() helper function. - macbuild.sh: add new repeat_str() helper function. + - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index e264e86..9ea2d32 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -110,7 +110,6 @@ DMGFILE="${BUILD_DIR}/${NAME}.dmg" PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" -NXPROXY="$(which nxproxy)" # Try to find the MacPorts prefix. typeset MACPORTS_PREFIX_SEARCH="" if type -P port >/dev/null 2>&1; then @@ -122,6 +121,8 @@ else MACPORTS_PREFIX_SEARCH="/opt/local/" fi +NXPROXY="nxproxy" + : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} : ${FORCE_STDLIB:="0"} @@ -164,6 +165,11 @@ else fi fi +# Gather files. +NXPROXY="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${NXPROXY}")" + +[ -x "${NXPROXY}" ] || dependency_error "nxproxy" "nxproxy" "binary" + set -e phase "Cleaning" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9b8be1f52adae3e055e92c4d8ac88a2076cc8928 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:30:08 2015 +0200 macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create directories based on that. Use them when bundling. --- debian/changelog | 2 ++ macbuild.sh | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 745903e..df7ecd8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -91,6 +91,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add new get_nesting_level() helper function. - macbuild.sh: add new repeat_str() helper function. - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. + - macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create + directories based on that. Use them when bundling. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 9ea2d32..e0db1f7 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -106,6 +106,8 @@ TOP_DIR="$(dirname "$0")" [[ "${TOP_DIR}" == /* ]] || TOP_DIR="${PWD}/${TOP_DIR#./}" BUILD_DIR="${TOP_DIR}/client_build" APPBUNDLE="${BUILD_DIR}/${NAME}.app" +EXE_DIR="${APPBUNDLE}/Contents/exe/" +FRAMEWORKS_DIR="${APPBUNDLE}/Contents/Frameworks/" DMGFILE="${BUILD_DIR}/${NAME}.dmg" PROJECT="${TOP_DIR}/${NAME}.pro" PKG_DMG="${TOP_DIR}/pkg-dmg" @@ -202,15 +204,17 @@ qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ phase "Running make" make -j2 +mkdir -p "${EXE_DIR}/" +mkdir -p "${FRAMEWORKS_DIR}/" + phase "Copying nxproxy" -mkdir -p "${APPBUNDLE}/Contents/exe" -cp "${NXPROXY}" "${APPBUNDLE}/Contents/exe" +cp -av "${NXPROXY}" "${EXE_DIR}/" if [ "${BUNDLE}" = "1" ]; then dylibbundler \ - --fix-file "${APPBUNDLE}/Contents/exe/nxproxy" \ + --fix-file "${EXE_DIR}/nxproxy" \ --bundle-deps \ - --dest-dir "${APPBUNDLE}/Contents/Frameworks" \ + --dest-dir "${FRAMEWORKS_DIR}/" \ --install-path "@executable_path/../Frameworks/" \ --create-dir -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit aa85e3819d7d3581969ed38362c69b24e9412abf Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:33:59 2015 +0200 macbuild.sh: define PulseAudio libraries and binaries to be later copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. --- debian/changelog | 3 +++ macbuild.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/debian/changelog b/debian/changelog index df7ecd8..ec140d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -93,6 +93,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: refactor nxproxy detection to use MACPORTS_PREFIX. - macbuild.sh: add EXE_DIR and FRAMEWORKS_DIR internal variables. Create directories based on that. Use them when bundling. + - macbuild.sh: define PulseAudio libraries and binaries to be later + copied. Discover them using MACPORTS_PREFIX. Error out if any component + was not found. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index e0db1f7..ae7cc7f 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -124,6 +124,13 @@ else fi NXPROXY="nxproxy" +PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" + "pamon" "paplay" "parec" "parecord" "pasuspender" ) +PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" + "libpulse.0.dylib" + "libpulsecore-6.0.dylib" + "pulse-6.0" + "pulseaudio" ) : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} @@ -172,6 +179,50 @@ NXPROXY="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${NXPROXY}")" [ -x "${NXPROXY}" ] || dependency_error "nxproxy" "nxproxy" "binary" +typeset -i i +typeset -i fail +typeset -a PULSEAUDIO_BINARIES_FULL +typeset cur_binary +fail="0" +for cur_binary in ${PULSEAUDIO_BINARIES[@]}; do + cur_binary="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${cur_binary}")" + + if [ -x "${cur_binary}" ]; then + PULSEAUDIO_BINARIES_FULL+=( "${cur_binary}" ) + else + fail="1" + break + fi +done + +[ "${fail}" -eq "1" ] && dependency_error "${cur_binary##"$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/")"}" "pulseaudio" "binary" + +typeset cur_lib_or_libdir +typeset -a PULSEAUDIO_LIBRARIES_FULL +fail="0" +for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do + cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" + + if [ -x "${cur_lib_or_libdir}" ]; then + PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) + elif [ -d "${cur_lib_or_libdir}" ]; then + # That's a directory... more work needed here. + typeset entry="" + for entry in "${cur_lib_or_libdir}"/*; do + typeset TMP_REGEX='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + if [[ "${entry}" =~ ${TMP_REGEX} ]]; then + # Filename matched the expected template. + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) + fi + done + else + fail="1" + break + fi +done + +[ "${fail}" -eq "1" ] && dependency_error "${cur_lib_or_libdir}" "pulseaudio" "library or library directory" + set -e phase "Cleaning" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 645b1ddde36491f8f2c22b9c12b891911af26ee0 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:35:00 2015 +0200 macbuild.sh: copy PulseAudio libraries and binaries. --- debian/changelog | 1 + macbuild.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index ec140d4..30e4992 100644 --- a/debian/changelog +++ b/debian/changelog @@ -96,6 +96,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: define PulseAudio libraries and binaries to be later copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. + - macbuild.sh: copy PulseAudio libraries and binaries. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index ae7cc7f..c10c814 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -261,6 +261,23 @@ mkdir -p "${FRAMEWORKS_DIR}/" phase "Copying nxproxy" cp -av "${NXPROXY}" "${EXE_DIR}/" +phase "Copying PulseAudio" +for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do + cp -av "${cur_binary}" "${EXE_DIR}/" +done + +typeset intermediate_lib_dir="" +for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do +set -x + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + + mkdir -p "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" + + cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" +set +x +done + if [ "${BUNDLE}" = "1" ]; then dylibbundler \ --fix-file "${EXE_DIR}/nxproxy" \ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d48c444175749fa066abc818444683bf3782ed52 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:36:16 2015 +0200 macbuild.sh: add phase output for bundling nxproxy. --- debian/changelog | 1 + macbuild.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 30e4992..b0b328e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -97,6 +97,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium copied. Discover them using MACPORTS_PREFIX. Error out if any component was not found. - macbuild.sh: copy PulseAudio libraries and binaries. + - macbuild.sh: add phase output for bundling nxproxy. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index c10c814..cff39ae 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -279,6 +279,7 @@ set +x done if [ "${BUNDLE}" = "1" ]; then + phase "Bundling nxproxy" dylibbundler \ --fix-file "${EXE_DIR}/nxproxy" \ --bundle-deps \ -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0d9deaef6de6e74d8159e2cc822e3f7d5fc95159 Author: Mihai Moldovan <ionic@ionic.de> Date: Sun May 3 23:37:46 2015 +0200 macbuild.sh: add work-in-progress PulseAudio bundling. Needs to be ripped apart and be redone, because dylibbundler is not smart enough to handle our case. --- debian/changelog | 3 +++ macbuild.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/debian/changelog b/debian/changelog index b0b328e..b3c4473 100644 --- a/debian/changelog +++ b/debian/changelog @@ -98,6 +98,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium was not found. - macbuild.sh: copy PulseAudio libraries and binaries. - macbuild.sh: add phase output for bundling nxproxy. + - macbuild.sh: add work-in-progress PulseAudio bundling. Needs to be ripped + apart and be redone, because dylibbundler is not smart enough to handle + our case. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index cff39ae..7b14bb5 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -287,6 +287,41 @@ if [ "${BUNDLE}" = "1" ]; then --install-path "@executable_path/../Frameworks/" \ --create-dir + phase "Bundling PulseAudio" + typeset cur_binary_name="" + for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + dylibbundler \ + --fix-file "${EXE_DIR}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@executable_path/../Frameworks/" \ + --create-dir \ + --overwrite-files + fi + done + + typeset intermediate_lib_dir="" + for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + + typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" + + dylibbundler \ + --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@loader_path/$(repeat_str "../" "${nesting_level}")Frameworks/" \ + --create-dir \ + --overwrite-files + fi + done + phase "Bundling up using macdeployqt" macdeployqt "${APPBUNDLE}" -verbose=2 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5802d2a0b65a8f32a3c41395d57aa78e23140424 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 29 23:03:23 2015 +0200 macbuild.sh: add Linux library file name scheme regex as a precaution. --- debian/changelog | 1 + macbuild.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index b3c4473..1a96e42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -101,6 +101,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add work-in-progress PulseAudio bundling. Needs to be ripped apart and be redone, because dylibbundler is not smart enough to handle our case. + - macbuild.sh: add Linux library file name scheme regex as a precaution. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 7b14bb5..9e9a1f8 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -209,8 +209,13 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # That's a directory... more work needed here. typeset entry="" for entry in "${cur_lib_or_libdir}"/*; do - typeset TMP_REGEX='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' - if [[ "${entry}" =~ ${TMP_REGEX} ]]; then + typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' + + # This is only here should the PA build system ever break and create + # "linux-style" library file names. Let's hope it never actually comes to that. + typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + + if [[ "${entry}" =~ ${TMP_REGEX} ]] || [[ "${entry}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 66d40e85fff19e651e5c3b82da759dff39d2ad04 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Jun 29 23:09:05 2015 +0200 macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1a96e42..bedcb5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -102,6 +102,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium apart and be redone, because dylibbundler is not smart enough to handle our case. - macbuild.sh: add Linux library file name scheme regex as a precaution. + - macbuild.sh: directories are "executable", so the first check must + explicitly include a check for the argument being not a directory. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 9e9a1f8..a6b9224 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -203,7 +203,7 @@ fail="0" for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" - if [ -x "${cur_lib_or_libdir}" ]; then + if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) elif [ -d "${cur_lib_or_libdir}" ]; then # That's a directory... more work needed here. -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6761ac0d6b0ab63e775c52d02edbf6688cfdf6a6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:31:52 2015 +0200 macbuild.sh: add some more debugging output. --- debian/changelog | 1 + macbuild.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index bedcb5f..44ca827 100644 --- a/debian/changelog +++ b/debian/changelog @@ -104,6 +104,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add Linux library file name scheme regex as a precaution. - macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. + - macbuild.sh: add some more debugging output. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index a6b9224..b3f5177 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -204,9 +204,11 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then + echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) elif [ -d "${cur_lib_or_libdir}" ]; then # That's a directory... more work needed here. + echo "Scrubbing directory ${cur_lib_or_libdir}" typeset entry="" for entry in "${cur_lib_or_libdir}"/*; do typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' @@ -314,6 +316,7 @@ if [ "${BUNDLE}" = "1" ]; then if [ ! -L "${cur_binary}" ]; then cur_binary_name="$(basename "${cur_binary}")" + echo "Handling ${cur_binary} => ${cur_binary_name}." typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c717c37f8647d6e88091f4f73111d8bd92aa38ef Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:33:30 2015 +0200 macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. --- debian/changelog | 2 ++ macbuild.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 44ca827..e9b55fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -105,6 +105,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: directories are "executable", so the first check must explicitly include a check for the argument being not a directory. - macbuild.sh: add some more debugging output. + - macbuild.sh: remove libpulse and libpulsecore from libraries to be + bundled, as something else will bundle them anyway. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index b3f5177..231e030 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -127,8 +127,6 @@ NXPROXY="nxproxy" PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" "pamon" "paplay" "parec" "parecord" "pasuspender" ) PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" - "libpulse.0.dylib" - "libpulsecore-6.0.dylib" "pulse-6.0" "pulseaudio" ) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b1e5fe54e33b3b54d1e0cb87e6b955e27547cc8a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:39:59 2015 +0200 macbuild.sh: use while-read-loop and find to actually recurse through directories. --- debian/changelog | 2 ++ macbuild.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index e9b55fa..2bc16bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -107,6 +107,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add some more debugging output. - macbuild.sh: remove libpulse and libpulsecore from libraries to be bundled, as something else will bundle them anyway. + - macbuild.sh: use while-read-loop and find to actually recurse through + directories. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 231e030..cbf9909 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -208,7 +208,11 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # That's a directory... more work needed here. echo "Scrubbing directory ${cur_lib_or_libdir}" typeset entry="" - for entry in "${cur_lib_or_libdir}"/*; do + + # -r parameter to read: Backslashes may NOT escape any characters! + # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed + # by a NUL character, the delimiter is set to this very NUL (\000) character. + while read -r -d '' entry; do typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' # This is only here should the PA build system ever break and create @@ -219,7 +223,7 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi - done + done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) else fail="1" break -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ae79f80c9af82eb6f4d180d2ebb3c437cd2435f6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:42:01 2015 +0200 macbuild.sh: check current file name against regex, not a (now) full path. --- debian/changelog | 2 ++ macbuild.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2bc16bc..0a0b0fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -109,6 +109,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium bundled, as something else will bundle them anyway. - macbuild.sh: use while-read-loop and find to actually recurse through directories. + - macbuild.sh: check current file name against regex, not a (now) full + path. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index cbf9909..d0d5f8a 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -213,13 +213,14 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed # by a NUL character, the delimiter is set to this very NUL (\000) character. while read -r -d '' entry; do + typeset cur_file="$(basename "${entry}")" typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' # This is only here should the PA build system ever break and create # "linux-style" library file names. Let's hope it never actually comes to that. typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' - if [[ "${entry}" =~ ${TMP_REGEX} ]] || [[ "${entry}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then + if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2f005e7d2c50cb4a5586ad8d77b16dee4b49e130 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:43:25 2015 +0200 macbuild.sh: add the correct file path to the library bundling array. --- debian/changelog | 1 + macbuild.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0a0b0fb..ddbf5fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -111,6 +111,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium directories. - macbuild.sh: check current file name against regex, not a (now) full path. + - macbuild.sh: add the correct file path to the library bundling array. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index d0d5f8a..b15d62a 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -222,7 +222,8 @@ for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then # Filename matched the expected template. - PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${cur_lib_or_libdir}/${entry}")" ) + echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) fi done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) else -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e434544d78d0aeadaeaea9342db92241912d99dd Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Jul 30 04:45:40 2015 +0200 macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. Will need testing. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ddbf5fc..3754a4f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -112,6 +112,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: check current file name against regex, not a (now) full path. - macbuild.sh: add the correct file path to the library bundling array. + - macbuild.sh: when actually bundling libraries, use @executable_path + instead of @loader_path. Will need testing. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index b15d62a..b3a6203 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -328,7 +328,7 @@ if [ "${BUNDLE}" = "1" ]; then --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ --bundle-deps \ --dest-dir "${FRAMEWORKS_DIR}/" \ - --install-path "@loader_path/$(repeat_str "../" "${nesting_level}")Frameworks/" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/" \ --create-dir \ --overwrite-files fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 59186315e1affa38bc4e5fe8a76669579a171cb6 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:55:14 2015 +0200 macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. Helps debugging. --- debian/changelog | 2 ++ macbuild.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3754a4f..3320528 100644 --- a/debian/changelog +++ b/debian/changelog @@ -114,6 +114,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: add the correct file path to the library bundling array. - macbuild.sh: when actually bundling libraries, use @executable_path instead of @loader_path. Will need testing. + - macbuild.sh: fix echo call to also show the intermediate lib dir, not + just the library file name. Helps debugging. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index b3a6203..0a974b6 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -320,7 +320,7 @@ if [ "${BUNDLE}" = "1" ]; then if [ ! -L "${cur_binary}" ]; then cur_binary_name="$(basename "${cur_binary}")" - echo "Handling ${cur_binary} => ${cur_binary_name}." + echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 765dcfb8400d74e25f3132b6e4a5a28d2f7d9c16 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:56:29 2015 +0200 macbuild.sh: also install libraries into staging area with intermediate library path. Putting everything into a single place is a stupid idea. --- debian/changelog | 2 ++ macbuild.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3320528..a4040f1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -116,6 +116,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium instead of @loader_path. Will need testing. - macbuild.sh: fix echo call to also show the intermediate lib dir, not just the library file name. Helps debugging. + - macbuild.sh: also install libraries into staging area with intermediate + library path. Putting everything into a single place is a stupid idea. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 0a974b6..26f0d7e 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -327,8 +327,8 @@ if [ "${BUNDLE}" = "1" ]; then dylibbundler \ --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/" \ - --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/" \ + --dest-dir "${FRAMEWORKS_DIR}/${intermediate_lib_dir}" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ --create-dir \ --overwrite-files fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c530eef9a151002918a2f7e02588e11d15eff9b2 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 20:57:41 2015 +0200 deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. --- debian/changelog | 2 ++ deduplicate.sh | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/debian/changelog b/debian/changelog index a4040f1..e418e3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -118,6 +118,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium just the library file name. Helps debugging. - macbuild.sh: also install libraries into staging area with intermediate library path. Putting everything into a single place is a stupid idea. + - deduplicate.sh: add new, more or less Proof of Concept, and Work in + Progress file deduplication script. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh new file mode 100755 index 0000000..7c4de14 --- /dev/null +++ b/deduplicate.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +typeset base_dir="" +base_dir="${1:?"No base dir given."}" + +typeset -a special_files_regex +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) + +typeset -a all_files +typeset entry="" +while read -r -d '' entry; do + all_files+=( "${entry}" ) +done < <(find "${base_dir}" -type 'f' -print0) + +typeset -a top_files +for entry in ${all_files[@]}; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi +done + +typeset -a duplicates +for entry in ${all_files[@]}; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in ${top_files[@]}; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done +done + +echo "duplicates array before:" +for entry in ${duplicates[@]}; do + echo "${entry}" +done + +typeset -i i="0" +for ((i = 0; i < ${#duplicates[@]}; ++i)); do + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in ${special_files_regex[@]}; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done +done + +echo "duplicates array after:" +for entry in ${duplicates[@]}; do + echo "${entry}" +done + +for entry in ${duplicates[@]}; do + echo "rm -v ${base_dir}/${entry}" + typeset -i i="0" + for ((i = 0; i < ${#all_files[@]}; ++i)); do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + all_files[${i}]="" + fi + done +done + +echo "New value for all_files:" +for entry in ${all_files[@]}; do + echo "${entry}" +done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0fb2a1bb115b4527712920b1c8c5f1bf7e8f601b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 21:40:13 2015 +0200 deduplicate.sh: add duplicates-to-real mapping. --- debian/changelog | 1 + deduplicate.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/debian/changelog b/debian/changelog index e418e3b..2ea6a26 100644 --- a/debian/changelog +++ b/debian/changelog @@ -120,6 +120,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium library path. Putting everything into a single place is a stupid idea. - deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. + - deduplicate.sh: add duplicates-to-real mapping. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 7c4de14..19dc584 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -77,3 +77,31 @@ echo "New value for all_files:" for entry in ${all_files[@]}; do echo "${entry}" done + +echo "Duplicates-to-real map:" +# Build complementary array to duplicates. +typeset -a to_files +for entry in ${duplicates[@]}; do + typeset filename="$(basename "${entry}")" + + for all_entry in ${all_files[@]}; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + to_files+=( "${all_entry}" ) + + echo "${entry} => ${all_entry}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "WARNING: empty file name while matching duplicates with non-duplicates." >&2 + echo "WARNING: duplicate entry: \"${entry}\"" >&2 + echo "WARNING: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done +done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 39e861f6cb0649edbfeff1c3b313d780712ceb4f Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 22:26:52 2015 +0200 deduplicate.sh: add missed local variable declaration. --- debian/changelog | 1 + deduplicate.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2ea6a26..fc980f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -121,6 +121,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add new, more or less Proof of Concept, and Work in Progress file deduplication script. - deduplicate.sh: add duplicates-to-real mapping. + - deduplicate.sh: add missed local variable declaration. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 19dc584..30fd3ad 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -84,6 +84,7 @@ typeset -a to_files for entry in ${duplicates[@]}; do typeset filename="$(basename "${entry}")" + typeset all_entry="" for all_entry in ${all_files[@]}; do typeset all_entry_filename="$(basename "${all_entry}")" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ec0269c7f6beaa9b06e353be5c8087a37903db90 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Aug 26 22:28:09 2015 +0200 deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. --- debian/changelog | 2 ++ deduplicate.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/debian/changelog b/debian/changelog index fc980f7..01ce722 100644 --- a/debian/changelog +++ b/debian/changelog @@ -122,6 +122,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium Progress file deduplication script. - deduplicate.sh: add duplicates-to-real mapping. - deduplicate.sh: add missed local variable declaration. + - deduplicate.sh: new function for parsing otool's output and printing + library dependencies if no error occurred. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 30fd3ad..a5b59e9 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -6,6 +6,33 @@ base_dir="${1:?"No base dir given."}" typeset -a special_files_regex special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +typeset -a otool_fail_str +otool_fail_str=( "is not an object file" + "can't open file" + "Archive : " ) + +parse_otool_output() { + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in ${otool_fail_str}; do + if ! echo "${raw_output}" | grep -q "${fail_str}"; then + exit 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + echo "${BASH_REMATCH[1]}" + fi + done <<< "${raw_output}" + + exit 0 +} + typeset -a all_files typeset entry="" while read -r -d '' entry; do -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ceaa0c6ff85efaa9fce51d9e0097a3e00488da9d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 03:56:21 2015 +0200 deduplicate.sh: non-functional: change WARNING to ERROR in error messages. --- debian/changelog | 2 ++ deduplicate.sh | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 01ce722..368cee7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -124,6 +124,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add missed local variable declaration. - deduplicate.sh: new function for parsing otool's output and printing library dependencies if no error occurred. + - deduplicate.sh: non-functional: change WARNING to ERROR in error + messages. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index a5b59e9..41d2cbf 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -126,9 +126,9 @@ for entry in ${duplicates[@]}; do break fi else - echo "WARNING: empty file name while matching duplicates with non-duplicates." >&2 - echo "WARNING: duplicate entry: \"${entry}\"" >&2 - echo "WARNING: real entry: \"${all_entry}\"" >&2 + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 exit 1 fi done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 84060c4baf9116418986313c9b760cab68c3b60f Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 03:57:10 2015 +0200 deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. --- debian/changelog | 2 ++ deduplicate.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/debian/changelog b/debian/changelog index 368cee7..acc75d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -126,6 +126,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium library dependencies if no error occurred. - deduplicate.sh: non-functional: change WARNING to ERROR in error messages. + - deduplicate.sh: add first skeleton for library dependency rewriting of + deleted duplicates. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 41d2cbf..ddf5984 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -133,3 +133,33 @@ for entry in ${duplicates[@]}; do fi done done + +# Try to fixup files broken by duplicates removal. +for all_entry in ${all_files[@]}; do + typeset otool_out="$(otool -L "${all_entry}")" + + typeset dependencies="$(parse_otool_output "${otool_out}")" + if [ "${?}" -eq 0 ]; then + typeset line="" + while read -r line; do + typeset dependencies_filename="$(basename "${line}")" + + typeset duplicate_entry="" + for duplicate_entry in ${duplicates[@]}; do + typeset duplicate_filename="$(basename "${duplicate_entry}")" + + if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then + + else + echo "ERROR: empty file name while duplicates with dependencies." >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "ERROR: otool returned error for file: ${all_entry}" >&2 + exit 1 + fi +done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2a16ae329f152e9080fef4367928aa79e3258992 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:46:07 2015 +0200 deduplicate.sh: correctly unset an array element. --- debian/changelog | 1 + deduplicate.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index acc75d3..77fb13f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -128,6 +128,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium messages. - deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. + - deduplicate.sh: correctly unset an array element. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index ddf5984..b7d066a 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -95,7 +95,7 @@ for entry in ${duplicates[@]}; do typeset all_entry="${all_files[${i}]}" typeset relative_path="${all_entry##"${base_dir}/"}" if [ "${relative_path}" = "${entry}" ]; then - all_files[${i}]="" + unset all_files[${i}] fi done done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c3f6f6008f2e044d88a093ba1986b67c7c889607 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:48:32 2015 +0200 deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. --- debian/changelog | 2 ++ deduplicate.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 77fb13f..e522e97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -129,6 +129,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add first skeleton for library dependency rewriting of deleted duplicates. - deduplicate.sh: correctly unset an array element. + - deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle + "sparse" arrays correctly. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index b7d066a..d932fbb 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -70,7 +70,7 @@ for entry in ${duplicates[@]}; do done typeset -i i="0" -for ((i = 0; i < ${#duplicates[@]}; ++i)); do +for i in "${!duplicates[@]}"; do entry="${duplicates[${i}]}" typeset special_file_regex="" for special_file_regex in ${special_files_regex[@]}; do @@ -91,7 +91,7 @@ done for entry in ${duplicates[@]}; do echo "rm -v ${base_dir}/${entry}" typeset -i i="0" - for ((i = 0; i < ${#all_files[@]}; ++i)); do + for i in "${!all_files[@]}"; do typeset all_entry="${all_files[${i}]}" typeset relative_path="${all_entry##"${base_dir}/"}" if [ "${relative_path}" = "${entry}" ]; then -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit abf719b367817cb47ea89b44ea4ae9c55b67fdca Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:51:07 2015 +0200 deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. --- debian/changelog | 2 ++ deduplicate.sh | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index e522e97..27b1d21 100644 --- a/debian/changelog +++ b/debian/changelog @@ -131,6 +131,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: correctly unset an array element. - deduplicate.sh: change range-based for loops to "${!arr[@]}" to handle "sparse" arrays correctly. + - deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word + splitting. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index d932fbb..33c4628 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -40,7 +40,7 @@ while read -r -d '' entry; do done < <(find "${base_dir}" -type 'f' -print0) typeset -a top_files -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset tmp_regex='^[^/]+$' if [[ "${relative_path}" =~ ${tmp_regex} ]]; then @@ -50,11 +50,11 @@ for entry in ${all_files[@]}; do done typeset -a duplicates -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset file_name="$(basename "${entry}")" typeset top_entry="" - for top_entry in ${top_files[@]}; do + for top_entry in "${top_files[@]}"; do if [ "${top_entry}" != "${relative_path}" ]; then if [ "${file_name}" = "${top_entry}" ]; then echo "Adding duplicate: ${relative_path}" @@ -65,7 +65,7 @@ for entry in ${all_files[@]}; do done echo "duplicates array before:" -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "${entry}" done @@ -73,7 +73,7 @@ typeset -i i="0" for i in "${!duplicates[@]}"; do entry="${duplicates[${i}]}" typeset special_file_regex="" - for special_file_regex in ${special_files_regex[@]}; do + for special_file_regex in "${special_files_regex[@]}"; do typeset tmp_regex='^'"${special_file_regex}"'$' if [[ "${entry}" =~ ${tmp_regex} ]]; then echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" @@ -84,11 +84,11 @@ for i in "${!duplicates[@]}"; do done echo "duplicates array after:" -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "${entry}" done -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do echo "rm -v ${base_dir}/${entry}" typeset -i i="0" for i in "${!all_files[@]}"; do @@ -101,18 +101,18 @@ for entry in ${duplicates[@]}; do done echo "New value for all_files:" -for entry in ${all_files[@]}; do +for entry in "${all_files[@]}"; do echo "${entry}" done echo "Duplicates-to-real map:" # Build complementary array to duplicates. typeset -a to_files -for entry in ${duplicates[@]}; do +for entry in "${duplicates[@]}"; do typeset filename="$(basename "${entry}")" typeset all_entry="" - for all_entry in ${all_files[@]}; do + for all_entry in "${all_files[@]}"; do typeset all_entry_filename="$(basename "${all_entry}")" if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then @@ -135,7 +135,7 @@ for entry in ${duplicates[@]}; do done # Try to fixup files broken by duplicates removal. -for all_entry in ${all_files[@]}; do +for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" typeset dependencies="$(parse_otool_output "${otool_out}")" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit c7fafa71f5b9b697a0dfd3da5925e1e71fa73312 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:53:44 2015 +0200 deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. --- debian/changelog | 3 +++ deduplicate.sh | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 27b1d21..a0715b9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -133,6 +133,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium "sparse" arrays correctly. - deduplicate.sh: quote "${arr[@]}" correctly to not suddenly force word splitting. + - deduplicate.sh: fix parse_otool_output: we want to return failure only + iff any of the strings are present in otool's output and actually handle + the failure string *ARRAY* correctly as that. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 33c4628..939eb55 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -15,9 +15,9 @@ parse_otool_output() { typeset raw_output="${@}" typeset fail_str="" - for fail_str in ${otool_fail_str}; do - if ! echo "${raw_output}" | grep -q "${fail_str}"; then - exit 1 + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 fi done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e040697fefdb0f19ee71f63b4b97a3b43319ef3e Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:54:58 2015 +0200 deduplicate.sh: change exit to return in parse_otool_output. --- debian/changelog | 1 + deduplicate.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index a0715b9..8e758a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -136,6 +136,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: fix parse_otool_output: we want to return failure only iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. + - deduplicate.sh: change exit to return in parse_otool_output. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 939eb55..235d4b1 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -30,7 +30,7 @@ parse_otool_output() { fi done <<< "${raw_output}" - exit 0 + return 0 } typeset -a all_files -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ce08cb5f65ea318128208fb5972f4ba1d68c7800 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:56:56 2015 +0200 deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. --- debian/changelog | 2 ++ deduplicate.sh | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8e758a5..7b09e5c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -137,6 +137,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium iff any of the strings are present in otool's output and actually handle the failure string *ARRAY* correctly as that. - deduplicate.sh: change exit to return in parse_otool_output. + - deduplicate.sh: record crafted "library path" values in duplicates + replacement to_files array. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 235d4b1..ab86a0b 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -117,9 +117,10 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - to_files+=( "${all_entry}" ) + typeset dependency_format="@executable_path/../Frameworks/${all_entry##${base_dir}}" + to_files+=( "${dependency_format}" ) - echo "${entry} => ${all_entry}" + echo "${entry} => ${dependency_format}" # There should be only one entry matching, so we can save a bit of time and break out of the loop. # Even more importantly, we only want one entry for each duplicates entry anyway... -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit eff41789ab12532ab1e9011189225581a992e678 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:57:54 2015 +0200 deduplicate.sh: debug parse_otool_output fiercely for the time being. --- debian/changelog | 1 + deduplicate.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7b09e5c..20276f3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -139,6 +139,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: change exit to return in parse_otool_output. - deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. + - deduplicate.sh: debug parse_otool_output fiercely for the time being. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index ab86a0b..5e1000f 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -12,6 +12,7 @@ otool_fail_str=( "is not an object file" "Archive : " ) parse_otool_output() { +set -x typeset raw_output="${@}" typeset fail_str="" @@ -30,6 +31,7 @@ parse_otool_output() { fi done <<< "${raw_output}" +set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 97aa892c53f0ab1aafafa7ea7cdb911458ea75f7 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 04:59:27 2015 +0200 deduplicate.sh: prevent word splitting when parsing otool's output. We want the raw bits. --- debian/changelog | 2 ++ deduplicate.sh | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 20276f3..4623826 100644 --- a/debian/changelog +++ b/debian/changelog @@ -140,6 +140,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: record crafted "library path" values in duplicates replacement to_files array. - deduplicate.sh: debug parse_otool_output fiercely for the time being. + - deduplicate.sh: prevent word splitting when parsing otool's output. We + want the raw bits. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 5e1000f..93a5c8f 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -24,6 +24,11 @@ set -x typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then @@ -31,6 +36,7 @@ set -x fi done <<< "${raw_output}" + IFS="${oldifs}" set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 92c1b77219e62f1f4df2cdddd46e37276f28f044 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:05:07 2015 +0200 deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. --- debian/changelog | 3 +++ deduplicate.sh | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 4623826..bd82645 100644 --- a/debian/changelog +++ b/debian/changelog @@ -142,6 +142,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: debug parse_otool_output fiercely for the time being. - deduplicate.sh: prevent word splitting when parsing otool's output. We want the raw bits. + - deduplicate.sh: switch to range-based for loop in fixup section for + duplicate array walking as we need to access the same element index in + the replacement array. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 93a5c8f..d625590 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -154,7 +154,9 @@ for all_entry in "${all_files[@]}"; do typeset dependencies_filename="$(basename "${line}")" typeset duplicate_entry="" - for duplicate_entry in ${duplicates[@]}; do + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e801c03766f64128d08d21a76bf61bf35a8bb0e0 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:06:04 2015 +0200 deduplicate.sh: add more useful information in fixup section's error message. --- debian/changelog | 2 ++ deduplicate.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bd82645..cc6a3e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -145,6 +145,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: switch to range-based for loop in fixup section for duplicate array walking as we need to access the same element index in the replacement array. + - deduplicate.sh: add more useful information in fixup section's error + message. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index d625590..7dc6cd0 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -162,7 +162,9 @@ for all_entry in "${all_files[@]}"; do if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then else - echo "ERROR: empty file name while duplicates with dependencies." >&2 + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 echo "ERROR: dependency: \"${line}\"" >&2 exit 1 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 06b19f61db4f38a0d3d1d923ba5cb66c8b522d71 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:07:35 2015 +0200 deduplicate.sh: unstub fixup section. --- debian/changelog | 1 + deduplicate.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cc6a3e7..b589992 100644 --- a/debian/changelog +++ b/debian/changelog @@ -147,6 +147,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium the replacement array. - deduplicate.sh: add more useful information in fixup section's error message. + - deduplicate.sh: unstub fixup section. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 7dc6cd0..08f13df 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -159,8 +159,10 @@ for all_entry in "${all_files[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" - if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}"]; then - + if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then + if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\"" + fi else echo "ERROR: empty file name while replacing duplicate dependencies." >&2 echo "ERROR: for file ${all_entry}" >&2 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d232392603b38332846599cd4362d178a5be05ad Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:17:24 2015 +0200 deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. --- debian/changelog | 2 ++ deduplicate.sh | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b589992..d084819 100644 --- a/debian/changelog +++ b/debian/changelog @@ -148,6 +148,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add more useful information in fixup section's error message. - deduplicate.sh: unstub fixup section. + - deduplicate.sh: parse_otool_output: jump over first matching entry, + which is - hopefully - the id line. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 08f13df..c24705d 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -29,10 +29,19 @@ set -x typeset oldifs="${IFS}" IFS='' + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then - echo "${BASH_REMATCH[1]}" + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi fi done <<< "${raw_output}" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bab2f892103258d6613d4436141c51b2b396786d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 05:18:15 2015 +0200 deduplicate.sh: actually include file name in install_name_tool pseudo output. --- debian/changelog | 2 ++ deduplicate.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d084819..8c51df9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -150,6 +150,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: unstub fixup section. - deduplicate.sh: parse_otool_output: jump over first matching entry, which is - hopefully - the id line. + - deduplicate.sh: actually include file name in install_name_tool pseudo + output. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index c24705d..f020b9c 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -170,7 +170,7 @@ for all_entry in "${all_files[@]}"; do if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then - echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\"" + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" fi else echo "ERROR: empty file name while replacing duplicate dependencies." >&2 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2a33416c5e78dae89006cc39156fc8f4e5da446c Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:36:33 2015 +0200 deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. --- debian/changelog | 2 ++ deduplicate.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8c51df9..085c0d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -152,6 +152,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium which is - hopefully - the id line. - deduplicate.sh: actually include file name in install_name_tool pseudo output. + - deduplicate.sh: save dependency format base string as a readonly + variable and use that instead of repeating a fixed string. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index f020b9c..130a04e 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -6,6 +6,8 @@ base_dir="${1:?"No base dir given."}" typeset -a special_files_regex special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +typeset -r dependency_base_format='@executable_path/../Frameworks/' + typeset -a otool_fail_str otool_fail_str=( "is not an object file" "can't open file" @@ -134,7 +136,7 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="@executable_path/../Frameworks/${all_entry##${base_dir}}" + typeset dependency_format="${dependency_base_format}/${all_entry##${base_dir}}" to_files+=( "${dependency_format}" ) echo "${entry} => ${dependency_format}" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 8737ec4eb50af90ba354315c365db59137745be8 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:39:24 2015 +0200 deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. --- debian/changelog | 2 ++ deduplicate.sh | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 085c0d4..87657eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -154,6 +154,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium output. - deduplicate.sh: save dependency format base string as a readonly variable and use that instead of repeating a fixed string. + - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. + deduplicate.sh will eventually be merged into macbuild.sh anyway. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 130a04e..dadf334 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -52,6 +52,18 @@ set +x return 0 } +lazy_canonical_path() { + typeset path="${1}" + + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done + + printf "${old_path}" +} + typeset -a all_files typeset entry="" while read -r -d '' entry; do -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 11f3aba2e456c8c6b5532e02301f1b257913e021 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:40:46 2015 +0200 deduplicate.sh: more temporary debugging output in fixup section. --- debian/changelog | 1 + deduplicate.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 87657eb..e18c16e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -156,6 +156,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium variable and use that instead of repeating a fixed string. - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. + - deduplicate.sh: more temporary debugging output in fixup section. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index dadf334..12732a4 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -175,12 +175,14 @@ for all_entry in "${all_files[@]}"; do typeset line="" while read -r line; do typeset dependencies_filename="$(basename "${line}")" + echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" typeset duplicate_filename="$(basename "${duplicate_entry}")" + echo "checking for duplicate ${duplicate_entry}" if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bf1f5b95ea53e9100df91514b0239489b2fc88f1 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:43:31 2015 +0200 deduplicate.sh: surprisingly, it turned out that only checking the duplicate's basename against the current dependency's basename is not good enough. Actually construct "the real dependency-format duplicate string" and check it against "the real dependency". Even this is still not good enough as it needs a bit cleanup - coming up next. --- debian/changelog | 5 +++++ deduplicate.sh | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index e18c16e..5ec92c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -157,6 +157,11 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: copy lazy_canonical_path from macbuild.sh for now. deduplicate.sh will eventually be merged into macbuild.sh anyway. - deduplicate.sh: more temporary debugging output in fixup section. + - deduplicate.sh: surprisingly, it turned out that only checking the + duplicate's basename against the current dependency's basename is not + good enough. Actually construct "the real dependency-format duplicate + string" and check it against "the real dependency". Even this is still + not good enough as it needs a bit cleanup - coming up next. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 12732a4..7df0698 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -174,18 +174,17 @@ for all_entry in "${all_files[@]}"; do if [ "${?}" -eq 0 ]; then typeset line="" while read -r line; do - typeset dependencies_filename="$(basename "${line}")" echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" - typeset duplicate_filename="$(basename "${duplicate_entry}")" echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="${dependency_base_format}/${duplicate_entry}" - if [ -n "${dependencies_filename}" ] && [ -n "${duplicate_filename}" ]; then - if [ "${dependencies_filename}" = "${duplicate_filename}" ]; then + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" fi else -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0e2f781f4f74641864bf4ca8656a050b4bfd0844 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 20:50:45 2015 +0200 deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. --- debian/changelog | 2 ++ deduplicate.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5ec92c7..a78fdab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -162,6 +162,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium good enough. Actually construct "the real dependency-format duplicate string" and check it against "the real dependency". Even this is still not good enough as it needs a bit cleanup - coming up next. + - deduplicate.sh: cleanup as announced in the last commit - using + lazy_canonical_path. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 7df0698..f8e5668 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -148,7 +148,7 @@ for entry in "${duplicates[@]}"; do if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="${dependency_base_format}/${all_entry##${base_dir}}" + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" to_files+=( "${dependency_format}" ) echo "${entry} => ${dependency_format}" @@ -181,7 +181,7 @@ for all_entry in "${all_files[@]}"; do for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" echo "checking for duplicate ${duplicate_entry}" - typeset duplicate_format="${dependency_base_format}/${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then if [ "${line}" = "${duplicate_format}" ]; then -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 8e33c924ce707f9900be2028fda16fecb8eeb099 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Aug 27 21:01:45 2015 +0200 deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. --- debian/changelog | 2 ++ deduplicate.sh | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a78fdab..5b9d57a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -164,6 +164,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium not good enough as it needs a bit cleanup - coming up next. - deduplicate.sh: cleanup as announced in the last commit - using lazy_canonical_path. + - deduplicate.sh: remove a bit of noisy debug output, but turn on + parse_otool_output debugging. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index f8e5668..e357529 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -171,16 +171,17 @@ for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" typeset dependencies="$(parse_otool_output "${otool_out}")" - if [ "${?}" -eq 0 ]; then + echo "parse_otool_output return value: ${?}" + if [ "${?}" -eq "0" ]; then typeset line="" while read -r line; do - echo "dependency of ${all_entry}: ${line}" + #echo "dependency of ${all_entry}: ${line}" typeset duplicate_entry="" typeset -i i="0" for i in "${!duplicates[@]}"; do typeset duplicate_entry="${duplicates[${i}]}" - echo "checking for duplicate ${duplicate_entry}" + #echo "checking for duplicate ${duplicate_entry}" typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e650e53c7e8c1e90b4117b7bf6a783eec53d497a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:39:26 2015 +0200 deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". --- debian/changelog | 2 ++ deduplicate.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5b9d57a..27c383d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -166,6 +166,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium lazy_canonical_path. - deduplicate.sh: remove a bit of noisy debug output, but turn on parse_otool_output debugging. + - deduplicate.sh: fix wrong return value capture. We want to check the + return value of the executed function/command, not that of "typeset". [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index e357529..98f0b26 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -170,8 +170,12 @@ done for all_entry in "${all_files[@]}"; do typeset otool_out="$(otool -L "${all_entry}")" - typeset dependencies="$(parse_otool_output "${otool_out}")" - echo "parse_otool_output return value: ${?}" + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + if [ "${?}" -eq "0" ]; then typeset line="" while read -r line; do -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 39bde7f1029a17c7ab83dd9c09a9770905780a00 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:40:35 2015 +0200 deduplicate.sh: add WARNING to status message. --- debian/changelog | 1 + deduplicate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 27c383d..7503bc2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -168,6 +168,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium parse_otool_output debugging. - deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". + - deduplicate.sh: add WARNING to status message. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 98f0b26..26182d4 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -203,7 +203,7 @@ for all_entry in "${all_files[@]}"; do done done <<< "${dependencies}" else - echo "ERROR: otool returned error for file: ${all_entry}" >&2 - exit 1 + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 fi done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6af973fee6f2fad114d124b0870c7d087f5f02a7 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:42:40 2015 +0200 deduplicate.sh: remove some noisy debug output. --- debian/changelog | 1 + deduplicate.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7503bc2..b0fee3c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -169,6 +169,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: fix wrong return value capture. We want to check the return value of the executed function/command, not that of "typeset". - deduplicate.sh: add WARNING to status message. + - deduplicate.sh: remove some noisy debug output. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index 26182d4..c298194 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -14,7 +14,7 @@ otool_fail_str=( "is not an object file" "Archive : " ) parse_otool_output() { -set -x +#set -x typeset raw_output="${@}" typeset fail_str="" @@ -48,7 +48,7 @@ set -x done <<< "${raw_output}" IFS="${oldifs}" -set +x +#set +x return 0 } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 94d439f48f0076ee625a385a6f433642c0733cdb Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:48:48 2015 +0200 macbuild.sh: replace tabs with two spaces. No functional changes. --- debian/changelog | 1 + macbuild.sh | 394 +++++++++++++++++++++++++++--------------------------- 2 files changed, 198 insertions(+), 197 deletions(-) diff --git a/debian/changelog b/debian/changelog index b0fee3c..b77391f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -170,6 +170,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium return value of the executed function/command, not that of "typeset". - deduplicate.sh: add WARNING to status message. - deduplicate.sh: remove some noisy debug output. + - macbuild.sh: replace tabs with two spaces. No functional changes. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 26f0d7e..80999bd 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -1,100 +1,100 @@ #!/bin/bash make_boolean() { - OPTION="${1}" + OPTION="${1}" - case "${OPTION}" in - ("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";; - (*) OPTION="1";; - esac + case "${OPTION}" in + ("0"|"no"|""|"No"|"nO"|"NO"|"false"|"FALSE") OPTION="0";; + (*) OPTION="1";; + esac - printf "${OPTION}" + printf "${OPTION}" } phase() { - echo - echo "***" - echo "*** ${1}..." - echo "***" - echo + echo + echo "***" + echo "*** ${1}..." + echo "***" + echo } usage() { - exec >&2 - - NO_VAL="0, no, NO, No, nO, false or FALSE" - printf "$(basename ${0}): usage\n\n" - printf "Accepted environment variables:\n" - printf "\tSDK:\t\t\t\tsets the target SDK [string]\n\t\t\t\t\tdefault: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk\n" - printf "\tMACOSX_DEPLOYMENT_TARGET:\tsets the deployment target (specific OS X version to optimize/build for) [string]\n\t\t\t\t\tdefault: 10.7\n" - printf "\tSTDLIB:\t\t\t\tsets a specific stdlib variant. Must be used with FORCE_STDLIB to have any effect. [string]\n\t\t\t\t\tdefault: autodetect\n" - printf "\tFORCE_STDLIB:\t\t\tforces a specific C++ stdlib version. If you use this, also specify STDLIB. YOU SHOULD NEVER USE THIS, UNLESS YOU KNOW WHAT YOU ARE DOING! [boolean]\n\t\t\t\t\tdefault: disabled\n" - printf "\tDEBUG\t\t\t\tenables or disables debug builds [boolean]\n\t\t\t\t\tdefault: disabled\n" - printf "\tBUNDLE\t\t\t\tenables or disables library bundling and the creation of a .dmg installer [boolean]\n\t\t\t\t\tdefault: enabled\n" - printf "\tUNIVERSAL\t\t\tenables or disables x86 support. x86_64 support is always enabled [boolean]\n\t\t\t\t\tdefault: enabled\n" - printf "\tMACPORTS_PREFIX\t\t\tsets the (MacPorts) prefix used to detect PulseAudio and nxproxy binaries\n\t\t\t\t\tdefault: /opt/local/\n" - printf "\n" - printf "Boolean values help:\n" - printf "\ta value of ${NO_VAL} will be treated as false\n" - printf "\tany other value will be treated as true\n" - - exit 2 + exec >&2 + + NO_VAL="0, no, NO, No, nO, false or FALSE" + printf "$(basename ${0}): usage\n\n" + printf "Accepted environment variables:\n" + printf "\tSDK:\t\t\t\tsets the target SDK [string]\n\t\t\t\t\tdefault: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk\n" + printf "\tMACOSX_DEPLOYMENT_TARGET:\tsets the deployment target (specific OS X version to optimize/build for) [string]\n\t\t\t\t\tdefault: 10.7\n" + printf "\tSTDLIB:\t\t\t\tsets a specific stdlib variant. Must be used with FORCE_STDLIB to have any effect. [string]\n\t\t\t\t\tdefault: autodetect\n" + printf "\tFORCE_STDLIB:\t\t\tforces a specific C++ stdlib version. If you use this, also specify STDLIB. YOU SHOULD NEVER USE THIS, UNLESS YOU KNOW WHAT YOU ARE DOING! [boolean]\n\t\t\t\t\tdefault: disabled\n" + printf "\tDEBUG\t\t\t\tenables or disables debug builds [boolean]\n\t\t\t\t\tdefault: disabled\n" + printf "\tBUNDLE\t\t\t\tenables or disables library bundling and the creation of a .dmg installer [boolean]\n\t\t\t\t\tdefault: enabled\n" + printf "\tUNIVERSAL\t\t\tenables or disables x86 support. x86_64 support is always enabled [boolean]\n\t\t\t\t\tdefault: enabled\n" + printf "\tMACPORTS_PREFIX\t\t\tsets the (MacPorts) prefix used to detect PulseAudio and nxproxy binaries\n\t\t\t\t\tdefault: /opt/local/\n" + printf "\n" + printf "Boolean values help:\n" + printf "\ta value of ${NO_VAL} will be treated as false\n" + printf "\tany other value will be treated as true\n" + + exit 2 } dependency_error() { - exec >&2 + exec >&2 - typeset element="${1}"; shift - typeset component="${1}"; shift - typeset type="${1}"; shift + typeset element="${1}"; shift + typeset component="${1}"; shift + typeset type="${1}"; shift - echo "${element} ${type} not found." - echo "Install ${component} -- e.g., via "port -vt install ${component}" if using MacPorts." - echo "If ${component} is already installed, try passing MACPORTS_PREFIX if the autodetected or default value (${MACPORTS_PREFIX}) does not match your setup." + echo "${element} ${type} not found." + echo "Install ${component} -- e.g., via "port -vt install ${component}" if using MacPorts." + echo "If ${component} is already installed, try passing MACPORTS_PREFIX if the autodetected or default value (${MACPORTS_PREFIX}) does not match your setup." - exit 3 + exit 3 } lazy_canonical_path() { - typeset path="${1}" + typeset path="${1}" - typeset old_path="" - while [ "${old_path}" != "${path}" ]; do - old_path="${path}" - path="${path//\/\///}" - done + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done - printf "${old_path}" + printf "${old_path}" } get_nesting_level() { set -x - typeset -i level=0 - typeset path="${1}" + typeset -i level=0 + typeset path="${1}" - while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do - i="$((${i} + 1))" - path="$(dirname "${path}")" - done + while [ -n "${path}" ] && [ "${path}" != "." ] && [ "${path}" != "/" ]; do + i="$((${i} + 1))" + path="$(dirname "${path}")" + done - printf "${level}" + printf "${level}" set +x } repeat_str() { # INPUT COUNT - typeset INPUT="${1:?"Error: no input string passed to ${FUNCNAME}()."}" - typeset COUNT="${2:?"Error: no count passed to ${FUNCNAME}()."}" + typeset INPUT="${1:?"Error: no input string passed to ${FUNCNAME}()."}" + typeset COUNT="${2:?"Error: no count passed to ${FUNCNAME}()."}" - typeset ret="" - typeset -i i=0 - while [ "${i}" -lt "${COUNT}" ]; do - ret="${ret}$(printf "${INPUT}")" - i=$((${i} + 1)) - done + typeset ret="" + typeset -i i=0 + while [ "${i}" -lt "${COUNT}" ]; do + ret="${ret}$(printf "${INPUT}")" + i=$((${i} + 1)) + done - printf "${ret}" + printf "${ret}" - return 0 + return 0 } MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' @@ -115,12 +115,12 @@ PKG_DMG="${TOP_DIR}/pkg-dmg" # Try to find the MacPorts prefix. typeset MACPORTS_PREFIX_SEARCH="" if type -P port >/dev/null 2>&1; then - MACPORTS_PREFIX_SEARCH="$(type -P port)" - MACPORTS_PREFIX_SEARCH="${MACPORTS_PREFIX_SEARCH%%bin/port}" + MACPORTS_PREFIX_SEARCH="$(type -P port)" + MACPORTS_PREFIX_SEARCH="${MACPORTS_PREFIX_SEARCH%%bin/port}" else - # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. - # Try to guess. - MACPORTS_PREFIX_SEARCH="/opt/local/" + # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. + # Try to guess. + MACPORTS_PREFIX_SEARCH="/opt/local/" fi NXPROXY="nxproxy" @@ -151,25 +151,25 @@ BUILD_ARCH="x86_64" [ "${UNIVERSAL}" -eq "1" ] && BUILD_ARCH="${BUILD_ARCH} x86" if [ "${FORCE_STDLIB}" -eq "1" ]; then - if [[ -z "${STDLIB}" ]]; then - echo "stdlib forcing enabled, but STDLIB not passed." >&2 - exit 1 - fi - - if [[ "${STDLIB}" != "libc++" && "${STDLIB}" != "libstdc++" ]]; then - echo "stdlib forcing enabled, but STDLIB contains illegal value. Legal values: libc++, libstdc++" >&2 - exit 1 - fi + if [[ -z "${STDLIB}" ]]; then + echo "stdlib forcing enabled, but STDLIB not passed." >&2 + exit 1 + fi + + if [[ "${STDLIB}" != "libc++" && "${STDLIB}" != "libstdc++" ]]; then + echo "stdlib forcing enabled, but STDLIB contains illegal value. Legal values: libc++, libstdc++" >&2 + exit 1 + fi else - SDK_MINOR_VERSION="$(/usr/bin/perl -pe 's#.*?10\.(\d+).*?\.sdk$#\1#' <<< "${SDK}")" - MATCH_NUMBERS='^[0-9]+$' - if [[ "${SDK_MINOR_VERSION}" =~ ${MATCH_NUMBERS} ]]; then - [ "${SDK_MINOR_VERSION}" -gt "6" ] && STDLIB="libstdc++" - [ "${SDK_MINOR_VERSION}" -gt "8" ] && STDLIB="libc++" - else - echo "Unable to determine OS X version. Unknown value '${SDK_MINOR_VERSION}'." >&2 - exit 1 - fi + SDK_MINOR_VERSION="$(/usr/bin/perl -pe 's#.*?10\.(\d+).*?\.sdk$#\1#' <<< "${SDK}")" + MATCH_NUMBERS='^[0-9]+$' + if [[ "${SDK_MINOR_VERSION}" =~ ${MATCH_NUMBERS} ]]; then + [ "${SDK_MINOR_VERSION}" -gt "6" ] && STDLIB="libstdc++" + [ "${SDK_MINOR_VERSION}" -gt "8" ] && STDLIB="libc++" + else + echo "Unable to determine OS X version. Unknown value '${SDK_MINOR_VERSION}'." >&2 + exit 1 + fi fi # Gather files. @@ -183,14 +183,14 @@ typeset -a PULSEAUDIO_BINARIES_FULL typeset cur_binary fail="0" for cur_binary in ${PULSEAUDIO_BINARIES[@]}; do - cur_binary="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${cur_binary}")" - - if [ -x "${cur_binary}" ]; then - PULSEAUDIO_BINARIES_FULL+=( "${cur_binary}" ) - else - fail="1" - break - fi + cur_binary="$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/${cur_binary}")" + + if [ -x "${cur_binary}" ]; then + PULSEAUDIO_BINARIES_FULL+=( "${cur_binary}" ) + else + fail="1" + break + fi done [ "${fail}" -eq "1" ] && dependency_error "${cur_binary##"$(lazy_canonical_path "${MACPORTS_PREFIX}/bin/")"}" "pulseaudio" "binary" @@ -199,37 +199,37 @@ typeset cur_lib_or_libdir typeset -a PULSEAUDIO_LIBRARIES_FULL fail="0" for cur_lib_or_libdir in ${PULSEAUDIO_LIBRARIES[@]}; do - cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" - - if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then - echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" - PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) - elif [ -d "${cur_lib_or_libdir}" ]; then - # That's a directory... more work needed here. - echo "Scrubbing directory ${cur_lib_or_libdir}" - typeset entry="" - - # -r parameter to read: Backslashes may NOT escape any characters! - # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed - # by a NUL character, the delimiter is set to this very NUL (\000) character. - while read -r -d '' entry; do - typeset cur_file="$(basename "${entry}")" - typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' - - # This is only here should the PA build system ever break and create - # "linux-style" library file names. Let's hope it never actually comes to that. - typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' - - if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then - # Filename matched the expected template. - echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" - PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) - fi - done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) - else - fail="1" - break - fi + cur_lib_or_libdir="$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/${cur_lib_or_libdir}")" + + if [ ! -d "${cur_lib_or_libdir}" ] && [ -x "${cur_lib_or_libdir}" ]; then + echo "Adding ${cur_lib_or_libdir} to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "${cur_lib_or_libdir}" ) + elif [ -d "${cur_lib_or_libdir}" ]; then + # That's a directory... more work needed here. + echo "Scrubbing directory ${cur_lib_or_libdir}" + typeset entry="" + + # -r parameter to read: Backslashes may NOT escape any characters! + # -d '': specifies the delimiter to be used - as '' resolves to an empty string followed + # by a NUL character, the delimiter is set to this very NUL (\000) character. + while read -r -d '' entry; do + typeset cur_file="$(basename "${entry}")" + typeset TMP_REGEX='^.*\.(\.[0-9]+){0,2}(so|dylib|bundle)$' + + # This is only here should the PA build system ever break and create + # "linux-style" library file names. Let's hope it never actually comes to that. + typeset TMP_REGEX_LINUX_COMPAT='^.*\.(so|dylib|bundle)(\.[0-9]+){0,2}$' + + if [[ "${cur_file}" =~ ${TMP_REGEX} ]] || [[ "${cur_file}" =~ ${TMP_REGEX_LINUX_COMPAT} ]]; then + # Filename matched the expected template. + echo "Adding $(lazy_canonical_path "${entry}") to \${PULSEAUDIO_LIBRARIES_FULL}" + PULSEAUDIO_LIBRARIES_FULL+=( "$(lazy_canonical_path "${entry}")" ) + fi + done < <(find "${cur_lib_or_libdir}" -type 'f' -print0) + else + fail="1" + break + fi done [ "${fail}" -eq "1" ] && dependency_error "${cur_lib_or_libdir}" "pulseaudio" "library or library directory" @@ -256,12 +256,12 @@ lrelease "${PROJECT}" phase "Running qmake" qmake -config "${BUILD_MODE}" -spec macx-g++ "${PROJECT}" \ - CONFIG+="${BUILD_ARCH}" \ - QMAKE_MAC_SDK="${SDK}" \ - QMAKE_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \ - OSX_STDLIB="${STDLIB}" \ - MACPORTS_INCLUDE_PATH="${MACPORTS_PREFIX}/include" \ - MACPORTS_LIBRARY_PATH="${MACPORTS_PREFIX}/lib" + CONFIG+="${BUILD_ARCH}" \ + QMAKE_MAC_SDK="${SDK}" \ + QMAKE_MACOSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \ + OSX_STDLIB="${STDLIB}" \ + MACPORTS_INCLUDE_PATH="${MACPORTS_PREFIX}/include" \ + MACPORTS_LIBRARY_PATH="${MACPORTS_PREFIX}/lib" phase "Running make" make -j2 @@ -274,84 +274,84 @@ cp -av "${NXPROXY}" "${EXE_DIR}/" phase "Copying PulseAudio" for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do - cp -av "${cur_binary}" "${EXE_DIR}/" + cp -av "${cur_binary}" "${EXE_DIR}/" done typeset intermediate_lib_dir="" for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do set -x - intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" - intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" - mkdir -p "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" + mkdir -p "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" - cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" + cp -av "${cur_binary}" "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/" set +x done if [ "${BUNDLE}" = "1" ]; then - phase "Bundling nxproxy" - dylibbundler \ - --fix-file "${EXE_DIR}/nxproxy" \ - --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/" \ - --install-path "@executable_path/../Frameworks/" \ - --create-dir - - phase "Bundling PulseAudio" - typeset cur_binary_name="" - for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do - if [ ! -L "${cur_binary}" ]; then - cur_binary_name="$(basename "${cur_binary}")" - dylibbundler \ - --fix-file "${EXE_DIR}/${cur_binary_name}" \ - --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/" \ - --install-path "@executable_path/../Frameworks/" \ - --create-dir \ - --overwrite-files - fi - done - - typeset intermediate_lib_dir="" - for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do - intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" - intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" - - if [ ! -L "${cur_binary}" ]; then - cur_binary_name="$(basename "${cur_binary}")" - echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." - - typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" - - dylibbundler \ - --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ - --bundle-deps \ - --dest-dir "${FRAMEWORKS_DIR}/${intermediate_lib_dir}" \ - --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ - --create-dir \ - --overwrite-files - fi - done - - phase "Bundling up using macdeployqt" - macdeployqt "${APPBUNDLE}" -verbose=2 - - phase "Creating DMG" - ${PKG_DMG} \ - --source "${APPBUNDLE}" \ - --sourcefile \ - --target "${DMGFILE}" \ - --volname "x2goclient" \ - --verbosity 2 \ - --mkdir "/.background" \ - --copy "${TOP_DIR}/res/img/png/macinstaller_background.png:/.background" \ - --copy "${TOP_DIR}/res/osxbundle/macdmg.DS_Store:/.DS_Store" \ - --copy "${TOP_DIR}/LICENSE" \ - --copy "${TOP_DIR}/COPYING" \ - --symlink "/Applications: " \ - --icon "${TOP_DIR}/res/img/icons/x2go-mac.icns" \ - --format "UDBZ" + phase "Bundling nxproxy" + dylibbundler \ + --fix-file "${EXE_DIR}/nxproxy" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@executable_path/../Frameworks/" \ + --create-dir + + phase "Bundling PulseAudio" + typeset cur_binary_name="" + for cur_binary in ${PULSEAUDIO_BINARIES_FULL[@]}; do + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + dylibbundler \ + --fix-file "${EXE_DIR}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/" \ + --install-path "@executable_path/../Frameworks/" \ + --create-dir \ + --overwrite-files + fi + done + + typeset intermediate_lib_dir="" + for cur_binary in ${PULSEAUDIO_LIBRARIES_FULL[@]}; do + intermediate_lib_dir="$(lazy_canonical_path "$(dirname "${cur_binary}")/")" + intermediate_lib_dir="${intermediate_lib_dir##"$(lazy_canonical_path "${MACPORTS_PREFIX}/lib/")"}" + + if [ ! -L "${cur_binary}" ]; then + cur_binary_name="$(basename "${cur_binary}")" + echo "Handling ${cur_binary} => ${intermediate_lib_dir}/${cur_binary_name}." + + typeset nesting_level="$(get_nesting_level "${intermediate_lib_dir}")" + + dylibbundler \ + --fix-file "${FRAMEWORKS_DIR}/${intermediate_lib_dir}/${cur_binary_name}" \ + --bundle-deps \ + --dest-dir "${FRAMEWORKS_DIR}/${intermediate_lib_dir}" \ + --install-path "@executable_path/$(repeat_str "../" "${nesting_level}")../Frameworks/${intermediate_lib_dir}" \ + --create-dir \ + --overwrite-files + fi + done + + phase "Bundling up using macdeployqt" + macdeployqt "${APPBUNDLE}" -verbose=2 + + phase "Creating DMG" + ${PKG_DMG} \ + --source "${APPBUNDLE}" \ + --sourcefile \ + --target "${DMGFILE}" \ + --volname "x2goclient" \ + --verbosity 2 \ + --mkdir "/.background" \ + --copy "${TOP_DIR}/res/img/png/macinstaller_background.png:/.background" \ + --copy "${TOP_DIR}/res/osxbundle/macdmg.DS_Store:/.DS_Store" \ + --copy "${TOP_DIR}/LICENSE" \ + --copy "${TOP_DIR}/COPYING" \ + --symlink "/Applications: " \ + --icon "${TOP_DIR}/res/img/icons/x2go-mac.icns" \ + --format "UDBZ" fi popd -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0e5b5c0b7be2ad562a229de8b7dd39b52e30e7c2 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 03:50:54 2015 +0200 deduplicate.sh: replace tabs with two spaces. No functional changes. --- debian/changelog | 1 + deduplicate.sh | 290 +++++++++++++++++++++++++++--------------------------- 2 files changed, 146 insertions(+), 145 deletions(-) diff --git a/debian/changelog b/debian/changelog index b77391f..52d8c22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -171,6 +171,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: add WARNING to status message. - deduplicate.sh: remove some noisy debug output. - macbuild.sh: replace tabs with two spaces. No functional changes. + - deduplicate.sh: replace tabs with two spaces. No functional changes. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/deduplicate.sh b/deduplicate.sh index c298194..636ea5c 100755 --- a/deduplicate.sh +++ b/deduplicate.sh @@ -10,200 +10,200 @@ typeset -r dependency_base_format='@executable_path/../Frameworks/' typeset -a otool_fail_str otool_fail_str=( "is not an object file" - "can't open file" - "Archive : " ) + "can't open file" + "Archive : " ) parse_otool_output() { #set -x - typeset raw_output="${@}" - - typeset fail_str="" - for fail_str in "${otool_fail_str[@]}"; do - if echo "${raw_output}" | grep -q "${fail_str}"; then - return 1 - fi - done - - typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' - - - # In this special case, we do not want read to perform any word splitting. - typeset oldifs="${IFS}" - IFS='' - - # Used for skipping the first matching entry - which should typically be the ID line... - # That's a very naïve way to do this. Maybe there should be a bit more magic - # to catch this more reliably. - typeset -i first="1" - - typeset line="" - while read -r line; do - if [[ "${line}" =~ ${tmp_regex} ]]; then - if [ "${first}" -ne "1" ]; then - echo "${BASH_REMATCH[1]}" - else - first="0" - fi - fi - done <<< "${raw_output}" - - IFS="${oldifs}" + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi + fi + done <<< "${raw_output}" + + IFS="${oldifs}" #set +x - return 0 + return 0 } lazy_canonical_path() { - typeset path="${1}" + typeset path="${1}" - typeset old_path="" - while [ "${old_path}" != "${path}" ]; do - old_path="${path}" - path="${path//\/\///}" - done + typeset old_path="" + while [ "${old_path}" != "${path}" ]; do + old_path="${path}" + path="${path//\/\///}" + done - printf "${old_path}" + printf "${old_path}" } typeset -a all_files typeset entry="" while read -r -d '' entry; do - all_files+=( "${entry}" ) + all_files+=( "${entry}" ) done < <(find "${base_dir}" -type 'f' -print0) typeset -a top_files for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" - typeset tmp_regex='^[^/]+$' - if [[ "${relative_path}" =~ ${tmp_regex} ]]; then - echo "${relative_path} is top file, adding to array." - top_files+=( "${relative_path}" ) - fi + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi done typeset -a duplicates for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" - typeset file_name="$(basename "${entry}")" - typeset top_entry="" - for top_entry in "${top_files[@]}"; do - if [ "${top_entry}" != "${relative_path}" ]; then - if [ "${file_name}" = "${top_entry}" ]; then - echo "Adding duplicate: ${relative_path}" - duplicates+=( "${relative_path}" ) - fi - fi - done + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in "${top_files[@]}"; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done done echo "duplicates array before:" for entry in "${duplicates[@]}"; do - echo "${entry}" + echo "${entry}" done typeset -i i="0" for i in "${!duplicates[@]}"; do - entry="${duplicates[${i}]}" - typeset special_file_regex="" - for special_file_regex in "${special_files_regex[@]}"; do - typeset tmp_regex='^'"${special_file_regex}"'$' - if [[ "${entry}" =~ ${tmp_regex} ]]; then - echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" - duplicates[${i}]="$(basename "${entry}")" - echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" - fi - done + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in "${special_files_regex[@]}"; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + echo "mv \"${base_dir}/$(basename "${entry}")\" \"${base_dir}/$(dirname "${special_file_regex}")/\"" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done done echo "duplicates array after:" for entry in "${duplicates[@]}"; do - echo "${entry}" + echo "${entry}" done for entry in "${duplicates[@]}"; do - echo "rm -v ${base_dir}/${entry}" - typeset -i i="0" - for i in "${!all_files[@]}"; do - typeset all_entry="${all_files[${i}]}" - typeset relative_path="${all_entry##"${base_dir}/"}" - if [ "${relative_path}" = "${entry}" ]; then - unset all_files[${i}] - fi - done + echo "rm -v ${base_dir}/${entry}" + typeset -i i="0" + for i in "${!all_files[@]}"; do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + unset all_files[${i}] + fi + done done echo "New value for all_files:" for entry in "${all_files[@]}"; do - echo "${entry}" + echo "${entry}" done echo "Duplicates-to-real map:" # Build complementary array to duplicates. typeset -a to_files for entry in "${duplicates[@]}"; do - typeset filename="$(basename "${entry}")" - - typeset all_entry="" - for all_entry in "${all_files[@]}"; do - typeset all_entry_filename="$(basename "${all_entry}")" - - if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then - if [ "${filename}" = "${all_entry_filename}" ]; then - typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" - to_files+=( "${dependency_format}" ) - - echo "${entry} => ${dependency_format}" - - # There should be only one entry matching, so we can save a bit of time and break out of the loop. - # Even more importantly, we only want one entry for each duplicates entry anyway... - break - fi - else - echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 - echo "ERROR: duplicate entry: \"${entry}\"" >&2 - echo "ERROR: real entry: \"${all_entry}\"" >&2 - exit 1 - fi - done + typeset filename="$(basename "${entry}")" + + typeset all_entry="" + for all_entry in "${all_files[@]}"; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" + to_files+=( "${dependency_format}" ) + + echo "${entry} => ${dependency_format}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done done # Try to fixup files broken by duplicates removal. for all_entry in "${all_files[@]}"; do - typeset otool_out="$(otool -L "${all_entry}")" - - # Don't merge the declaration and initialization with the real value assignment. - # We need the return value of parse_otool_output(), but running - # typeset foo="$(bar)" will give us the return value of typeset, not bar(). - typeset dependencies="" - dependencies="$(parse_otool_output "${otool_out}")" - - if [ "${?}" -eq "0" ]; then - typeset line="" - while read -r line; do - #echo "dependency of ${all_entry}: ${line}" - - typeset duplicate_entry="" - typeset -i i="0" - for i in "${!duplicates[@]}"; do - typeset duplicate_entry="${duplicates[${i}]}" - #echo "checking for duplicate ${duplicate_entry}" - typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" - - if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then - if [ "${line}" = "${duplicate_format}" ]; then - echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" - fi - else - echo "ERROR: empty file name while replacing duplicate dependencies." >&2 - echo "ERROR: for file ${all_entry}" >&2 - echo "ERROR: at dependency ${line}" >&2 - echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 - echo "ERROR: dependency: \"${line}\"" >&2 - exit 1 - fi - done - done <<< "${dependencies}" - else - echo "WARNING: otool returned error for file: ${all_entry}" >&2 - echo "WARNING: skipping." >&2 - fi + typeset otool_out="$(otool -L "${all_entry}")" + + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + + if [ "${?}" -eq "0" ]; then + typeset line="" + while read -r line; do + #echo "dependency of ${all_entry}: ${line}" + + typeset duplicate_entry="" + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" + #echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" + + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then + echo "install_name_tool -change \"${line}\" \"${to_files[${i}]}\" \"${all_entry}\"" + fi + else + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 + fi done -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 4417d8f741a3a34282f28e25d26c32f6b6133b1c Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:22:57 2015 +0200 macbuild.sh: more debug messages and a whitespace change. --- debian/changelog | 1 + macbuild.sh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 15e0693..895283b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -175,6 +175,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. - macbuild.sh: spelling fix. + - macbuild.sh: more more debug messages and a whitespace change. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 8a2eba3..9e44f15 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -115,7 +115,6 @@ parse_otool_output() { typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' - # In this special case, we do not want read to perform any word splitting. typeset oldifs="${IFS}" IFS='' @@ -389,6 +388,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a all_files typeset entry="" while read -r -d '' entry; do + echo "Adding ${entry} to all files" all_files+=( "${entry}" ) done < <(find "${base_dir}" -type 'f' -print0) @@ -396,6 +396,7 @@ if [ "${BUNDLE}" = "1" ]; then for entry in "${all_files[@]}"; do typeset relative_path="${entry##"${base_dir}/"}" typeset tmp_regex='^[^/]+$' + echo "Checking ${relative_path} against regex '${tmp_regex}'" if [[ "${relative_path}" =~ ${tmp_regex} ]]; then echo "${relative_path} is top file, adding to array." top_files+=( "${relative_path}" ) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9355769ed0ea2f2cd43bb7e5e13eb96dcdb2bd18 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 04:18:25 2015 +0200 macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. --- debian/changelog | 2 + macbuild.sh | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 198 insertions(+) diff --git a/debian/changelog b/debian/changelog index 52d8c22..277d9ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -172,6 +172,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: remove some noisy debug output. - macbuild.sh: replace tabs with two spaces. No functional changes. - deduplicate.sh: replace tabs with two spaces. No functional changes. + - macbuild.sh: merge deduplicate.sh content in. Also enable the + functionality "for real", not just as a dry-run. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 80999bd..3fe7447 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -97,6 +97,50 @@ repeat_str() { # INPUT COUNT return 0 } +typeset -a otool_fail_str +otool_fail_str=( "is not an object file" + "can't open file" + "Archive : " ) + +parse_otool_output() { +#set -x + typeset raw_output="${@}" + + typeset fail_str="" + for fail_str in "${otool_fail_str[@]}"; do + if echo "${raw_output}" | grep -q "${fail_str}"; then + return 1 + fi + done + + typeset tmp_regex='^[[:space:]]+(.*)[[:space:]]\(compatibility version .*, current version .*\)' + + + # In this special case, we do not want read to perform any word splitting. + typeset oldifs="${IFS}" + IFS='' + + # Used for skipping the first matching entry - which should typically be the ID line... + # That's a very naïve way to do this. Maybe there should be a bit more magic + # to catch this more reliably. + typeset -i first="1" + + typeset line="" + while read -r line; do + if [[ "${line}" =~ ${tmp_regex} ]]; then + if [ "${first}" -ne "1" ]; then + echo "${BASH_REMATCH[1]}" + else + first="0" + fi + fi + done <<< "${raw_output}" + + IFS="${oldifs}" +#set +x + return 0 +} + MATCH_HELP='(^((-h)|(--help))([ ]|$))|([ ]+((-h)|(--help))([ ]|$))' [ -n "${*}" ] && [[ "${*}" =~ ${MATCH_HELP} ]] && usage @@ -130,6 +174,11 @@ PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" "pulse-6.0" "pulseaudio" ) +typeset -a special_files_regex +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) + +typeset -r dependency_base_format='@executable_path/../Frameworks/' + : ${SDK:="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} : ${MACOSX_DEPLOYMENT_TARGET:="10.7"} : ${FORCE_STDLIB:="0"} @@ -334,6 +383,153 @@ if [ "${BUNDLE}" = "1" ]; then fi done + phase "Deduplicating PulseAudio libraries and dependencies" + typeset -r base_dir="$(lazy_canonical_path "${FRAMEWORKS_DIR}")" + + typeset -a all_files + typeset entry="" + while read -r -d '' entry; do + all_files+=( "${entry}" ) + done < <(find "${base_dir}" -type 'f' -print0) + + typeset -a top_files + for entry in "${all_files[@]}"; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset tmp_regex='^[^/]+$' + if [[ "${relative_path}" =~ ${tmp_regex} ]]; then + echo "${relative_path} is top file, adding to array." + top_files+=( "${relative_path}" ) + fi + done + + typeset -a duplicates + for entry in "${all_files[@]}"; do + typeset relative_path="${entry##"${base_dir}/"}" + typeset file_name="$(basename "${entry}")" + typeset top_entry="" + for top_entry in "${top_files[@]}"; do + if [ "${top_entry}" != "${relative_path}" ]; then + if [ "${file_name}" = "${top_entry}" ]; then + echo "Adding duplicate: ${relative_path}" + duplicates+=( "${relative_path}" ) + fi + fi + done + done + + echo "duplicates array before:" + for entry in "${duplicates[@]}"; do + echo "${entry}" + done + + typeset -i i="0" + for i in "${!duplicates[@]}"; do + entry="${duplicates[${i}]}" + typeset special_file_regex="" + for special_file_regex in "${special_files_regex[@]}"; do + typeset tmp_regex='^'"${special_file_regex}"'$' + if [[ "${entry}" =~ ${tmp_regex} ]]; then + mv -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" + duplicates[${i}]="$(basename "${entry}")" + echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" + fi + done + done + + echo "duplicates array after:" + for entry in "${duplicates[@]}"; do + echo "${entry}" + done + + for entry in "${duplicates[@]}"; do + rm -v "${base_dir}/${entry}" + typeset -i i="0" + for i in "${!all_files[@]}"; do + typeset all_entry="${all_files[${i}]}" + typeset relative_path="${all_entry##"${base_dir}/"}" + if [ "${relative_path}" = "${entry}" ]; then + unset all_files[${i}] + fi + done + done + + echo "New value for all_files:" + for entry in "${all_files[@]}"; do + echo "${entry}" + done + + echo "Duplicates-to-real map:" + # Build complementary array to duplicates. + typeset -a to_files + for entry in "${duplicates[@]}"; do + typeset filename="$(basename "${entry}")" + + typeset all_entry="" + for all_entry in "${all_files[@]}"; do + typeset all_entry_filename="$(basename "${all_entry}")" + + if [ -n "${filename}" ] && [ -n "${all_entry_filename}" ]; then + if [ "${filename}" = "${all_entry_filename}" ]; then + typeset dependency_format="$(lazy_canonical_path "${dependency_base_format}/${all_entry##${base_dir}}")" + to_files+=( "${dependency_format}" ) + + echo "${entry} => ${dependency_format}" + + # There should be only one entry matching, so we can save a bit of time and break out of the loop. + # Even more importantly, we only want one entry for each duplicates entry anyway... + break + fi + else + echo "ERROR: empty file name while matching duplicates with non-duplicates." >&2 + echo "ERROR: duplicate entry: \"${entry}\"" >&2 + echo "ERROR: real entry: \"${all_entry}\"" >&2 + exit 1 + fi + done + done + + # Try to fixup files broken by duplicates removal. + for all_entry in "${all_files[@]}"; do + typeset otool_out="$(otool -L "${all_entry}")" + + # Don't merge the declaration and initialization with the real value assignment. + # We need the return value of parse_otool_output(), but running + # typeset foo="$(bar)" will give us the return value of typeset, not bar(). + typeset dependencies="" + dependencies="$(parse_otool_output "${otool_out}")" + + if [ "${?}" -eq "0" ]; then + typeset line="" + while read -r line; do + #echo "dependency of ${all_entry}: ${line}" + + typeset duplicate_entry="" + typeset -i i="0" + for i in "${!duplicates[@]}"; do + typeset duplicate_entry="${duplicates[${i}]}" + #echo "checking for duplicate ${duplicate_entry}" + typeset duplicate_format="$(lazy_canonical_path "${dependency_base_format}/${duplicate_entry}")" + + if [ -n "${line}" ] && [ -n "${duplicate_format}" ]; then + if [ "${line}" = "${duplicate_format}" ]; then + install_name_tool -change "${line}" "${to_files[${i}]}" "${all_entry}" + fi + else + echo "ERROR: empty file name while replacing duplicate dependencies." >&2 + echo "ERROR: for file ${all_entry}" >&2 + echo "ERROR: at dependency ${line}" >&2 + echo "ERROR: duplicate entry: \"${duplicate_entry}\"" >&2 + echo "ERROR: dependency: \"${line}\"" >&2 + exit 1 + fi + done + done <<< "${dependencies}" + else + echo "WARNING: otool returned error for file: ${all_entry}" >&2 + echo "WARNING: skipping." >&2 + fi + done + phase "Bundling up using macdeployqt" macdeployqt "${APPBUNDLE}" -verbose=2 -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bbf6fa1a68e69c4da1cec89f1e9b01af84611df7 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Sep 24 04:28:15 2015 +0200 macbuild.sh: spelling fix. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 277d9ef..15e0693 100644 --- a/debian/changelog +++ b/debian/changelog @@ -174,6 +174,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - deduplicate.sh: replace tabs with two spaces. No functional changes. - macbuild.sh: merge deduplicate.sh content in. Also enable the functionality "for real", not just as a dry-run. + - macbuild.sh: spelling fix. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 3fe7447..8a2eba3 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -162,7 +162,7 @@ if type -P port >/dev/null 2>&1; then MACPORTS_PREFIX_SEARCH="$(type -P port)" MACPORTS_PREFIX_SEARCH="${MACPORTS_PREFIX_SEARCH%%bin/port}" else - # Port not being part find in ${PATH} doesn't necessarily mean it isn't available. + # Port not being found in ${PATH} doesn't necessarily mean it isn't available. # Try to guess. MACPORTS_PREFIX_SEARCH="/opt/local/" fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 7caaa1f98a635c96f07e84dd29e65a5d8d152f0b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:30:48 2015 +0200 macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. --- debian/changelog | 2 ++ macbuild.sh | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 895283b..e09f0af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -176,6 +176,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium functionality "for real", not just as a dry-run. - macbuild.sh: spelling fix. - macbuild.sh: more more debug messages and a whitespace change. + - macbuild.sh: fix removal of base prefix in deduplication if base prefix + ends in a slash. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 9e44f15..25de145 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -394,7 +394,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a top_files for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" + typeset relative_path="${entry##"$(lazy_canonical_path "${base_dir}/")"}" typeset tmp_regex='^[^/]+$' echo "Checking ${relative_path} against regex '${tmp_regex}'" if [[ "${relative_path}" =~ ${tmp_regex} ]]; then @@ -405,7 +405,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -a duplicates for entry in "${all_files[@]}"; do - typeset relative_path="${entry##"${base_dir}/"}" + typeset relative_path="${entry##"$(lazy_canonical_path "${base_dir}/")"}" typeset file_name="$(basename "${entry}")" typeset top_entry="" for top_entry in "${top_files[@]}"; do @@ -447,7 +447,7 @@ if [ "${BUNDLE}" = "1" ]; then typeset -i i="0" for i in "${!all_files[@]}"; do typeset all_entry="${all_files[${i}]}" - typeset relative_path="${all_entry##"${base_dir}/"}" + typeset relative_path="${all_entry##"$(lazy_canonical_path "${base_dir}/")"}" if [ "${relative_path}" = "${entry}" ]; then unset all_files[${i}] fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9de3b64d1d2f60d8c0aae899806deb38401f3c0a Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:58:54 2015 +0200 pulsemanager.cpp: minor non-behavior changing fixes. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index bf5211f..e554aea 100644 --- a/debian/changelog +++ b/debian/changelog @@ -184,6 +184,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium a "real" dependency for modules. - pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. + - pulsemanager.cpp: minor non-behavior changing fixes. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 5c38dd6..ecf442e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -39,7 +39,7 @@ PulseManager::PulseManager () { state_ = QProcess::NotRunning; - pulse_server_ = 0; + pulse_server_ = NULL; app_dir_ = QApplication::applicationDirPath (); } @@ -115,7 +115,7 @@ void PulseManager::find_port () { if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - pulse_port_++; + ++pulse_port_; } else free = true; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit d3e29668785f4511189e63c10a73bfe707aeee7b Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:42:01 2015 +0200 macbuild.sh: copy "special" files, so that they can be removed later on. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e09f0af..117e973 100644 --- a/debian/changelog +++ b/debian/changelog @@ -178,6 +178,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: more more debug messages and a whitespace change. - macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. + - macbuild.sh: copy "special" files, so that they can be removed later on. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 25de145..9bba392 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -430,7 +430,7 @@ if [ "${BUNDLE}" = "1" ]; then for special_file_regex in "${special_files_regex[@]}"; do typeset tmp_regex='^'"${special_file_regex}"'$' if [[ "${entry}" =~ ${tmp_regex} ]]; then - mv -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" + cp -v "${base_dir}/$(basename "${entry}")" "${base_dir}/$(dirname "${special_file_regex}")/" duplicates[${i}]="$(basename "${entry}")" echo "Renamed ${entry} in duplicates array to ${duplicates[${i}]}" fi -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 485eee4eddfe44ad2047e74bfc28f807a3abe9a0 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Sep 30 23:44:30 2015 +0200 macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to be needing one, so skipping the first dependency line incidentally skips a "real" dependency for modules. --- debian/changelog | 3 +++ macbuild.sh | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 117e973..db1e955 100644 --- a/debian/changelog +++ b/debian/changelog @@ -179,6 +179,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: fix removal of base prefix in deduplication if base prefix ends in a slash. - macbuild.sh: copy "special" files, so that they can be removed later on. + - macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to + be needing one, so skipping the first dependency line incidentally skips + a "real" dependency for modules. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index 9bba392..c95955e 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -119,19 +119,26 @@ parse_otool_output() { typeset oldifs="${IFS}" IFS='' - # Used for skipping the first matching entry - which should typically be the ID line... - # That's a very naïve way to do this. Maybe there should be a bit more magic - # to catch this more reliably. - typeset -i first="1" + # Used for skipping the ID entry. + # Initialized to the empty string, but the first matching line will set it once. + # The ID filename is required for subsequent dependency discovery. + typeset id="" typeset line="" while read -r line; do if [[ "${line}" =~ ${tmp_regex} ]]; then - if [ "${first}" -ne "1" ]; then + typeset file="${BASH_REMATCH[1]}" + + if [ -z "${id}" ]; then + echo "ID unset, something is wrong" >&2 + return 1 + elif [ "$(basename "${file}")" != "${id}" ]; then echo "${BASH_REMATCH[1]}" else first="0" fi + elif [ -z "${id}" ]; then + id="$(basename "${line%":"}")" fi done <<< "${raw_output}" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 735f7f4813d61b114fce4ffa63bb0f1e95dc52d6 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:57:48 2015 +0200 pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 94 +++++++++++++++++++++++++------------------------- src/pulsemanager.h | 14 ++++---- 3 files changed, 56 insertions(+), 54 deletions(-) diff --git a/debian/changelog b/debian/changelog index db1e955..bf5211f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -182,6 +182,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: rewrite ID line detection algorithm. Modules don't seem to be needing one, so skipping the first dependency line incidentally skips a "real" dependency for modules. + - pulsemanager.{cpp,h}: use name and underscore for member variables, not + underscore and name. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index af1ba2b..5c38dd6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,39 +25,39 @@ #endif PulseManager::PulseManager () { - _pulse_X2Go = "/.x2go/pulse"; + pulse_X2Go_ = "/.x2go/pulse"; - _pulse_dir = QDir (QDir::homePath ()); - _pulse_dir.mkpath (_pulse_dir.absolutePath () + _pulse_X2Go + "/tmp"); - _pulse_dir.cd (_pulse_X2Go.mid (1)); + pulse_dir_ = QDir (QDir::homePath ()); + pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); + pulse_dir_.cd (pulse_X2Go_.mid (1)); - _env = QProcessEnvironment::systemEnvironment (); - _env.insert ("HOME", _pulse_dir.absolutePath ()); - _env.insert ("TEMP", _pulse_dir.absolutePath () + "/tmp"); + env_ = QProcessEnvironment::systemEnvironment (); + env_.insert ("HOME", pulse_dir_.absolutePath ()); + env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - _pulse_port = 4713; + pulse_port_ = 4713; - _state = QProcess::NotRunning; + state_ = QProcess::NotRunning; - _pulse_server = 0; + pulse_server_ = 0; - _app_dir = QApplication::applicationDirPath (); + app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { - if (_pulse_server && is_server_running ()) + if (pulse_server_ && is_server_running ()) shutdown (); - delete (_pulse_server); + delete (pulse_server_); } void PulseManager::start () { assert (!is_server_running ()); - delete (_pulse_server); + delete (pulse_server_); - _pulse_server = new QProcess (0); - _state = QProcess::Starting; + pulse_server_ = new QProcess (0); + state_ = QProcess::Starting; #ifdef Q_OS_DARWIN start_osx (); @@ -74,27 +74,27 @@ void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); - _pulse_server->setProcessEnvironment (_env); + pulse_server_->setProcessEnvironment (env_); QStringList args; args << "--exit-idle-time=-1" << "-n" - << "-F" << _pulse_dir.absolutePath () + "/config.pa" + << "-F" << pulse_dir_.absolutePath () + "/config.pa" << "-p" - << QDir (_app_dir + << QDir (app_dir_ + "/../Frameworks/pulse-2.0/modules").absolutePath () << "--high-priority"; #ifdef DEBUG args << "--log-level=debug"; #endif - _pulse_server->setWorkingDirectory (_app_dir + "/../exe/"); - _pulse_server->start (_app_dir + "/../exe/pulseaudio", args); + pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); + pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); - if (_pulse_server->waitForStarted ()) { + if (pulse_server_->waitForStarted ()) { x2goDebug << "pulse started with" << args << "waiting for finish..."; - _state = QProcess::Running; + state_ = QProcess::Running; - connect (_pulse_server, SIGNAL (finished (int)), + connect (pulse_server_, SIGNAL (finished (int)), this, SLOT (on_pulse_finished (int))); #ifdef DEBUG @@ -110,12 +110,12 @@ void PulseManager::find_port () { bool free = false; do { - tcpSocket.connectToHost ("127.0.0.1", _pulse_port); + tcpSocket.connectToHost ("127.0.0.1", pulse_port_); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - _pulse_port++; + pulse_port_++; } else free = true; @@ -123,8 +123,8 @@ void PulseManager::find_port () { } bool PulseManager::generate_server_config () { - QString config_file_name = _pulse_dir.absolutePath () + "/config.pa"; - QTemporaryFile config_tmp_file (_pulse_dir.absolutePath () + "/tmp/tmpconfig"); + QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; + QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); X2goSettings settings ("settings"); bool disable_input = false; bool ret = false; @@ -136,7 +136,7 @@ bool PulseManager::generate_server_config () { QTextStream config_tmp_file_stream (&config_tmp_file); config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + - QString::number (_pulse_port) << endl; + QString::number (pulse_port_) << endl; config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; config_tmp_file_stream << "load-module module-coreaudio-detect"; @@ -159,9 +159,9 @@ bool PulseManager::generate_server_config () { } bool PulseManager::generate_client_config () { - QTemporaryFile client_config_tmp_file (_pulse_dir.absolutePath () + QTemporaryFile client_config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); - QString client_config_file_name (_pulse_dir.absolutePath () + "/.pulse/client.conf"); + QString client_config_file_name (pulse_dir_.absolutePath () + "/.pulse/client.conf"); bool ret = false; if (client_config_tmp_file.open ()) { @@ -169,7 +169,7 @@ bool PulseManager::generate_client_config () { config_tmp_file_stream << "autospawn=no" << endl; config_tmp_file_stream << "daemon-binary=" - << QDir (_app_dir + << QDir (app_dir_ + "/../exe/pulseaudio").absolutePath () << endl; @@ -189,7 +189,7 @@ void PulseManager::cleanup_client_dir () { // PA expects $HOME/.pulse/$HOST-runtime to be a symbolic link // and will fail, if it's just a plain directory on Mac OS X. // Delete it first. - QDir machine_dir (_pulse_dir.absolutePath () + "/.pulse/" + QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" + QHostInfo::localHostName () + "-runtime"); if (QFile::exists (machine_dir.absolutePath () + "/pid")) @@ -202,10 +202,10 @@ void PulseManager::cleanup_client_dir () { void PulseManager::slot_play_startup_sound () { QProcess play_file (0); - play_file.setWorkingDirectory (_pulse_server->workingDirectory ()); - play_file.setProcessEnvironment (_env); - play_file.start (_app_dir + "/../exe/paplay " - + _app_dir + "/../Resources/startup.wav"); + play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); + play_file.setProcessEnvironment (env_); + play_file.start (app_dir_ + "/../exe/paplay " + + app_dir_ + "/../Resources/startup.wav"); if (play_file.waitForStarted ()) play_file.waitForFinished (); @@ -215,20 +215,20 @@ void PulseManager::on_pulse_finished (int exit_code) { if (!exit_code) x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; - QByteArray ba = _pulse_server->readAllStandardOutput (); + QByteArray ba = pulse_server_->readAllStandardOutput (); char *data = ba.data (); std::cout << data; - ba = _pulse_server->readAllStandardError (); + ba = pulse_server_->readAllStandardError (); data = ba.data (); std::cout << data; - _state = QProcess::NotRunning; + state_ = QProcess::NotRunning; emit (sig_pulse_server_terminated ()); } bool PulseManager::is_server_running () { - if (_pulse_server) - return (_pulse_server->state () == QProcess::Running); + if (pulse_server_) + return (pulse_server_->state () == QProcess::Running); else return (false); } @@ -239,21 +239,21 @@ void PulseManager::shutdown () { connect (this, SIGNAL (sig_pulse_server_terminated ()), &loop, SLOT (quit ())); - _pulse_server->terminate (); + pulse_server_->terminate (); loop.exec (); } int PulseManager::get_pulse_port () { - return (_pulse_port); + return (pulse_port_); } void PulseManager::set_pulse_port (int pulse_port) { - _pulse_port = pulse_port; + pulse_port_ = pulse_port; } void PulseManager::relaunch () { - if (_pulse_server && is_server_running ()) + if (pulse_server_ && is_server_running ()) shutdown (); x2goDebug << "restarting pulse"; @@ -261,7 +261,7 @@ void PulseManager::relaunch () { } QProcess::ProcessState PulseManager::state () { - return (_state); + return (state_); } #ifdef DEBUG_UNDEF diff --git a/src/pulsemanager.h b/src/pulsemanager.h index fc0a989..939dc56 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -75,13 +75,13 @@ signals: void sig_pulse_server_terminated (); private: - QString _pulse_X2Go; - QDir _pulse_dir; - QProcessEnvironment _env; - QProcess *_pulse_server; - int _pulse_port; - QProcess::ProcessState _state; - QString _app_dir; + QString pulse_X2Go_; + QDir pulse_dir_; + QProcessEnvironment env_; + QProcess *pulse_server_; + int pulse_port_; + QProcess::ProcessState state_; + QString app_dir_; }; #ifdef NDEBUG_DEFINE -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 4ecd20c0c93d7156ccfdc90b222b8058f0521823 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:46:47 2015 +0200 pulsemanager.{cpp,h}: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 286 +++++++++++++++++++++++++------------------------- src/pulsemanager.h | 17 ++- 3 files changed, 152 insertions(+), 152 deletions(-) diff --git a/debian/changelog b/debian/changelog index e554aea..584c740 100644 --- a/debian/changelog +++ b/debian/changelog @@ -185,6 +185,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: use name and underscore for member variables, not underscore and name. - pulsemanager.cpp: minor non-behavior changing fixes. + - pulsemanager.{cpp,h}: reformat only. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ecf442e..9e70ce6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,243 +25,243 @@ #endif PulseManager::PulseManager () { - pulse_X2Go_ = "/.x2go/pulse"; + pulse_X2Go_ = "/.x2go/pulse"; - pulse_dir_ = QDir (QDir::homePath ()); - pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); - pulse_dir_.cd (pulse_X2Go_.mid (1)); + pulse_dir_ = QDir (QDir::homePath ()); + pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); + pulse_dir_.cd (pulse_X2Go_.mid (1)); - env_ = QProcessEnvironment::systemEnvironment (); - env_.insert ("HOME", pulse_dir_.absolutePath ()); - env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); + env_ = QProcessEnvironment::systemEnvironment (); + env_.insert ("HOME", pulse_dir_.absolutePath ()); + env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - pulse_port_ = 4713; + pulse_port_ = 4713; - state_ = QProcess::NotRunning; + state_ = QProcess::NotRunning; - pulse_server_ = NULL; + pulse_server_ = NULL; - app_dir_ = QApplication::applicationDirPath (); + app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { - if (pulse_server_ && is_server_running ()) - shutdown (); + if (pulse_server_ && is_server_running ()) + shutdown (); - delete (pulse_server_); + delete (pulse_server_); } void PulseManager::start () { - assert (!is_server_running ()); + assert (!is_server_running ()); - delete (pulse_server_); + delete (pulse_server_); - pulse_server_ = new QProcess (0); - state_ = QProcess::Starting; + pulse_server_ = new QProcess (0); + state_ = QProcess::Starting; #ifdef Q_OS_DARWIN - start_osx (); + start_osx (); #elif defined (Q_OS_WIN) - start_win (); + start_win (); #elif defined (Q_OS_LINUX) - start_linux (); + start_linux (); #endif } void PulseManager::start_osx () { - find_port (); + find_port (); - if (generate_server_config () && generate_client_config ()) { - cleanup_client_dir (); + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); - pulse_server_->setProcessEnvironment (env_); + pulse_server_->setProcessEnvironment (env_); - QStringList args; - args << "--exit-idle-time=-1" << "-n" - << "-F" << pulse_dir_.absolutePath () + "/config.pa" - << "-p" - << QDir (app_dir_ - + "/../Frameworks/pulse-2.0/modules").absolutePath () - << "--high-priority"; + QStringList args; + args << "--exit-idle-time=-1" << "-n" + << "-F" << pulse_dir_.absolutePath () + "/config.pa" + << "-p" + << QDir (app_dir_ + + "/../Frameworks/pulse-2.0/modules").absolutePath () + << "--high-priority"; #ifdef DEBUG - args << "--log-level=debug"; + args << "--log-level=debug"; #endif - pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); - pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); + pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); + pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); - if (pulse_server_->waitForStarted ()) { - x2goDebug << "pulse started with" << args << "waiting for finish..."; - state_ = QProcess::Running; + if (pulse_server_->waitForStarted ()) { + x2goDebug << "pulse started with" << args << "waiting for finish..."; + state_ = QProcess::Running; - connect (pulse_server_, SIGNAL (finished (int)), - this, SLOT (on_pulse_finished (int))); + connect (pulse_server_, SIGNAL (finished (int)), + this, SLOT (on_pulse_finished (int))); #ifdef DEBUG - // Give PA a little time to come up. - QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); + // Give PA a little time to come up. + QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); #endif - } } + } } void PulseManager::find_port () { - QTcpSocket tcpSocket (0); - bool free = false; - - do { - tcpSocket.connectToHost ("127.0.0.1", pulse_port_); - - if (tcpSocket.waitForConnected (1000)) { - tcpSocket.close (); - free = false; - ++pulse_port_; - } - else - free = true; - } while (!free); + QTcpSocket tcpSocket (0); + bool free = false; + + do { + tcpSocket.connectToHost ("127.0.0.1", pulse_port_); + + if (tcpSocket.waitForConnected (1000)) { + tcpSocket.close (); + free = false; + ++pulse_port_; + } + else + free = true; + } while (!free); } bool PulseManager::generate_server_config () { - QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; - QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); - X2goSettings settings ("settings"); - bool disable_input = false; - bool ret = false; + QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; + QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); + X2goSettings settings ("settings"); + bool disable_input = false; + bool ret = false; - disable_input = settings.setting ()->value ("soundnoinput", - (QVariant) false).toBool (); + disable_input = settings.setting ()->value ("soundnoinput", + (QVariant) false).toBool (); - if (config_tmp_file.open ()) { - QTextStream config_tmp_file_stream (&config_tmp_file); + if (config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&config_tmp_file); - config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + - QString::number (pulse_port_) << endl; - config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; - config_tmp_file_stream << "load-module module-coreaudio-detect"; + config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + + QString::number (pulse_port_) << endl; + config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; + config_tmp_file_stream << "load-module module-coreaudio-detect"; - if (disable_input) - config_tmp_file_stream << " record=0"; + if (disable_input) + config_tmp_file_stream << " record=0"; - config_tmp_file_stream << endl; + config_tmp_file_stream << endl; - QFile config_file (config_file_name); - if (QFile::exists (config_file_name)) - QFile::remove (config_file_name); + QFile config_file (config_file_name); + if (QFile::exists (config_file_name)) + QFile::remove (config_file_name); - config_tmp_file.copy (config_file_name); - config_tmp_file.remove (); + config_tmp_file.copy (config_file_name); + config_tmp_file.remove (); - ret = true; - } + ret = true; + } - return (ret); + return (ret); } bool PulseManager::generate_client_config () { - QTemporaryFile client_config_tmp_file (pulse_dir_.absolutePath () - + "/tmp/tmpconfig"); - QString client_config_file_name (pulse_dir_.absolutePath () + "/.pulse/client.conf"); - bool ret = false; + QTemporaryFile client_config_tmp_file (pulse_dir_.absolutePath () + + "/tmp/tmpconfig"); + QString client_config_file_name (pulse_dir_.absolutePath () + "/.pulse/client.conf"); + bool ret = false; - if (client_config_tmp_file.open ()) { - QTextStream config_tmp_file_stream (&client_config_tmp_file); + if (client_config_tmp_file.open ()) { + QTextStream config_tmp_file_stream (&client_config_tmp_file); - config_tmp_file_stream << "autospawn=no" << endl; - config_tmp_file_stream << "daemon-binary=" - << QDir (app_dir_ - + "/../exe/pulseaudio").absolutePath () - << endl; + config_tmp_file_stream << "autospawn=no" << endl; + config_tmp_file_stream << "daemon-binary=" + << QDir (app_dir_ + + "/../exe/pulseaudio").absolutePath () + << endl; - if (QFile::exists (client_config_file_name)) - QFile::remove (client_config_file_name); + if (QFile::exists (client_config_file_name)) + QFile::remove (client_config_file_name); - client_config_tmp_file.copy (client_config_file_name); - client_config_tmp_file.remove (); + client_config_tmp_file.copy (client_config_file_name); + client_config_tmp_file.remove (); - ret = true; - } + ret = true; + } - return (ret); + return (ret); } void PulseManager::cleanup_client_dir () { - // PA expects $HOME/.pulse/$HOST-runtime to be a symbolic link - // and will fail, if it's just a plain directory on Mac OS X. - // Delete it first. - QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" - + QHostInfo::localHostName () + "-runtime"); + // PA expects $HOME/.pulse/$HOST-runtime to be a symbolic link + // and will fail, if it's just a plain directory on Mac OS X. + // Delete it first. + QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" + + QHostInfo::localHostName () + "-runtime"); - if (QFile::exists (machine_dir.absolutePath () + "/pid")) - QFile::remove (machine_dir.absolutePath () + "/pid"); + if (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); - if (machine_dir.exists ()) - machine_dir.remove (machine_dir.absolutePath ()); + if (machine_dir.exists ()) + machine_dir.remove (machine_dir.absolutePath ()); } void PulseManager::slot_play_startup_sound () { - QProcess play_file (0); + QProcess play_file (0); - play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); - play_file.setProcessEnvironment (env_); - play_file.start (app_dir_ + "/../exe/paplay " - + app_dir_ + "/../Resources/startup.wav"); + play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); + play_file.setProcessEnvironment (env_); + play_file.start (app_dir_ + "/../exe/paplay " + + app_dir_ + "/../Resources/startup.wav"); - if (play_file.waitForStarted ()) - play_file.waitForFinished (); + if (play_file.waitForStarted ()) + play_file.waitForFinished (); } void PulseManager::on_pulse_finished (int exit_code) { - if (!exit_code) - x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; - - QByteArray ba = pulse_server_->readAllStandardOutput (); - char *data = ba.data (); - std::cout << data; - ba = pulse_server_->readAllStandardError (); - data = ba.data (); - std::cout << data; - - state_ = QProcess::NotRunning; - emit (sig_pulse_server_terminated ()); + if (!exit_code) + x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; + + QByteArray ba = pulse_server_->readAllStandardOutput (); + char *data = ba.data (); + std::cout << data; + ba = pulse_server_->readAllStandardError (); + data = ba.data (); + std::cout << data; + + state_ = QProcess::NotRunning; + emit (sig_pulse_server_terminated ()); } bool PulseManager::is_server_running () { - if (pulse_server_) - return (pulse_server_->state () == QProcess::Running); - else - return (false); + if (pulse_server_) + return (pulse_server_->state () == QProcess::Running); + else + return (false); } void PulseManager::shutdown () { - QEventLoop loop; + QEventLoop loop; - connect (this, SIGNAL (sig_pulse_server_terminated ()), - &loop, SLOT (quit ())); + connect (this, SIGNAL (sig_pulse_server_terminated ()), + &loop, SLOT (quit ())); - pulse_server_->terminate (); + pulse_server_->terminate (); - loop.exec (); + loop.exec (); } int PulseManager::get_pulse_port () { - return (pulse_port_); + return (pulse_port_); } void PulseManager::set_pulse_port (int pulse_port) { - pulse_port_ = pulse_port; + pulse_port_ = pulse_port; } void PulseManager::relaunch () { - if (pulse_server_ && is_server_running ()) - shutdown (); + if (pulse_server_ && is_server_running ()) + shutdown (); - x2goDebug << "restarting pulse"; - start (); + x2goDebug << "restarting pulse"; + start (); } QProcess::ProcessState PulseManager::state () { - return (state_); + return (state_); } #ifdef DEBUG_UNDEF diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 939dc56..e391af8 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -38,22 +38,21 @@ #include "x2gologdebug.h" #include "x2gosettings.h" -class PulseManager: public QObject -{ - Q_OBJECT; +class PulseManager: public QObject { + Q_OBJECT; -public: + public: PulseManager (); ~PulseManager (); int get_pulse_port (); void set_pulse_port (int pulse_port); QProcess::ProcessState state (); -public slots: + public slots: void start (); void relaunch (); -private: + private: PulseManager (const PulseManager &other); void start_osx (); // FIXME @@ -67,14 +66,14 @@ private: void shutdown (); bool is_server_running (); -private slots: + private slots: void on_pulse_finished (int exit_code); void slot_play_startup_sound (); -signals: + signals: void sig_pulse_server_terminated (); -private: + private: QString pulse_X2Go_; QDir pulse_dir_; QProcessEnvironment env_; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 921e76e115df782d6edd1442fe4f033535e013ac Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:28:05 2015 +0200 pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 3 ++- src/pulsemanager.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 62589bb..f90f42d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -187,6 +187,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: minor non-behavior changing fixes. - pulsemanager.{cpp,h}: reformat only. - pulsemanager.cpp: use initializer list for constructor. + - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 002c9f8..c1d8d8f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -26,7 +26,8 @@ PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), state_(QProcess::NotRunning), pulse_server_(NULL), - app_dir_(QApplication::applicationDirPath ()) { + app_dir_(QApplication::applicationDirPath ()), + pulse_version_major_(0), pulse_version_minor_(0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e391af8..5b1fe37 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -81,6 +81,8 @@ class PulseManager: public QObject { int pulse_port_; QProcess::ProcessState state_; QString app_dir_; + uint32_t pulse_version_major_; + uint32_t pulse_version_minor_; }; #ifdef NDEBUG_DEFINE -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 223e60840dc26b2c80d723b4cf89d6fefeb71547 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 1 01:49:47 2015 +0200 pulsemanager.cpp: use initializer list for constructor. --- debian/changelog | 1 + src/pulsemanager.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 584c740..62589bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -186,6 +186,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium underscore and name. - pulsemanager.cpp: minor non-behavior changing fixes. - pulsemanager.{cpp,h}: reformat only. + - pulsemanager.cpp: use initializer list for constructor. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9e70ce6..002c9f8 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,9 +24,9 @@ #define DEBUG #endif -PulseManager::PulseManager () { - pulse_X2Go_ = "/.x2go/pulse"; - +PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), + state_(QProcess::NotRunning), pulse_server_(NULL), + app_dir_(QApplication::applicationDirPath ()) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -34,14 +34,6 @@ PulseManager::PulseManager () { env_ = QProcessEnvironment::systemEnvironment (); env_.insert ("HOME", pulse_dir_.absolutePath ()); env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); - - pulse_port_ = 4713; - - state_ = QProcess::NotRunning; - - pulse_server_ = NULL; - - app_dir_ = QApplication::applicationDirPath (); } PulseManager::~PulseManager () { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 12e3064c8efb37e2269000ec6c8e6d291f4bbb24 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:17:47 2015 +0100 pulsemanager.cpp: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f90f42d..abc23fd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -188,6 +188,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: reformat only. - pulsemanager.cpp: use initializer list for constructor. - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. + - pulsemanager.cpp: reformat only. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c1d8d8f..cd390bf 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,10 +24,10 @@ #define DEBUG #endif -PulseManager::PulseManager () : pulse_X2Go_("/.x2go/pulse"), pulse_port_(4713), - state_(QProcess::NotRunning), pulse_server_(NULL), - app_dir_(QApplication::applicationDirPath ()), - pulse_version_major_(0), pulse_version_minor_(0) { +PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), + state_ (QProcess::NotRunning), pulse_server_ (NULL), + app_dir_ (QApplication::applicationDirPath ()), + pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5a215c18a8f2658bf77de4015b7f579794fb352b Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:20:15 2015 +0100 pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++-- src/pulsemanager.h | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index abc23fd..0206ffa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -189,6 +189,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: use initializer list for constructor. - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. - pulsemanager.cpp: reformat only. + - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index cd390bf..33d77d6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -237,11 +237,11 @@ void PulseManager::shutdown () { loop.exec (); } -int PulseManager::get_pulse_port () { +std::uint16_t PulseManager::get_pulse_port () { return (pulse_port_); } -void PulseManager::set_pulse_port (int pulse_port) { +void PulseManager::set_pulse_port (std::uint16_t pulse_port) { pulse_port_ = pulse_port; } diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 5b1fe37..9252739 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -35,6 +35,7 @@ #include <QApplication> #include <QTimer> #include <assert.h> +#include <cstdint> #include "x2gologdebug.h" #include "x2gosettings.h" @@ -44,8 +45,8 @@ class PulseManager: public QObject { public: PulseManager (); ~PulseManager (); - int get_pulse_port (); - void set_pulse_port (int pulse_port); + std::uint16_t get_pulse_port (); + void set_pulse_port (std::uint16_t pulse_port); QProcess::ProcessState state (); public slots: @@ -78,7 +79,7 @@ class PulseManager: public QObject { QDir pulse_dir_; QProcessEnvironment env_; QProcess *pulse_server_; - int pulse_port_; + std::uint16_t pulse_port_; QProcess::ProcessState state_; QString app_dir_; uint32_t pulse_version_major_; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b3af061794fb822bcfb37d4fc5fe21400b2aaef3 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:21:17 2015 +0100 pulsemanager.h: add std:: namespace selector for uint32_t version variables. --- debian/changelog | 2 ++ src/pulsemanager.h | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0206ffa..dcb759f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -190,6 +190,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add pulse_version_{major,minor}_ member variables. - pulsemanager.cpp: reformat only. - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. + - pulsemanager.h: add std:: namespace selector for uint32_t version + variables. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 9252739..dbafa3f 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -82,8 +82,8 @@ class PulseManager: public QObject { std::uint16_t pulse_port_; QProcess::ProcessState state_; QString app_dir_; - uint32_t pulse_version_major_; - uint32_t pulse_version_minor_; + std::uint32_t pulse_version_major_; + std::uint32_t pulse_version_minor_; }; #ifdef NDEBUG_DEFINE -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0aded3b1a780e113f3715c0584cd28cd7e0d90cc Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Oct 29 04:56:33 2015 +0100 pulsemanager.{cpp,h}: add ESD support. --- debian/changelog | 1 + src/pulsemanager.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++------- src/pulsemanager.h | 5 ++++- 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index dcb759f..f858ee1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -192,6 +192,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: switch port definitions to std::uint16_t. - pulsemanager.h: add std:: namespace selector for uint32_t version variables. + - pulsemanager.{cpp,h}: add ESD support. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 33d77d6..c92d64f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,8 +25,8 @@ #endif PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), - state_ (QProcess::NotRunning), pulse_server_ (NULL), - app_dir_ (QApplication::applicationDirPath ()), + esd_port_ (4714), state_ (QProcess::NotRunning), + pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); @@ -62,7 +62,15 @@ void PulseManager::start () { } void PulseManager::start_osx () { - find_port (); + // Search for a free Pulse and EsounD port. + // Note that there is no way we could find + // an esd port, if the pulse port detection + // failed. Better trust your compiler to + // optimize this statement and save some + // cycles. + if ((findPort (false)) && (findPort (true))) { + find_port (); + } if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); @@ -98,21 +106,45 @@ void PulseManager::start_osx () { } } -void PulseManager::find_port () { +void PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; + std::uint16_t ret = pulse_port_; + std::uint16_t other_port = esd_port_; + + // If the search_esd parameter is true, find a free port + // for the PulseAudio emulation. + if (search_esd) { + ret = esd_port_; + other_port = pulse_port_; + } do { - tcpSocket.connectToHost ("127.0.0.1", pulse_port_); + // Skip this port, if it's reserved for the counterpart. + if (ret == other_port) { + ++ret; + continue; + } + + tcpSocket.connectToHost ("127.0.0.1", ret); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - ++pulse_port_; + ++ret; } else free = true; - } while (!free); + } while ((!free) && (port > 1023)); + + if (!search_esd) { + pulse_port_ = ret; + } + else { + esd_port_ = ret; + } + + return (free); } bool PulseManager::generate_server_config () { @@ -131,6 +163,7 @@ bool PulseManager::generate_server_config () { config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + QString::number (pulse_port_) << endl; config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; + config_tmp_file_stream << "load-module module-esound-protocol-unix" << endl; config_tmp_file_stream << "load-module module-coreaudio-detect"; if (disable_input) @@ -241,10 +274,18 @@ std::uint16_t PulseManager::get_pulse_port () { return (pulse_port_); } +std::uint16_t PulseManager::get_esd_port () { + return (esd_port_); +} + void PulseManager::set_pulse_port (std::uint16_t pulse_port) { pulse_port_ = pulse_port; } +void PulseManager::set_esd_port (std::uint16_t esd_port) { + esd_port_ = esd_port; +} + void PulseManager::relaunch () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index dbafa3f..22ab771 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -46,7 +46,9 @@ class PulseManager: public QObject { PulseManager (); ~PulseManager (); std::uint16_t get_pulse_port (); + std::uint16_t get_esd_port (); void set_pulse_port (std::uint16_t pulse_port); + void set_esd_port (std::uint16_t esd_port); QProcess::ProcessState state (); public slots: @@ -60,7 +62,7 @@ class PulseManager: public QObject { void start_win (); // FIXME void start_linux (); - void find_port (); + void find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); void cleanup_client_dir (); @@ -80,6 +82,7 @@ class PulseManager: public QObject { QProcessEnvironment env_; QProcess *pulse_server_; std::uint16_t pulse_port_; + std::uint16_t esd_port_; QProcess::ProcessState state_; QString app_dir_; std::uint32_t pulse_version_major_; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0f371b8c8ed4ea9ece5fafe415eb8e39f755847d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:32:34 2015 +0100 pulsemanager.{cpp,h}: rename relaunch () to restart (). --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- src/pulsemanager.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f858ee1..9c4ad60 100644 --- a/debian/changelog +++ b/debian/changelog @@ -193,6 +193,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.h: add std:: namespace selector for uint32_t version variables. - pulsemanager.{cpp,h}: add ESD support. + - pulsemanager.{cpp,h}: rename relaunch () to restart (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c92d64f..6999c18 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -286,7 +286,7 @@ void PulseManager::set_esd_port (std::uint16_t esd_port) { esd_port_ = esd_port; } -void PulseManager::relaunch () { +void PulseManager::restart () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 22ab771..aae71e3 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -53,7 +53,7 @@ class PulseManager: public QObject { public slots: void start (); - void relaunch (); + void restart (); private: PulseManager (const PulseManager &other); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 751468f397228a39e3c138563b04fb141895a71c Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:35:35 2015 +0100 pulsemanager.cpp: reformat only. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9c4ad60..0e29afe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -194,6 +194,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium variables. - pulsemanager.{cpp,h}: add ESD support. - pulsemanager.{cpp,h}: rename relaunch () to restart (). + - pulsemanager.cpp: reformat only. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6999c18..d9d5710 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -24,10 +24,14 @@ #define DEBUG #endif -PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), - esd_port_ (4714), state_ (QProcess::NotRunning), - pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), - pulse_version_major_ (0), pulse_version_minor_ (0) { +PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), + pulse_port_ (4713), + esd_port_ (4714), + state_ (QProcess::NotRunning), + pulse_server_ (NULL), + app_dir_ (QApplication::applicationDirPath ()), + pulse_version_major_ (0), + pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0732df6f50f75866d7c2934aa93e9c975a87b0d8 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:40:58 2015 +0100 pulsemanager.{cpp,h}: fixup preprocessor usage. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++---- src/pulsemanager.h | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0e29afe..d63967a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -195,6 +195,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add ESD support. - pulsemanager.{cpp,h}: rename relaunch () to restart (). - pulsemanager.cpp: reformat only. + - pulsemanager.{cpp,h}: fixup preprocessor usage. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d9d5710..9c31cca 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -22,7 +22,7 @@ #ifndef DEBUG #define DEBUG_UNDEF #define DEBUG -#endif +#endif // defined (NDEBUG) PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_port_ (4713), @@ -62,7 +62,7 @@ void PulseManager::start () { start_win (); #elif defined (Q_OS_LINUX) start_linux (); -#endif +#endif // defined (Q_OS_DARWIN) } void PulseManager::start_osx () { @@ -105,7 +105,7 @@ void PulseManager::start_osx () { #ifdef DEBUG // Give PA a little time to come up. QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); -#endif +#endif // defined (DEBUG) } } } @@ -305,4 +305,4 @@ QProcess::ProcessState PulseManager::state () { #ifdef DEBUG_UNDEF #undef DEBUG #undef DEBUG_UNDEF -#endif +#endif // defined (DEBUG_UNDEF) diff --git a/src/pulsemanager.h b/src/pulsemanager.h index aae71e3..020556a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -23,7 +23,7 @@ #ifdef NDEBUG #define NDEBUG_DEFINE #undef NDEBUG -#endif +#endif // defined (NDEBUG) #include <iostream> #include <QDir> @@ -92,6 +92,6 @@ class PulseManager: public QObject { #ifdef NDEBUG_DEFINE #define NDEBUG #undef NDEBUG_DEFINE -#endif +#endif // defined (NDEBUG_DEFINE) #endif // PULSEMANAGER_H -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 09aa5a427c8cbfaa5324a045a10b7674912331fb Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 02:56:30 2015 +0100 pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 3 +++ src/pulsemanager.h | 3 +++ 3 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index d63967a..2d74bb6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -196,6 +196,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: rename relaunch () to restart (). - pulsemanager.cpp: reformat only. - pulsemanager.{cpp,h}: fixup preprocessor usage. + - pulsemanager.{cpp,h}: add server_args_, server_binary_ and + server_working_dir_ class variables. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9c31cca..a46ab11 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -30,6 +30,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), state_ (QProcess::NotRunning), pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), + server_args_ (QStringList ()), + server_binary_ (QString ("")), + server_working_dir (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 020556a..99b3d4a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -85,6 +85,9 @@ class PulseManager: public QObject { std::uint16_t esd_port_; QProcess::ProcessState state_; QString app_dir_; + QStringList server_args_; + QString server_binary_; + QString server_working_dir_; std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; }; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 4777d20761f4594903e0d5bcb911177858cb68c3 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:03:44 2015 +0100 pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 20 +++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2d74bb6..6ce551f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -198,6 +198,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: fixup preprocessor usage. - pulsemanager.{cpp,h}: add server_args_, server_binary_ and server_working_dir_ class variables. + - pulsemanager.cpp: make start () wrap the "real" OS-specific start + functions. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index a46ab11..f094019 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -59,16 +59,6 @@ void PulseManager::start () { pulse_server_ = new QProcess (0); state_ = QProcess::Starting; -#ifdef Q_OS_DARWIN - start_osx (); -#elif defined (Q_OS_WIN) - start_win (); -#elif defined (Q_OS_LINUX) - start_linux (); -#endif // defined (Q_OS_DARWIN) -} - -void PulseManager::start_osx () { // Search for a free Pulse and EsounD port. // Note that there is no way we could find // an esd port, if the pulse port detection @@ -76,9 +66,17 @@ void PulseManager::start_osx () { // optimize this statement and save some // cycles. if ((findPort (false)) && (findPort (true))) { - find_port (); +#ifdef Q_OS_DARWIN + start_osx (); +#elif defined (Q_OS_WIN) + start_win (); +#elif defined (Q_OS_LINUX) + start_linux (); +#endif // defined (Q_OS_DARWIN) } +} +void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 50a38543806ccaee836098273c043be5ce667967 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:05:53 2015 +0100 pulsemanager.{cpp,h}: new function create_client_dir (). --- debian/changelog | 1 + src/pulsemanager.cpp | 11 +++++++++++ src/pulsemanager.h | 1 + 3 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6ce551f..98853bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -200,6 +200,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium server_working_dir_ class variables. - pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. + - pulsemanager.{cpp,h}: new function create_client_dir (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index f094019..f686dce 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -230,6 +230,17 @@ void PulseManager::cleanup_client_dir () { machine_dir.remove (machine_dir.absolutePath ()); } +void PulseManager::create_client_dir () { + QDir machine_dir (pulse_dir_.absolutePath () + "/.pulse/" + + QHostInfo::localHostName () + "-runtime"); + + if (!machine_dir.exists ()) + machine_dir.mkpath (machine_dir.absolutePath ()); + + if (QFile::exists (machine_dir.absolutePath () + "/pid")) + QFile::remove (machine_dir.absolutePath () + "/pid"); +} + void PulseManager::slot_play_startup_sound () { QProcess play_file (0); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 99b3d4a..e5f4b87 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -66,6 +66,7 @@ class PulseManager: public QObject { bool generate_server_config (); bool generate_client_config (); void cleanup_client_dir (); + void create_client_dir (); void shutdown (); bool is_server_running (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit db5cba013800718e9a01889104c8a94ee3723f38 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:14:47 2015 +0100 pulsemanager.cpp: add Windows support to shutdown (). --- debian/changelog | 1 + src/pulsemanager.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index 98853bd..32112ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -201,6 +201,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make start () wrap the "real" OS-specific start functions. - pulsemanager.{cpp,h}: new function create_client_dir (). + - pulsemanager.cpp: add Windows support to shutdown (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index f686dce..44b52f3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -281,7 +281,14 @@ void PulseManager::shutdown () { connect (this, SIGNAL (sig_pulse_server_terminated ()), &loop, SLOT (quit ())); + // Console applications without an event loop can only be terminated + // by QProcess::kill() on Windows (unless they handle WM_CLOSE, which + // PA obviously doesn't.) +#ifdef Q_OS_WIN + pulse_server_->kill (); +#else // defined (Q_OS_WIN) pulse_server_->terminate (); +#endif // defined (Q_OS_WIN) loop.exec (); } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0f33e9c36ff236f928502721ea75bc4993397168 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:16:52 2015 +0100 pulsemanager.cpp: add cleanup support to on_pulse_finished (). --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/debian/changelog b/debian/changelog index 32112ab..d55919f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -202,6 +202,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium functions. - pulsemanager.{cpp,h}: new function create_client_dir (). - pulsemanager.cpp: add Windows support to shutdown (). + - pulsemanager.cpp: add cleanup support to on_pulse_finished (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 44b52f3..de73156 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -264,6 +264,18 @@ void PulseManager::on_pulse_finished (int exit_code) { data = ba.data (); std::cout << data; + // Clean up + QDir work_dir (app_dir_); + +#ifdef Q_OS_WIN + work_dir.remove (pulse_dir_.absolutePath () + + "/pulse-pulseuser/pid"); + work_dir.rmdir (pulse_dir_.absolutePath () + + "/pulse-pulseuser"); +#endif // defined (Q_OS_WIN) + + work_dir.rmdir (pulse_dir_.absolutePath ()); + state_ = QProcess::NotRunning; emit (sig_pulse_server_terminated ()); } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6689ed4739d45e2e85fc64041b2d7a39b82d2356 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:20:22 2015 +0100 pulsemanager.cpp: add Windows stuff to initial env in constructor. --- debian/changelog | 1 + src/pulsemanager.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/debian/changelog b/debian/changelog index d55919f..90d8807 100644 --- a/debian/changelog +++ b/debian/changelog @@ -203,6 +203,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: new function create_client_dir (). - pulsemanager.cpp: add Windows support to shutdown (). - pulsemanager.cpp: add cleanup support to on_pulse_finished (). + - pulsemanager.cpp: add Windows stuff to initial env in constructor. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index de73156..8bb901e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -42,6 +42,10 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), env_ = QProcessEnvironment::systemEnvironment (); env_.insert ("HOME", pulse_dir_.absolutePath ()); env_.insert ("TEMP", pulse_dir_.absolutePath () + "/tmp"); +#ifdef Q_OS_WIN + env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); + env_.insert ("USERNAME", "pulseuser"); +#endif // defined (Q_OS_WIN) } PulseManager::~PulseManager () { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 554524ca61f49a23c4e8473d3de4a66cab700105 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:31:00 2015 +0100 pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 19 +++++++++++++++++++ src/pulsemanager.h | 1 + 3 files changed, 22 insertions(+) diff --git a/debian/changelog b/debian/changelog index 90d8807..611ed42 100644 --- a/debian/changelog +++ b/debian/changelog @@ -204,6 +204,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: add Windows support to shutdown (). - pulsemanager.cpp: add cleanup support to on_pulse_finished (). - pulsemanager.cpp: add Windows stuff to initial env in constructor. + - pulsemanager.{cpp,h}: add new function start_generic () to split off + common functionality. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 8bb901e..6a3e9d8 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -80,6 +80,25 @@ void PulseManager::start () { } } +void PulseManager::start_generic () { + pulse_server_->setProcessEnvironment (env_); + pulse_server_->setWorkingDirectory (server_working_dir_); + + pulse_server_->start (server_binary_, server_args_); + if (pulse_server_->waitForStarted ()) { + x2goDebug << "pulse started with arguments" << server_args_ << "; waiting for finish..."; + state_ = QProcess::Running; + + connect (pulse_server_, SIGNAL (finished (int)), + this, SLOT (slot_on_pulse_finished (int))); + +#ifdef DEBUG + // Give PA a little time to come up. + QTimer::singleShot (3000, this, SLOT (slot_play_startup_sound ())); +#endif // defined (DEBUG) + } +} + void PulseManager::start_osx () { if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e5f4b87..be94414 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -62,6 +62,7 @@ class PulseManager: public QObject { void start_win (); // FIXME void start_linux (); + void start_generic (); void find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 546fbbbbfecc5cd1943955ebe4d65512af5d7819 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:37:09 2015 +0100 pulsemanager.cpp: let start_osx () use start_generic (). --- debian/changelog | 1 + src/pulsemanager.cpp | 41 ++++++++++++++--------------------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/debian/changelog b/debian/changelog index 611ed42..fd018fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -206,6 +206,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: add Windows stuff to initial env in constructor. - pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. + - pulsemanager.cpp: let start_osx () use start_generic (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 6a3e9d8..1041797 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -100,37 +100,24 @@ void PulseManager::start_generic () { } void PulseManager::start_osx () { - if (generate_server_config () && generate_client_config ()) { - cleanup_client_dir (); - - pulse_server_->setProcessEnvironment (env_); - - QStringList args; - args << "--exit-idle-time=-1" << "-n" - << "-F" << pulse_dir_.absolutePath () + "/config.pa" - << "-p" - << QDir (app_dir_ - + "/../Frameworks/pulse-2.0/modules").absolutePath () - << "--high-priority"; + server_args_ = QStringList (); + server_args_ << "--exit-idle-time=-1" << "-n" + << "-F" << pulse_dir_.absolutePath () + "/config.pa" + << "-p" + << QDir (app_dir_ + + "/../Frameworks/pulse-2.0/modules").absolutePath () + << "--high-priority"; #ifdef DEBUG - args << "--log-level=debug"; -#endif - - pulse_server_->setWorkingDirectory (app_dir_ + "/../exe/"); - pulse_server_->start (app_dir_ + "/../exe/pulseaudio", args); + server_args_ << "--log-level=debug"; +#endif // defined (DEBUG) - if (pulse_server_->waitForStarted ()) { - x2goDebug << "pulse started with" << args << "waiting for finish..."; - state_ = QProcess::Running; + server_working_dir_ = QString (app_dir_ + "/../exe/"); + server_binary_ = QString (server_working_dir_ + "/pulseaudio"); - connect (pulse_server_, SIGNAL (finished (int)), - this, SLOT (on_pulse_finished (int))); + if (generate_server_config () && generate_client_config ()) { + cleanup_client_dir (); -#ifdef DEBUG - // Give PA a little time to come up. - QTimer::singleShot (5000, this, SLOT (slot_play_startup_sound ())); -#endif // defined (DEBUG) - } + start_generic (); } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 53d18eba03fb4e48410b01c357f232fb02bdc375 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:42:36 2015 +0100 pulsemanager.cpp: also load module-esound-protocol-tcp module. --- debian/changelog | 1 + src/pulsemanager.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 75f116f..66b21f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -209,6 +209,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: let start_osx () use start_generic (). - pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. + - pulsemanager.cpp: also load module-esound-protocol-tcp module. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index a4419db..d705486 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -200,6 +200,11 @@ bool PulseManager::generate_server_config () { + QString::number (pulse_port_) << endl; config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; config_tmp_file_stream << "load-module module-esound-protocol-unix" << endl; + + config_tmp_file_stream << "load-module module-esound-protocol-tcp port=" + << QString::number (esd_port_) + << endl; + config_tmp_file_stream << "load-module module-coreaudio-detect"; if (disable_input) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2918435f05deb085d342594c85d260c613c58a8d Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:39:43 2015 +0100 pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 21 +++++++++++++++++++++ src/pulsemanager.h | 1 - 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fd018fc..75f116f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -207,6 +207,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add new function start_generic () to split off common functionality. - pulsemanager.cpp: let start_osx () use start_generic (). + - pulsemanager.{cpp,h}: implement start_win () as part of Windows + functionality. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 1041797..a4419db 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -121,6 +121,27 @@ void PulseManager::start_osx () { } } +void PulseManager::start_win () { + server_args_ = QStringList (); + server_args_ << "--exit-idle-time=-1" << "-n" + << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/config.pa").absolutePath ()) + << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-1.1/" + + "modules/").absolutePath ()); +#ifdef DEBUG + server_args_ << "--log-level=debug"; +#endif // defined (DEBUG) + + server_working_dir_ = QString (app_dir_ + "/pulse/"); + server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); + + if (generateServerConfig () && generateClientConfig ()) { + create_client_dir (); + + start_generic (); + } +} + void PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index be94414..8463fb5 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -58,7 +58,6 @@ class PulseManager: public QObject { private: PulseManager (const PulseManager &other); void start_osx (); - // FIXME void start_win (); // FIXME void start_linux (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit bab4e4d8c6ba20cba63fe0693bfdca6d3e297795 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:44:07 2015 +0100 pulsemanager.cpp: make generate_server_config () Windows-compatible. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 66b21f7..a47f1e8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -210,6 +210,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: implement start_win () as part of Windows functionality. - pulsemanager.cpp: also load module-esound-protocol-tcp module. + - pulsemanager.cpp: make generate_server_config () Windows-compatible. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index d705486..3704000 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -198,14 +198,22 @@ bool PulseManager::generate_server_config () { config_tmp_file_stream << "load-module module-native-protocol-tcp port=" + QString::number (pulse_port_) << endl; + +#ifdef Q_OS_UNIX config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; config_tmp_file_stream << "load-module module-esound-protocol-unix" << endl; +#endif // defined(Q_OS_UNIX) config_tmp_file_stream << "load-module module-esound-protocol-tcp port=" << QString::number (esd_port_) << endl; +#ifdef Q_OS_DARWIN config_tmp_file_stream << "load-module module-coreaudio-detect"; +#elif defined (Q_OS_WIN) + config_tmp_file_stream << "load-module module-waveout"; +// FIXME Linux +#endif // defined (Q_OS_DARWIN) if (disable_input) config_tmp_file_stream << " record=0"; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 792c8d041658ba820d1280b8b9867c12e56932e1 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:44:53 2015 +0100 pulsemanager.cpp: make generate_client_config () Windows-compatible. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a47f1e8..0a0444f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -211,6 +211,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium functionality. - pulsemanager.cpp: also load module-esound-protocol-tcp module. - pulsemanager.cpp: make generate_server_config () Windows-compatible. + - pulsemanager.cpp: make generate_client_config () Windows-compatible. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3704000..5e66e44 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -236,21 +236,27 @@ bool PulseManager::generate_server_config () { bool PulseManager::generate_client_config () { QTemporaryFile client_config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); - QString client_config_file_name (pulse_dir_.absolutePath () + "/.pulse/client.conf"); + QString client_config_file_name (pulse_dir_.absolutePath () + + "/.pulse/client.conf"); bool ret = false; if (client_config_tmp_file.open ()) { QTextStream config_tmp_file_stream (&client_config_tmp_file); config_tmp_file_stream << "autospawn=no" << endl; +#ifdef Q_OS_WIN + config_tmp_file_stream << "default-server=localhost:" << pulse_port_ << endl; +#endif // defined (Q_OS_WIN) config_tmp_file_stream << "daemon-binary=" - << QDir (app_dir_ - + "/../exe/pulseaudio").absolutePath () + << QDir::toNativeSeparators (QDir (server_binary_).absolutePath ()) << endl; if (QFile::exists (client_config_file_name)) QFile::remove (client_config_file_name); + QDir client_config_dir (pulse_dir_.absolutePath () + "/.pulse/"); + client_config_dir.mkpath (client_config_dir.absolutePath ()); + client_config_tmp_file.copy (client_config_file_name); client_config_tmp_file.remove (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2665b8e202dede334babc0724d9f232851007b67 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:45:49 2015 +0100 pulsemanager.cpp: only play startup sound if DEBUG macro is defined. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0a0444f..b04458a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -212,6 +212,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: also load module-esound-protocol-tcp module. - pulsemanager.cpp: make generate_server_config () Windows-compatible. - pulsemanager.cpp: make generate_client_config () Windows-compatible. + - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 5e66e44..421e54b 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -292,6 +292,7 @@ void PulseManager::create_client_dir () { } void PulseManager::slot_play_startup_sound () { +#ifdef DEBUG QProcess play_file (0); play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); @@ -301,6 +302,7 @@ void PulseManager::slot_play_startup_sound () { if (play_file.waitForStarted ()) play_file.waitForFinished (); +#endif // defined (DEBUG) } void PulseManager::on_pulse_finished (int exit_code) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e5a74dfccf51f9e9a855c257a951e80728244233 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Oct 30 03:47:37 2015 +0100 pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index b04458a..2a38684 100644 --- a/debian/changelog +++ b/debian/changelog @@ -213,6 +213,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make generate_server_config () Windows-compatible. - pulsemanager.cpp: make generate_client_config () Windows-compatible. - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. + - pulsemanager.cpp: make startup sound playing via + slot_play_startup_sound () Windows-compatible. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 421e54b..512b027 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -294,11 +294,22 @@ void PulseManager::create_client_dir () { void PulseManager::slot_play_startup_sound () { #ifdef DEBUG QProcess play_file (0); + QString play_file_binary = QString (app_dir_); + QString play_file_file = play_file_binary; - play_file.setWorkingDirectory (pulse_server_->workingDirectory ()); +#ifdef Q_OS_DARWIN + play_file_binary += "/../exe/paplay"; + play_file_file += "/../Resources/startup.wav"; +#elif defined (Q_OS_WIN) + playFileBinary += "/pulse/paplay.exe"; + playFileFile += "/startup.wav"; +#endif // defined (Q_OS_DARWIN) + + QStringList args; + args << play_file_file; + play_file.setWorkingDirectory (server_working_dir_); play_file.setProcessEnvironment (env_); - play_file.start (app_dir_ + "/../exe/paplay " - + app_dir_ + "/../Resources/startup.wav"); + play_file.start (play_file_binary, args); if (play_file.waitForStarted ()) play_file.waitForFinished (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit f40b41636f439f418aa6ac716cd456bb20d7b445 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:35:23 2015 +0100 pulsemanager.h: whitespace only. --- src/pulsemanager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 8463fb5..a42f1ca 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -36,6 +36,7 @@ #include <QTimer> #include <assert.h> #include <cstdint> + #include "x2gologdebug.h" #include "x2gosettings.h" -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit cc214a03c40df1c43c48f8029e0d6f2860d66756 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:35:57 2015 +0100 pulsemanager.cpp: typo fix in member variable name server_working_dir_. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2a38684..ca39619 100644 --- a/debian/changelog +++ b/debian/changelog @@ -215,6 +215,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: only play startup sound if DEBUG macro is defined. - pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. + - pulsemanager.cpp: typo fix in variable name server_working_dir_. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 512b027..7dda3d2 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -32,7 +32,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), app_dir_ (QApplication::applicationDirPath ()), server_args_ (QStringList ()), server_binary_ (QString ("")), - server_working_dir (QString ("")), + server_working_dir_ (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0) { pulse_dir_ = QDir (QDir::homePath ()); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 96ed535d4d04dabf03c186154516f0862f9610cc Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:39:33 2015 +0100 pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- src/pulsemanager.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index ca39619..181aa9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -216,6 +216,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: make startup sound playing via slot_play_startup_sound () Windows-compatible. - pulsemanager.cpp: typo fix in variable name server_working_dir_. + - pulsemanager.{cpp,h}: find_port () actually returns a value, fix + declaration accordingly. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7dda3d2..ae8ece9 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -142,7 +142,7 @@ void PulseManager::start_win () { } } -void PulseManager::find_port (bool search_esd) { +bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; std::uint16_t ret = pulse_port_; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index a42f1ca..e1a088a 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -63,7 +63,7 @@ class PulseManager: public QObject { // FIXME void start_linux (); void start_generic (); - void find_port (bool search_esd = false); + bool find_port (bool search_esd = false); bool generate_server_config (); bool generate_client_config (); void cleanup_client_dir (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6cfdbadc189a43e9610c3c86ffbf3d0b8c0a2964 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:48:11 2015 +0100 pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 21 +++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/debian/changelog b/debian/changelog index 181aa9a..3a38751 100644 --- a/debian/changelog +++ b/debian/changelog @@ -218,6 +218,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: typo fix in variable name server_working_dir_. - pulsemanager.{cpp,h}: find_port () actually returns a value, fix declaration accordingly. + - pulsemanager.cpp: fix compile errors in find_port () by renaming the ret + or port variable to search_port. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ae8ece9..7b0fa65 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -145,39 +145,40 @@ void PulseManager::start_win () { bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; - std::uint16_t ret = pulse_port_; + std::uint16_t search_port = pulse_port_; std::uint16_t other_port = esd_port_; // If the search_esd parameter is true, find a free port // for the PulseAudio emulation. if (search_esd) { - ret = esd_port_; + search_port = esd_port_; other_port = pulse_port_; } do { // Skip this port, if it's reserved for the counterpart. - if (ret == other_port) { - ++ret; + if (search_port == other_port) { + ++search_port; continue; } - tcpSocket.connectToHost ("127.0.0.1", ret); + tcpSocket.connectToHost ("127.0.0.1", search_port); if (tcpSocket.waitForConnected (1000)) { tcpSocket.close (); free = false; - ++ret; + ++search_port; } - else + else { free = true; - } while ((!free) && (port > 1023)); + } + } while ((!free) && (search_port > 1023)); if (!search_esd) { - pulse_port_ = ret; + pulse_port_ = search_port; } else { - esd_port_ = ret; + esd_port_ = search_port; } return (free); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 581e38bd40f4d37f6328548f0008ef84a619eb8d Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:49:35 2015 +0100 pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 3a38751..5dfdf0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -220,6 +220,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium declaration accordingly. - pulsemanager.cpp: fix compile errors in find_port () by renaming the ret or port variable to search_port. + - pulsemanager.cpp: fix another compile error due to typo'd versions of + generate_server_config () and generate_client_config (). [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7b0fa65..ecf47a3 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -135,7 +135,7 @@ void PulseManager::start_win () { server_working_dir_ = QString (app_dir_ + "/pulse/"); server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); - if (generateServerConfig () && generateClientConfig ()) { + if (generate_server_config () && generate_client_config ()) { create_client_dir (); start_generic (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit ea3b3f4daf05ec16efeca7436702207e90d4c4af Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:51:12 2015 +0100 pulsemanager.cpp: another typo fix: findPort -> find_port. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5dfdf0c..82f53dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -222,6 +222,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium or port variable to search_port. - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). + - pulsemanager.cpp: another typo fix: findPort -> find_port. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ecf47a3..b4f8481 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -69,7 +69,7 @@ void PulseManager::start () { // failed. Better trust your compiler to // optimize this statement and save some // cycles. - if ((findPort (false)) && (findPort (true))) { + if ((find_port (false)) && (find_port (true))) { #ifdef Q_OS_DARWIN start_osx (); #elif defined (Q_OS_WIN) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b34cab4212f318d5b5685dfe0cb4d9640fd4edd3 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:52:25 2015 +0100 pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 82f53dd..796d74b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -223,6 +223,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). - pulsemanager.cpp: another typo fix: findPort -> find_port. + - pulsemanager.cpp: reorder member varibles in initialization list. + Compile warning fix. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index b4f8481..3d01cde 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -25,10 +25,10 @@ #endif // defined (NDEBUG) PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), + pulse_server_ (NULL), pulse_port_ (4713), esd_port_ (4714), state_ (QProcess::NotRunning), - pulse_server_ (NULL), app_dir_ (QApplication::applicationDirPath ()), server_args_ (QStringList ()), server_binary_ (QString ("")), -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 7bf8af99c237dc61b6176d8afe22b8fa7f24d8dd Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:53:38 2015 +0100 pulsemanager.cpp: add "dummy" start_linux () function. --- debian/changelog | 3 ++- src/pulsemanager.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 796d74b..0f781e6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -223,8 +223,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix another compile error due to typo'd versions of generate_server_config () and generate_client_config (). - pulsemanager.cpp: another typo fix: findPort -> find_port. - - pulsemanager.cpp: reorder member varibles in initialization list. + - pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. + - pulsemanager.cpp: add "dummy" start_linux () function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3d01cde..9c6de0d 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -142,6 +142,10 @@ void PulseManager::start_win () { } } +void PulseManager::start_linux () { + /* Do nothing - assumed to be already running. */ +} + bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit df8cec39847c9367c6c0558cbf65bf03d9863086 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:55:25 2015 +0100 pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. We need them right away. --- debian/changelog | 3 +++ src/pulsemanager.cpp | 46 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0f781e6..4f6fdef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -226,6 +226,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: reorder member variables in initialization list. Compile warning fix. - pulsemanager.cpp: add "dummy" start_linux () function. + - pulsemanager.cpp: generate platform-dependent values for member + variables server_working_dir_ and server_binary_ in constructor. We need + them right away. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9c6de0d..bb0bf73 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -17,6 +17,9 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include <unistd.h> +#include <stdlib.h> + #include "pulsemanager.h" #ifndef DEBUG @@ -46,6 +49,43 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), env_.insert ("USERPROFILE", pulse_dir_.absolutePath ()); env_.insert ("USERNAME", "pulseuser"); #endif // defined (Q_OS_WIN) + + /* Set server binary and working dir paths. */ +#ifdef Q_OS_DARWIN + server_working_dir_ = QString (app_dir_ + "/../exe/"); + server_binary_ = QString (server_working_dir_ + "/pulseaudio"); +#elif defined (Q_OS_WIN) + server_working_dir_ = QString (app_dir_ + "/pulse/"); + server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); +#elif defined (Q_OS_LINUX) + std::size_t path_len = pathconf (".", _PC_PATH_MAX); + + if (-1 == path_len) { + path_len = 1024; + } + + char *buf, *ptr; + + for (buf = ptr = NULL; ptr == NULL; path_len += 20) { + if (NULL == (buf = realloc (buf, path_len))) { + x2goErrorf (16) << "Could not allocate buffer for getting current working directory!" << std::endl; + abort (); + } + + ptr = getcwd (buf, path_len); + + if ((NULL == ptr) && (ERANGE != erange)) { + x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)) << std::endl; + abort (); + } + } + + server_working_dir_ = QString (buf); + server_binary_ = QString ("pulseaudio"); + + free (buf); + buf = ptr = NULL; +#endif // defined (Q_OS_DARWIN) } PulseManager::~PulseManager () { @@ -111,9 +151,6 @@ void PulseManager::start_osx () { server_args_ << "--log-level=debug"; #endif // defined (DEBUG) - server_working_dir_ = QString (app_dir_ + "/../exe/"); - server_binary_ = QString (server_working_dir_ + "/pulseaudio"); - if (generate_server_config () && generate_client_config ()) { cleanup_client_dir (); @@ -132,9 +169,6 @@ void PulseManager::start_win () { server_args_ << "--log-level=debug"; #endif // defined (DEBUG) - server_working_dir_ = QString (app_dir_ + "/pulse/"); - server_binary_ = QString (app_dir_ + "/pulse/pulseaudio.exe"); - if (generate_server_config () && generate_client_config ()) { create_client_dir (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9cc8467f577f38e047db9bc0c049e4cf121b32ce Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Nov 30 04:58:52 2015 +0100 pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. Call it in the constructor. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 9 +++++++++ src/pulsemanager.h | 1 + 3 files changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 4f6fdef..7981e75 100644 --- a/debian/changelog +++ b/debian/changelog @@ -229,6 +229,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: generate platform-dependent values for member variables server_working_dir_ and server_binary_ in constructor. We need them right away. + - pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () + with first skeleton. Call it in the constructor. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index bb0bf73..ade1ec6 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -86,6 +86,8 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), free (buf); buf = ptr = NULL; #endif // defined (Q_OS_DARWIN) + + fetch_pulseaudio_version (); } PulseManager::~PulseManager () { @@ -180,6 +182,13 @@ void PulseManager::start_linux () { /* Do nothing - assumed to be already running. */ } +void PulseManager::fetch_pulseaudio_version () { + QStringList args = "--version"; + QProcess tmp_server (this); + + tmp_server->setWorkingDirectory (server_working_dir_); +} + bool PulseManager::find_port (bool search_esd) { QTcpSocket tcpSocket (0); bool free = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index e1a088a..fb21992 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -58,6 +58,7 @@ class PulseManager: public QObject { private: PulseManager (const PulseManager &other); + void fetch_pulseaudio_version (); void start_osx (); void start_win (); // FIXME -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 72348926a2dd94268b9563efc1b596d7cd4bbdbc Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 21:37:22 2015 +0100 pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index 7981e75..7ecc24d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -231,6 +231,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium them right away. - pulsemanager.{cpp,h}: new member function fetch_pulseaudio_version () with first skeleton. Call it in the constructor. + - pulsemanager.cpp: re-initialize buffer string on each run while getting + CWD on Linux. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ade1ec6..06ef766 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -72,6 +72,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), abort (); } + memset (buf, 0, path_len); ptr = getcwd (buf, path_len); if ((NULL == ptr) && (ERANGE != erange)) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 3ab2387af157fef68de255687ccdfaa60cdb23e4 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 21:39:19 2015 +0100 pulsemanager.cpp: fix some error messages by removing redundant newlines. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7ecc24d..d6d01ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -233,6 +233,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium with first skeleton. Call it in the constructor. - pulsemanager.cpp: re-initialize buffer string on each run while getting CWD on Linux. + - pulsemanager.cpp: fix some error messages by removing redundant + newlines. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 06ef766..3f7256a 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -68,7 +68,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), for (buf = ptr = NULL; ptr == NULL; path_len += 20) { if (NULL == (buf = realloc (buf, path_len))) { - x2goErrorf (16) << "Could not allocate buffer for getting current working directory!" << std::endl; + x2goErrorf (16) << "Could not allocate buffer for getting current working directory!"; abort (); } @@ -76,7 +76,7 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), ptr = getcwd (buf, path_len); if ((NULL == ptr) && (ERANGE != erange)) { - x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)) << std::endl; + x2goErrorf (17) << "getcwd() failed: " << QString (strerror (errno)); abort (); } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 6232d91f11e4c06cbd93da6639f357b3c834a4b3 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Dec 30 23:11:44 2015 +0100 pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. Add new member variables for this and initialize them correctly. --- debian/changelog | 3 +++ src/pulsemanager.cpp | 4 +++- src/pulsemanager.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d6d01ab..7a445ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -235,6 +235,9 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium CWD on Linux. - pulsemanager.cpp: fix some error messages by removing redundant newlines. + - pulsemanager.{cpp,h}: some older PA versions used the major, minor and + micro numbering scheme together with a descriptive string. Add new + member variables for this and initialize them correctly. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 3f7256a..bdf7f62 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -37,7 +37,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), server_binary_ (QString ("")), server_working_dir_ (QString ("")), pulse_version_major_ (0), - pulse_version_minor_ (0) { + pulse_version_minor_ (0), + pulse_version_micro_ (0), + pulse_version_misc_ ("") { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index fb21992..52c4dfa 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -93,6 +93,8 @@ class PulseManager: public QObject { QString server_working_dir_; std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; + std::uint32_t pulse_version_micro_; + QString pulse_version_misc_; }; #ifdef NDEBUG_DEFINE -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 406fce687e418e9a3420341b09cf76085df0eb2d Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:38:16 2015 +0100 pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. --- debian/changelog | 2 ++ src/pulsemanager.h | 34 ++++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7a445ff..8c73ecf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -238,6 +238,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: some older PA versions used the major, minor and micro numbering scheme together with a descriptive string. Add new member variables for this and initialize them correctly. + - pulsemanager.h: reformat a bit by adding newlines and moving lines in a + (hopefully) logical fashion. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 52c4dfa..ec5e27c 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -46,51 +46,69 @@ class PulseManager: public QObject { public: PulseManager (); ~PulseManager (); + + QProcess::ProcessState state (); + std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); + void set_pulse_port (std::uint16_t pulse_port); void set_esd_port (std::uint16_t esd_port); - QProcess::ProcessState state (); + public slots: void start (); void restart (); + private: PulseManager (const PulseManager &other); - void fetch_pulseaudio_version (); + void start_osx (); void start_win (); // FIXME void start_linux (); void start_generic (); + + void fetch_pulseaudio_version (); + bool find_port (bool search_esd = false); + bool generate_server_config (); bool generate_client_config (); - void cleanup_client_dir (); + void create_client_dir (); + void cleanup_client_dir (); + void shutdown (); + bool is_server_running (); + private slots: void on_pulse_finished (int exit_code); void slot_play_startup_sound (); + signals: void sig_pulse_server_terminated (); + private: + QString app_dir_; QString pulse_X2Go_; QDir pulse_dir_; + QStringList server_args_; + QString server_binary_; + QString server_working_dir_; + QProcessEnvironment env_; QProcess *pulse_server_; + QProcess::ProcessState state_; + std::uint16_t pulse_port_; std::uint16_t esd_port_; - QProcess::ProcessState state_; - QString app_dir_; - QStringList server_args_; - QString server_binary_; - QString server_working_dir_; + std::uint32_t pulse_version_major_; std::uint32_t pulse_version_minor_; std::uint32_t pulse_version_micro_; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 1664b9d88ac5f52fc1a213091f427c30a372c155 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:55:17 2015 +0100 pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 22 ++++++++++++++++++---- src/pulsemanager.h | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 72b3c6b..9e95e46 100644 --- a/debian/changelog +++ b/debian/changelog @@ -242,6 +242,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium (hopefully) logical fashion. - pulsemanager.cpp: add algorithm for actually extracting PA version number. + - pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is + not currently running. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 09fb791..7ffdfcf 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -554,12 +554,26 @@ std::uint16_t PulseManager::get_esd_port () { return (esd_port_); } -void PulseManager::set_pulse_port (std::uint16_t pulse_port) { - pulse_port_ = pulse_port; +bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { + bool ret = false; + + if (!(is_server_running ())) { + pulse_port_ = pulse_port; + ret = true; + } + + return (ret); } -void PulseManager::set_esd_port (std::uint16_t esd_port) { - esd_port_ = esd_port; +bool PulseManager::set_esd_port (std::uint16_t esd_port) { + bool ret = false; + + if (!(is_server_running ())) { + esd_port_ = esd_port; + ret = true; + } + + return (ret); } void PulseManager::restart () { diff --git a/src/pulsemanager.h b/src/pulsemanager.h index ec5e27c..3dbd94f 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -52,8 +52,8 @@ class PulseManager: public QObject { std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); - void set_pulse_port (std::uint16_t pulse_port); - void set_esd_port (std::uint16_t esd_port); + bool set_pulse_port (std::uint16_t pulse_port); + bool set_esd_port (std::uint16_t esd_port); public slots: -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 20d8507391ff995c6e1140a146c7d8ca01b43d0e Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 00:39:34 2015 +0100 pulsemanager.cpp: add algorithm for actually extracting PA version number. --- debian/changelog | 2 + src/pulsemanager.cpp | 129 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 130 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8c73ecf..72b3c6b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -240,6 +240,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium member variables for this and initialize them correctly. - pulsemanager.h: reformat a bit by adding newlines and moving lines in a (hopefully) logical fashion. + - pulsemanager.cpp: add algorithm for actually extracting PA version + number. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index bdf7f62..09fb791 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -189,7 +189,134 @@ void PulseManager::fetch_pulseaudio_version () { QStringList args = "--version"; QProcess tmp_server (this); - tmp_server->setWorkingDirectory (server_working_dir_); + /* Start PA with --version argument. */ + tmp_server.setWorkingDirectory (server_working_dir_); + tmp_server.start (server_binary_, args); + + /* Wait until the process exited again. */ + if (tmp_server->waitForFinished ()) { + /* Read stdout and split it up on newlines. */ + QByteArray ba = pulse_server_->readAllStandardOutput (); + QString stdout_data (ba.data ()); + QStringList stdout_list (stdout_data.split ("\n")); + + bool found = false; + for (QStringList::const_iterator cit = stdout_list.begin (); cit != stdout_list.end (); ++cit) { + /* Remove trailing whitespace, mostly carriage returns on Windows. */ + QString tmp_str (*cit); + tmp_str = tmp_str.trimmed (); + + QString needle ("pulseaudio "); + + if (tmp_str.startsWith (needle)) { + /* Drop first part. */ + tmp_str = tmp_str.mid (needle.size ()); + + /* We should be at a digit now. */ + bool numbers_found[3] = { false, false, false }; + QString tmp_str = QString (""); + for (QString::const_iterator cit = tmp_str.begin (); cit != tmp_str.end (); ++cit) { + if (!(numbers_found[0])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if ((*cit) == '.') { + /* First number part complete, let's convert the string and skip the period. */ + numbers_found[0] = true; + bool convert_success = false; + pulse_version_major_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (20) << "Unable to convert major version number string to integer."; + abort (); + } + + tmp_str = QString (""); + } + else { + x2goErrorf (21) << "Unexpected character found when parsing version string for major version number: '" << QString (*cit) << "'."; + abort (); + } + } + else if (!(numbers_found[1])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if (((*cit) == '.') || ((*cit) == '-')) { + /* + * Second number part complete, let's convert the string and then check whether + * we stopped at a period or a dash character. + */ + numbers_found[1] = true; + bool convert_success = false; + pulse_version_minor_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (22) << "Unable to convert minor version number string to integer."; + abort (); + } + + tmp_str = QString (""); + + if ((*cit) == '-') { + /* + * There will be no micro version, skip it entirely and assume the default + * value of zero. + */ + numbers_found[2] = true; + } + } + else { + x2goErrorf (23) << "Unexpected character found when parsing version string for minor version number: '" << QString (*cit) << "'."; + abort (); + } + } + else if (!(numbers_found[2])) { + if (((*cit) >= '0') && ((*cit) <= '9')) { + tmp_str.append (*cit); + } + else if ((*cit) == '-') { + /* Third number part complete, let's convert the string and skip the period. */ + numbers_found[2] = true; + bool convert_success = false; + pulse_version_micro_ = tmp_str.toUInt (&convert_success, 10); + + if (!convert_success) { + x2goErrorf (24) << "Unable to convert micro version number string to integer."; + abort (); + } + + tmp_str = QString (""); + } + else { + x2goErrorf (25) << "Unexpected character found when parsing version string for micro version number: '" << QString (*cit) << "'."; + abort (); + } + } + else { + /* Numbers should be good by now, let's fetch everything else. */ + tmp_str.append (*cit); + } + } + + /* Misc version part will be set to the trailing string. */ + pulse_version_misc_ = tmp_str; + } + else { + /* No need to look any further. */ + continue; + } + } + + if (!found) { + x2goErrorf (19) << "Unable to fetch PulseAudio version - unexpected format. Exiting."; + abort (); + } + } + else { + x2goErrorf (18) << "Unable to start PulseAudio to fetch its version number. Exiting."; + abort (); + } } bool PulseManager::find_port (bool search_esd) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit b3f6213e457192cb653ed2601a1e9a207e817128 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:03:00 2015 +0100 pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 34 +++++++++++++++++++++++++++++++++- src/pulsemanager.h | 7 +++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 9e95e46..62c84f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -244,6 +244,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium number. - pulsemanager.{cpp,h}: only allow changing PA or ESD ports when server is not currently running. + - pulsemanager.{cpp,h}: add record and playback private members, as well + as getters and setters. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 7ffdfcf..ea8124e 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -39,7 +39,9 @@ PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), pulse_version_major_ (0), pulse_version_minor_ (0), pulse_version_micro_ (0), - pulse_version_misc_ ("") { + pulse_version_misc_ (""), + record_ (true), + playback_ (true) { pulse_dir_ = QDir (QDir::homePath ()); pulse_dir_.mkpath (pulse_dir_.absolutePath () + pulse_X2Go_ + "/tmp"); pulse_dir_.cd (pulse_X2Go_.mid (1)); @@ -554,6 +556,14 @@ std::uint16_t PulseManager::get_esd_port () { return (esd_port_); } +bool PulseManager::get_record () { + return (record_); +} + +bool PulseManager::get_playback () { + return (playback_); +} + bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { bool ret = false; @@ -576,6 +586,28 @@ bool PulseManager::set_esd_port (std::uint16_t esd_port) { return (ret); } +bool PulseManager::set_record (bool record) { + bool ret = false; + + if (!(is_server_running ())) { + record_ = record; + ret = true; + } + + return (ret); +} + +bool PulseManager::set_playback (bool playback) { + bool ret = false; + + if (!(is_server_running ())) { + playback_ = playback; + ret = true; + } + + return (ret); +} + void PulseManager::restart () { if (pulse_server_ && is_server_running ()) shutdown (); diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 3dbd94f..57b80bd 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -51,9 +51,13 @@ class PulseManager: public QObject { std::uint16_t get_pulse_port (); std::uint16_t get_esd_port (); + bool get_record (); + bool get_playback (); bool set_pulse_port (std::uint16_t pulse_port); bool set_esd_port (std::uint16_t esd_port); + bool set_record (bool record); + bool set_playback (bool playback); public slots: @@ -113,6 +117,9 @@ class PulseManager: public QObject { std::uint32_t pulse_version_minor_; std::uint32_t pulse_version_micro_; QString pulse_version_misc_; + + bool record_; + bool playback_; }; #ifdef NDEBUG_DEFINE -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 09abea184f5ab1c6539f1ea8f3c05a590e57e9fc Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:41:54 2015 +0100 pulsemanager.cpp: reorder member variables in initializer list. --- debian/changelog | 1 + src/pulsemanager.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 62c84f6..ead8be9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -246,6 +246,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium not currently running. - pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. + - pulsemanager.cpp: reorder member variables in initializer list. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index ea8124e..b3235a0 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -27,15 +27,15 @@ #define DEBUG #endif // defined (NDEBUG) -PulseManager::PulseManager () : pulse_X2Go_ ("/.x2go/pulse"), +PulseManager::PulseManager () : app_dir_ (QApplication::applicationDirPath ()), + pulse_X2Go_ ("/.x2go/pulse"), + server_binary_ (QString ("")), + server_working_dir_ (QString ("")), + server_args_ (QStringList ()), pulse_server_ (NULL), + state_ (QProcess::NotRunning), pulse_port_ (4713), esd_port_ (4714), - state_ (QProcess::NotRunning), - app_dir_ (QApplication::applicationDirPath ()), - server_args_ (QStringList ()), - server_binary_ (QString ("")), - server_working_dir_ (QString ("")), pulse_version_major_ (0), pulse_version_minor_ (0), pulse_version_micro_ (0), -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 5e2e5285f7627a75a6da5d1c863491bc6ef49e89 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 01:46:04 2015 +0100 pulsemanager.cpp: fix compile error in startup sound function. --- debian/changelog | 1 + src/pulsemanager.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ead8be9..0d9f3c9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -247,6 +247,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.{cpp,h}: add record and playback private members, as well as getters and setters. - pulsemanager.cpp: reorder member variables in initializer list. + - pulsemanager.cpp: fix compile error in startup sound function. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index b3235a0..63ebf11 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -196,7 +196,7 @@ void PulseManager::fetch_pulseaudio_version () { tmp_server.start (server_binary_, args); /* Wait until the process exited again. */ - if (tmp_server->waitForFinished ()) { + if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ QByteArray ba = pulse_server_->readAllStandardOutput (); QString stdout_data (ba.data ()); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 2d09a70caac8f1982aa8cad5ed6d650b0f5c05a8 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:11:16 2015 +0100 pulsemanager.h: more moving around. --- debian/changelog | 1 + src/pulsemanager.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 0d9f3c9..d7ea4c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -248,6 +248,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium as getters and setters. - pulsemanager.cpp: reorder member variables in initializer list. - pulsemanager.cpp: fix compile error in startup sound function. + - pulsemanager.h: more moving around. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 57b80bd..6d94e34 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -102,11 +102,11 @@ class PulseManager: public QObject { QString app_dir_; QString pulse_X2Go_; QDir pulse_dir_; - QStringList server_args_; QString server_binary_; QString server_working_dir_; QProcessEnvironment env_; + QStringList server_args_; QProcess *pulse_server_; QProcess::ProcessState state_; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 957430a2cfb6abae952ae78991f5b0978f8be6a4 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:12:59 2015 +0100 pulsemanager.cpp: use record and playback member variables. --- debian/changelog | 1 + src/pulsemanager.cpp | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index d7ea4c2..cbbf0bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -249,6 +249,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: reorder member variables in initializer list. - pulsemanager.cpp: fix compile error in startup sound function. - pulsemanager.h: more moving around. + - pulsemanager.cpp: use record and playback member variables. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 63ebf11..25f8f50 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -366,13 +366,8 @@ bool PulseManager::find_port (bool search_esd) { bool PulseManager::generate_server_config () { QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); - X2goSettings settings ("settings"); - bool disable_input = false; bool ret = false; - disable_input = settings.setting ()->value ("soundnoinput", - (QVariant) false).toBool (); - if (config_tmp_file.open ()) { QTextStream config_tmp_file_stream (&config_tmp_file); @@ -395,9 +390,22 @@ bool PulseManager::generate_server_config () { // FIXME Linux #endif // defined (Q_OS_DARWIN) - if (disable_input) - config_tmp_file_stream << " record=0"; + config_tmp_file_stream << " record="; + if (!record_) { + config_tmp_file_stream << "0"; + } + else { + config_tmp_file_stream << "1"; + } + config_tmp_file_stream << endl; + config_tmp_file_stream << " playback="; + if (!playback_) { + config_tmp_file_stream << "0"; + } + else { + config_tmp_file_stream << "1"; + } config_tmp_file_stream << endl; QFile config_file (config_file_name); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 1bd937d1048f372b18298853bdbd7833e6ce9594 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Dec 31 02:14:10 2015 +0100 pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 15 +++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index cbbf0bb..069ad43 100644 --- a/debian/changelog +++ b/debian/changelog @@ -250,6 +250,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: fix compile error in startup sound function. - pulsemanager.h: more moving around. - pulsemanager.cpp: use record and playback member variables. + - pulsemanager.cpp: cleanup, don't use copy assignment operator when we + just need to construct a new object. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 25f8f50..9a70e5d 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -188,7 +188,7 @@ void PulseManager::start_linux () { } void PulseManager::fetch_pulseaudio_version () { - QStringList args = "--version"; + QStringList args (QString ("--version")); QProcess tmp_server (this); /* Start PA with --version argument. */ @@ -198,7 +198,7 @@ void PulseManager::fetch_pulseaudio_version () { /* Wait until the process exited again. */ if (tmp_server.waitForFinished ()) { /* Read stdout and split it up on newlines. */ - QByteArray ba = pulse_server_->readAllStandardOutput (); + QByteArray ba (pulse_server_->readAllStandardOutput ()); QString stdout_data (ba.data ()); QStringList stdout_list (stdout_data.split ("\n")); @@ -364,7 +364,7 @@ bool PulseManager::find_port (bool search_esd) { } bool PulseManager::generate_server_config () { - QString config_file_name = pulse_dir_.absolutePath () + "/config.pa"; + QString config_file_name (pulse_dir_.absolutePath () + "/config.pa"); QTemporaryFile config_tmp_file (pulse_dir_.absolutePath () + "/tmp/tmpconfig"); bool ret = false; @@ -482,8 +482,8 @@ void PulseManager::create_client_dir () { void PulseManager::slot_play_startup_sound () { #ifdef DEBUG QProcess play_file (0); - QString play_file_binary = QString (app_dir_); - QString play_file_file = play_file_binary; + QString play_file_binary (app_dir_); + QString play_file_file (play_file_binary); #ifdef Q_OS_DARWIN play_file_binary += "/../exe/paplay"; @@ -493,8 +493,7 @@ void PulseManager::slot_play_startup_sound () { playFileFile += "/startup.wav"; #endif // defined (Q_OS_DARWIN) - QStringList args; - args << play_file_file; + QStringList args (play_file_file); play_file.setWorkingDirectory (server_working_dir_); play_file.setProcessEnvironment (env_); play_file.start (play_file_binary, args); @@ -508,7 +507,7 @@ void PulseManager::on_pulse_finished (int exit_code) { if (!exit_code) x2goDebug << "Warning! Pulseaudio's exit code is non-zero."; - QByteArray ba = pulse_server_->readAllStandardOutput (); + QByteArray ba (pulse_server_->readAllStandardOutput ()); char *data = ba.data (); std::cout << data; ba = pulse_server_->readAllStandardError (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit a39a24aba88d34509c9c37fdfe9fce329125b890 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 21:11:46 2016 +0200 macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. --- debian/changelog | 1 + macbuild.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 069ad43..c11426c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -252,6 +252,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: use record and playback member variables. - pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. + - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index c95955e..eb128c0 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -177,7 +177,7 @@ NXPROXY="nxproxy" PULSEAUDIO_BINARIES=( "pulseaudio" "esdcompat" "pacat" "pacmd" "pactl" "pamon" "paplay" "parec" "parecord" "pasuspender" ) PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" - "pulse-6.0" + "pulse-8.0" "pulseaudio" ) typeset -a special_files_regex -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 1e704668fdb18fba23ef1a62589fdafa2416fe45 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 22:21:37 2016 +0200 macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". --- debian/changelog | 2 ++ macbuild.sh | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c11426c..aedb8cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -253,6 +253,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: cleanup, don't use copy assignment operator when we just need to construct a new object. - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. + - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio + subdirectory now, adding it to "special files workaround". [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/macbuild.sh b/macbuild.sh index eb128c0..d5aadfe 100755 --- a/macbuild.sh +++ b/macbuild.sh @@ -181,7 +181,8 @@ PULSEAUDIO_LIBRARIES=( "libpulse-simple.0.dylib" "pulseaudio" ) typeset -a special_files_regex -special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" ) +special_files_regex+=( "pulseaudio/libpulsecommon-[0-9]\.[0-9]\.dylib" + "pulseaudio/libpulsecore-[0-9]\.[0-9]\.dylib" ) typeset -r dependency_base_format='@executable_path/../Frameworks/' -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit fd08fbedb59a99b8f1e94bb09762a72fa34ae653 Author: Mihai Moldovan <ionic@ionic.de> Date: Thu Mar 31 22:54:47 2016 +0200 pulsemanager.cpp: remove config.pa while doing post-exit cleanups. --- debian/changelog | 1 + src/pulsemanager.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index aedb8cb..1faad32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -255,6 +255,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: PulseAudio has been updated to version 8.0. Reflect this. - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". + - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9a70e5d..0d20ed1 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -524,6 +524,14 @@ void PulseManager::on_pulse_finished (int exit_code) { + "/pulse-pulseuser"); #endif // defined (Q_OS_WIN) +#if defined (Q_OS_DARWIN) || defined (Q_OS_WIN) + // Remove server config file, otherwise the directory won't be empty. + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/config.pa").absolutePath ())); +#else // Linux + // FIXME. +#endif + work_dir.rmdir (pulse_dir_.absolutePath ()); state_ = QProcess::NotRunning; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit e999dee45c8f5773761762ce0c27868f0a8d06c5 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 00:55:28 2016 +0200 src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 4 ++++ src/pulsemanager.h | 1 + 3 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1faad32..cb9445a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -256,6 +256,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - macbuild.sh: libpulsecore.dylib also resides in the "private" pulseaudio subdirectory now, adding it to "special files workaround". - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. + - src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the + (OS-dependent) PulseAudio config and cookie directory. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 0d20ed1..4ac7ba5 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -579,6 +579,10 @@ bool PulseManager::get_playback () { return (playback_); } +QDir PulseManager::get_pulse_dir () { + return (pulse_dir_); +} + bool PulseManager::set_pulse_port (std::uint16_t pulse_port) { bool ret = false; diff --git a/src/pulsemanager.h b/src/pulsemanager.h index 6d94e34..af7ae77 100644 --- a/src/pulsemanager.h +++ b/src/pulsemanager.h @@ -53,6 +53,7 @@ class PulseManager: public QObject { std::uint16_t get_esd_port (); bool get_record (); bool get_playback (); + QDir get_pulse_dir (); bool set_pulse_port (std::uint16_t pulse_port); bool set_esd_port (std::uint16_t esd_port); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 049fd32d8b5b1696b1ebeb04add6c7ecdeae1b55 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:17:09 2016 +0200 src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. --- debian/changelog | 2 ++ src/pulsemanager.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index cb9445a..091e819 100644 --- a/debian/changelog +++ b/debian/changelog @@ -258,6 +258,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - pulsemanager.cpp: remove config.pa while doing post-exit cleanups. - src/pulsemanager.{cpp,h}: add get_pulse_dir () for fetching the (OS-dependent) PulseAudio config and cookie directory. + - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones + depending on the detected PA version. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 4ac7ba5..9f57525 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -152,7 +152,11 @@ void PulseManager::start_osx () { << "-F" << pulse_dir_.absolutePath () + "/config.pa" << "-p" << QDir (app_dir_ - + "/../Frameworks/pulse-2.0/modules").absolutePath () + + "/../Frameworks/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules").absolutePath () << "--high-priority"; #ifdef DEBUG server_args_ << "--log-level=debug"; @@ -170,8 +174,11 @@ void PulseManager::start_win () { server_args_ << "--exit-idle-time=-1" << "-n" << "-F" << QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + "/config.pa").absolutePath ()) - << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-1.1/" - + "modules/").absolutePath ()); + << "-p" << QDir::toNativeSeparators (QDir (app_dir_ + "/pulse/lib/pulse-" + + QString::number (pulse_version_major_) + + "." + + QString::number (pulse_version_minor_) + + "/modules/").absolutePath ()); #ifdef DEBUG server_args_ << "--log-level=debug"; #endif // defined (DEBUG) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0b309c8117ea4e811e983977c1e86f9fbe060c27 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:39:02 2016 +0200 src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) --- debian/changelog | 1 + src/pulsemanager.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 091e819..903910f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -260,6 +260,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium (OS-dependent) PulseAudio config and cookie directory. - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. + - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 9f57525..03e321f 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -159,7 +159,9 @@ void PulseManager::start_osx () { + "/modules").absolutePath () << "--high-priority"; #ifdef DEBUG - server_args_ << "--log-level=debug"; + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" pulse_dir_.absolutePath () + "/pulse.log"; #endif // defined (DEBUG) if (generate_server_config () && generate_client_config ()) { @@ -180,7 +182,10 @@ void PulseManager::start_win () { + QString::number (pulse_version_minor_) + "/modules/").absolutePath ()); #ifdef DEBUG - server_args_ << "--log-level=debug"; + /* FIXME: need a way to request debugging. */ + server_args_ << "--log-level=debug" + << "--verbose" + << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; #endif // defined (DEBUG) if (generate_server_config () && generate_client_config ()) { @@ -535,6 +540,8 @@ void PulseManager::on_pulse_finished (int exit_code) { // Remove server config file, otherwise the directory won't be empty. work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + "/config.pa").absolutePath ())); + work_dir.remove (QDir::toNativeSeparators (QDir (pulse_dir_.absolutePath () + + "/pulse.log").absolutePath ())); #else // Linux // FIXME. #endif -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 394de39f3038fc8987cf1ae27586d310211ef08d Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 01:47:43 2016 +0200 src/pulsemanager.cpp: backport fix for 526. --- debian/changelog | 1 + src/pulsemanager.cpp | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index 903910f..76b5501 100644 --- a/debian/changelog +++ b/debian/changelog @@ -261,6 +261,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: replace hardcoded modules paths with dynamic ones depending on the detected PA version. - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) + - src/pulsemanager.cpp: backport fix for 526. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index 03e321f..c8fc7cd 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -19,6 +19,7 @@ #include <unistd.h> #include <stdlib.h> +#include <QSysInfo> #include "pulsemanager.h" @@ -188,6 +189,24 @@ void PulseManager::start_win () { << "--log-target=file:" + pulse_dir_.absolutePath () + "\\pulse.log"; #endif // defined (DEBUG) + /* + * Fix for x2goclient bug #526. + * Works around PulseAudio bug #80772. + * Tested with PulseAudio 5.0. + * This argument will not cause PulseAudio 0.9.6 or 1.1 (the legacy versions) + * to fail to launch. + * However, 0.9.6 defaults to normal priority anyway, + * and 1.1 ignores it for some reason. + * So yes, the fact that 1.1 ignores it would be a bug in x2goclient if we + * ever ship 1.1 again. + */ + if ((QSysInfo::WindowsVersion == QSysInfo::WV_XP) || (QSysInfo::WindowsVersion == QSysInfo::WV_2003)) { + x2goDebug << "Windows XP or Server 2003 (R2) detected." + << "Setting PulseAudio to \"normal\" CPU priority."; + + server_args_ << "--high-priority=no"; + } + if (generate_server_config () && generate_client_config ()) { create_client_dir (); -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 0213f62f4bd58b2f98c8c8afac1a72bdb8cd52ca Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 27 02:16:49 2016 +0200 src/pulsemanager.cpp: backport fix for 422. --- debian/changelog | 1 + src/pulsemanager.cpp | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 76b5501..d4d1f7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -262,6 +262,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium depending on the detected PA version. - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) - src/pulsemanager.cpp: backport fix for 526. + - src/pulsemanager.cpp: backport fix for 422. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/pulsemanager.cpp b/src/pulsemanager.cpp index c8fc7cd..fb0d5eb 100644 --- a/src/pulsemanager.cpp +++ b/src/pulsemanager.cpp @@ -403,7 +403,29 @@ bool PulseManager::generate_server_config () { QTextStream config_tmp_file_stream (&config_tmp_file); config_tmp_file_stream << "load-module module-native-protocol-tcp port=" - + QString::number (pulse_port_) << endl; + + QString::number (pulse_port_); + + /* + * Reference: + * http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modul... + * + * Setting auth-cookie fixes bug #422. + * + * PulseAudio 6.0 changed the path that auth-cookie is relative to, so + * Tanu Kaskinen recommended we specify the absolute path instead. + * The absolute path works with at least 5.0 and 6.0. + */ + if (pulse_version_major_ > 2) { + QString tmp_auth_cookie = QDir::toNativeSeparators (wapiShortFileName (pulse_dir_.absolutePath ())) + + "\\.pulse-cookie"; + + /* Double backslashes are required in config.pa. */ + tmp_auth_cookie.replace ("\\", "\\\\"); + + config_tmp_file_stream << " auth-cookie=" + tmp_auth_cookie; + } + + config_tmp_file_stream << endl; #ifdef Q_OS_UNIX config_tmp_file_stream << "load-module module-native-protocol-unix" << endl; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 09cf96a00b35a9052f2c889ff0a538e8dd010724 Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 29 02:00:42 2016 +0200 src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) --- debian/changelog | 2 ++ src/configdialog.cpp | 31 ++++++++++++++++--------------- src/configdialog.h | 4 ++-- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index d4d1f7d..e4e8379 100644 --- a/debian/changelog +++ b/debian/changelog @@ -263,6 +263,8 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: add "FIXME" debug logging (and cleanup.) - src/pulsemanager.cpp: backport fix for 526. - src/pulsemanager.cpp: backport fix for 422. + - src/configdialog.{cpp,h}: add "no record" support for OS X (through + PulseManager.) [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 2f70a13..93c0225 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -352,18 +352,16 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) tabWidg->addTab(xsetWidg, tr("X.Org Server settings")); #endif -#ifdef Q_OS_WIN - QFrame* frp=new QFrame(this); - tabWidg->addTab(frp, tr("Pulseaudio settings")); - QVBoxLayout* l=new QVBoxLayout(frp); - cbNoRecord=new QCheckBox(tr("Disable audio input"),frp); - QLabel* lw=new QLabel(tr("<font size=\"5\">You must restart the X2Go Client for the changes to take effect</font><br><br>"),frp); - lw->setWordWrap(true); - l->addWidget(lw); - l->addWidget(cbNoRecord); - l->addStretch(1); - cbNoRecord->setChecked ( st.setting()->value ( "pulse/norecord", false ).toBool() ); -#endif +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) + QFrame* frp = new QFrame (this); + tabWidg->addTab (frp, tr ("PulseAudio settings")); + QVBoxLayout* l = new QVBoxLayout (frp); + cbNoRecord = new QCheckBox (tr ("Disable sound input"), frp); + lw->setWordWrap (true); + l->addWidget (cbNoRecord); + l->addStretch (1); + cbNoRecord->setChecked (st.setting ()->value ("pulse/norecord", false).toBool ()); +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ } @@ -381,9 +379,9 @@ void ConfigDialog::slot_accepted() st.setting()->setValue ( "trayicon/mincon", cbMinimizeTray->isChecked() ); st.setting()->setValue ( "trayicon/maxdiscon", cbMaxmizeTray->isChecked() ); #endif -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) st.setting()->setValue ( "pulse/norecord", cbNoRecord->isChecked() ); -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ #ifdef USELDAP if ( !embedMode ) { @@ -661,12 +659,15 @@ void ConfigDialog::slotDefaults() cbNoRecord->setChecked(false); } break; -#endif +#endif /* defined (Q_OS_WIN) */ case 0: { if ( embedMode ) cbStartEmbed->setChecked ( true ); clientSshPort->setValue ( 22 ); +#ifdef Q_OS_DARWIN + cbNoRecord->setChecked (false); +#endif /* defined (Q_OS_DARWIN) */ #ifndef CFGPLUGIN gbTrayIcon->setChecked (false); cbMinimizeTray->setChecked (false); diff --git a/src/configdialog.h b/src/configdialog.h index e9b6582..5b55454 100644 --- a/src/configdialog.h +++ b/src/configdialog.h @@ -93,9 +93,9 @@ private: XSettingsWidget* xsetWidg; #endif -#ifdef Q_OS_WIN +#if defined (Q_OS_WIN) || defined (Q_OS_DARWIN) QCheckBox *cbNoRecord; -#endif +#endif /* defined (Q_OS_WIN) || defined (Q_OS_DARWIN) */ QGroupBox *gbTrayIcon; QCheckBox *cbMinimizeTray; -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 83a4d7de1d6f3c3159fc00ae609ffe3a176696cd Author: Mihai Moldovan <ionic@ionic.de> Date: Fri Apr 29 02:08:03 2016 +0200 src/configdialog.cpp: whitespace only. --- debian/changelog | 1 + src/configdialog.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/debian/changelog b/debian/changelog index e4e8379..cd04b96 100644 --- a/debian/changelog +++ b/debian/changelog @@ -265,6 +265,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium - src/pulsemanager.cpp: backport fix for 422. - src/configdialog.{cpp,h}: add "no record" support for OS X (through PulseManager.) + - src/configdialog.cpp: whitespace only. [ Mike DePaulo ] * New upstream release (4.0.5.2): diff --git a/src/configdialog.cpp b/src/configdialog.cpp index 93c0225..2dfcf397 100644 --- a/src/configdialog.cpp +++ b/src/configdialog.cpp @@ -263,6 +263,7 @@ ConfigDialog::ConfigDialog ( QWidget * parent, Qt::WindowFlags f ) sshLay->addStretch(); frLay->addLayout ( sshLay ); #endif + if ( embedMode ) { cbStartEmbed=new QCheckBox ( @@ -415,6 +416,7 @@ void ConfigDialog::slot_accepted() st.setting()->setValue ( "clientport", ( QVariant ) clientSshPort->value() ); #endif + pwid->saveSettings(); if ( embedMode ) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git