From 6ab60d4920bb3199aee8cd872b930e9e3e808ba7 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Sat, 19 May 2018 14:43:13 +0000 Subject: [PATCH] Restructure contrib folder. contrib/pogen.sh -> bin/pogen.sh bootstrap: Use new pogen location and execute it. contrib/openvpn-tap32: Move to contrib/3rdparty/Windows/openvpn-tap32. contrib/gnunet-logo*: Move to contrib/branding/logo/ Delete old patches in contrib, predating git. Move buildbot data to contrib/ci/buildbot, move docker data to contrib/ci/docker. Create contrib/conf and populate it with config files found in contrib and bin. Move gns related data to contrib/gns. delete contrib/repeat.sh Move contrib/log.php into contrib/web/log.php. Create folder contrib/scripts and use it for most scripts in contrib. Remove trailing whitespace in doc/Makefile.am Signed-off-by: Nils Gillmann --- .gitignore | 1 + README | 9 +- {contrib => bin}/pogen.sh | 0 bootstrap | 2 +- .../Windows}/openvpn-tap32/COPYING | 0 .../Windows}/openvpn-tap32/INSTALL | 0 .../openvpn-tap32/tap32-signed-i386-2.1.zip | Bin .../openvpn-tap32/tap32-source-2.1.zip | Bin .../openvpn-tap32/tapw32/OemWin2k.inf | 0 .../Windows}/openvpn-tap32/tapw32/tap0901.cat | Bin .../Windows}/openvpn-tap32/tapw32/tap0901.sys | Bin .../openvpn-tap32/tapw64/OemWin2k.inf | 0 .../Windows}/openvpn-tap32/tapw64/tap0901.cat | Bin .../Windows}/openvpn-tap32/tapw64/tap0901.sys | Bin contrib/Makefile.am | 92 ++++---- .../{ => branding/logo}/gnunet-logo-big.png | Bin .../{ => branding/logo}/gnunet-logo-color.png | Bin contrib/{ => branding/logo}/gnunet-logo.pdf | Bin contrib/buildslave-0.8.6p1-gnunet-w32.patch | 202 ------------------ contrib/{ => ci/buildbot}/buildbot-update.sh | 0 contrib/{ => ci/buildbot}/ssh-config | 0 contrib/{ => ci/buildbot}/ssh-keys | 0 contrib/{ => ci/docker}/Dockerfile | 0 contrib/{ => ci/docker}/docker-entrypoint.sh | 0 contrib/{ => conf/colorit}/colorit.conf | 0 .../editors/eclipse}/gnunet_codingstyle.xml | 0 .../gnunet}/no_autostart_above_core.conf | 0 contrib/{ => conf/gnunet}/no_forcestart.conf | 0 contrib/{ => conf/nss}/nssswitch.conf | 0 {bin => contrib/conf/wireshark}/wireshark.lua | 0 contrib/{ => gns}/bootstrap.min.css | 0 contrib/{ => gns}/def.tex | 0 contrib/{ => gns}/gns-bcd.html | 0 contrib/{ => gns}/gns-bcd.tex | 2 +- contrib/{ => gns}/gns-form-fields.xml | 0 contrib/{ => gns}/gns-form.xslt | 0 .../nse => nse/experiments}/infiniband.conf | 0 contrib/{ => patches}/lrn-indent.diff | 0 contrib/{ => patches}/texi2html5-indent.diff | 0 .../{ => patches}/transport_ats_years.diff | 0 contrib/repeat.sh | 1 - contrib/{ => scripts}/coverage.sh | 0 contrib/{ => scripts}/debug | 0 contrib/{ => scripts}/find_typedefs.py | 0 contrib/{ => scripts}/gdb-iterate-dll.py | 0 contrib/{ => scripts}/generate-monkey-db.sh | 0 contrib/{ => scripts}/gnunet-chk.py.in | 0 .../gnunet-logread}/gnunet-logread | 2 +- .../gnunet-logread}/gnunet-logread-ipc | 1 + .../gnunet-logread}/gnunet-logread-ipc-sdedit | 2 +- contrib/{ => scripts}/gnunet-suidfix | 0 contrib/{ => scripts}/gnunet_janitor.py.in | 0 contrib/{ => scripts}/gnunet_pyexpect.py.in | 0 contrib/{ => scripts}/process_log.sh | 0 contrib/{ => scripts}/pydiffer.py.in | 0 contrib/{ => scripts}/pydmesg | 0 contrib/{ => scripts}/regression.sh | 0 .../removetrailingwhitespace.py.in | 0 contrib/{ => scripts}/report.sh | 0 contrib/{ => scripts}/revisionary.sh | 0 contrib/{ => scripts}/terminate.py.in | 0 contrib/{ => scripts}/testbed_cleanup.sh | 0 contrib/{ => scripts}/texinfo-hacks.el | 0 contrib/{ => scripts}/visualize_stats.sh | 0 contrib/{ => scripts}/zonewalk-to-types.sh | 0 contrib/testbed_perfhacks.patch | 90 -------- contrib/testbed_setup_pre_ecc_tree.sh | 9 - contrib/transpot_delay.patch | 77 ------- contrib/{ => web}/log.php | 0 doc/Makefile.am | 2 +- guix-env.scm | 2 - 71 files changed, 60 insertions(+), 434 deletions(-) rename {contrib => bin}/pogen.sh (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/COPYING (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/INSTALL (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tap32-signed-i386-2.1.zip (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tap32-source-2.1.zip (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw32/OemWin2k.inf (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw32/tap0901.cat (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw32/tap0901.sys (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw64/OemWin2k.inf (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw64/tap0901.cat (100%) rename contrib/{ => 3rdparty/Windows}/openvpn-tap32/tapw64/tap0901.sys (100%) rename contrib/{ => branding/logo}/gnunet-logo-big.png (100%) rename contrib/{ => branding/logo}/gnunet-logo-color.png (100%) rename contrib/{ => branding/logo}/gnunet-logo.pdf (100%) delete mode 100644 contrib/buildslave-0.8.6p1-gnunet-w32.patch rename contrib/{ => ci/buildbot}/buildbot-update.sh (100%) rename contrib/{ => ci/buildbot}/ssh-config (100%) rename contrib/{ => ci/buildbot}/ssh-keys (100%) rename contrib/{ => ci/docker}/Dockerfile (100%) rename contrib/{ => ci/docker}/docker-entrypoint.sh (100%) rename contrib/{ => conf/colorit}/colorit.conf (100%) rename contrib/{ => conf/editors/eclipse}/gnunet_codingstyle.xml (100%) rename contrib/{ => conf/gnunet}/no_autostart_above_core.conf (100%) rename contrib/{ => conf/gnunet}/no_forcestart.conf (100%) rename contrib/{ => conf/nss}/nssswitch.conf (100%) rename {bin => contrib/conf/wireshark}/wireshark.lua (100%) rename contrib/{ => gns}/bootstrap.min.css (100%) rename contrib/{ => gns}/def.tex (100%) rename contrib/{ => gns}/gns-bcd.html (100%) rename contrib/{ => gns}/gns-bcd.tex (99%) rename contrib/{ => gns}/gns-form-fields.xml (100%) rename contrib/{ => gns}/gns-form.xslt (100%) rename contrib/{experiments/nse => nse/experiments}/infiniband.conf (100%) rename contrib/{ => patches}/lrn-indent.diff (100%) rename contrib/{ => patches}/texi2html5-indent.diff (100%) rename contrib/{ => patches}/transport_ats_years.diff (100%) delete mode 100755 contrib/repeat.sh rename contrib/{ => scripts}/coverage.sh (100%) rename contrib/{ => scripts}/debug (100%) rename contrib/{ => scripts}/find_typedefs.py (100%) rename contrib/{ => scripts}/gdb-iterate-dll.py (100%) rename contrib/{ => scripts}/generate-monkey-db.sh (100%) rename contrib/{ => scripts}/gnunet-chk.py.in (100%) rename contrib/{ => scripts/gnunet-logread}/gnunet-logread (99%) rename contrib/{ => scripts/gnunet-logread}/gnunet-logread-ipc (78%) rename contrib/{ => scripts/gnunet-logread}/gnunet-logread-ipc-sdedit (98%) rename contrib/{ => scripts}/gnunet-suidfix (100%) rename contrib/{ => scripts}/gnunet_janitor.py.in (100%) rename contrib/{ => scripts}/gnunet_pyexpect.py.in (100%) rename contrib/{ => scripts}/process_log.sh (100%) rename contrib/{ => scripts}/pydiffer.py.in (100%) rename contrib/{ => scripts}/pydmesg (100%) rename contrib/{ => scripts}/regression.sh (100%) rename contrib/{ => scripts}/removetrailingwhitespace.py.in (100%) rename contrib/{ => scripts}/report.sh (100%) rename contrib/{ => scripts}/revisionary.sh (100%) rename contrib/{ => scripts}/terminate.py.in (100%) rename contrib/{ => scripts}/testbed_cleanup.sh (100%) rename contrib/{ => scripts}/texinfo-hacks.el (100%) rename contrib/{ => scripts}/visualize_stats.sh (100%) rename contrib/{ => scripts}/zonewalk-to-types.sh (100%) delete mode 100644 contrib/testbed_perfhacks.patch delete mode 100755 contrib/testbed_setup_pre_ecc_tree.sh delete mode 100644 contrib/transpot_delay.patch rename contrib/{ => web}/log.php (100%) diff --git a/.gitignore b/.gitignore index b7dd58739..b36fa3b1c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ confdefs.h confdefs.c confdefs.err gnunet-doc.scm +guix-env-gillmann.scm src/namestore/test_namestore_api_zone_to_name src/credential/gnunet-credential src/credential/gnunet-service-credential diff --git a/README b/README index 7819b883a..f52fca444 100644 --- a/README +++ b/README @@ -51,7 +51,7 @@ These are the direct dependencies for running GNUnet: - libogg >= 1.3.0 (optional for experimental conversation tool) - python-zbar >= 0.10 (optional for gnunet-qr) - TeX Live >= 2012 (optional for gnunet-bcd[*]) -- Texinfo >= 5.2 +- Texinfo >= 5.2 [*1] - libglpk >= 4.45 (optional for experimental code) Recommended autotools for compiling the git version are: @@ -63,6 +63,10 @@ Recommended autotools for compiling the git version are: [*] Mandatory for compiling the info output of the documentation, a limited subset ('texlive-tiny' in Guix) is enough. +[*1] The default configuration is to build the info output of the documentation, +and therefore require texinfo. You can pass --disable-documentation to +the configure script to change this. + How to install? =============== @@ -262,7 +266,8 @@ $ make check Some of the testcases require python >= 2.6 and pexpect to be installed. If any testcases fail to pass on your system, run -"contrib/report.sh" and report the output together with +"contrib/scripts/report.sh" (in the repository) or "gnunet-bugreport" +when you already have GNUnet installed and report the output together with information about the failing testcase to the Mantis bugtracking system at https://gnunet.org/bugs/. diff --git a/contrib/pogen.sh b/bin/pogen.sh similarity index 100% rename from contrib/pogen.sh rename to bin/pogen.sh diff --git a/bootstrap b/bootstrap index f13919ba8..a1cdcfa00 100755 --- a/bootstrap +++ b/bootstrap @@ -6,4 +6,4 @@ which glibtoolize || which libtoolize || which libtool || { exit 1 } autoreconf -if -contrib/pogen.sh +. "bin/pogen.sh" diff --git a/contrib/openvpn-tap32/COPYING b/contrib/3rdparty/Windows/openvpn-tap32/COPYING similarity index 100% rename from contrib/openvpn-tap32/COPYING rename to contrib/3rdparty/Windows/openvpn-tap32/COPYING diff --git a/contrib/openvpn-tap32/INSTALL b/contrib/3rdparty/Windows/openvpn-tap32/INSTALL similarity index 100% rename from contrib/openvpn-tap32/INSTALL rename to contrib/3rdparty/Windows/openvpn-tap32/INSTALL diff --git a/contrib/openvpn-tap32/tap32-signed-i386-2.1.zip b/contrib/3rdparty/Windows/openvpn-tap32/tap32-signed-i386-2.1.zip similarity index 100% rename from contrib/openvpn-tap32/tap32-signed-i386-2.1.zip rename to contrib/3rdparty/Windows/openvpn-tap32/tap32-signed-i386-2.1.zip diff --git a/contrib/openvpn-tap32/tap32-source-2.1.zip b/contrib/3rdparty/Windows/openvpn-tap32/tap32-source-2.1.zip similarity index 100% rename from contrib/openvpn-tap32/tap32-source-2.1.zip rename to contrib/3rdparty/Windows/openvpn-tap32/tap32-source-2.1.zip diff --git a/contrib/openvpn-tap32/tapw32/OemWin2k.inf b/contrib/3rdparty/Windows/openvpn-tap32/tapw32/OemWin2k.inf similarity index 100% rename from contrib/openvpn-tap32/tapw32/OemWin2k.inf rename to contrib/3rdparty/Windows/openvpn-tap32/tapw32/OemWin2k.inf diff --git a/contrib/openvpn-tap32/tapw32/tap0901.cat b/contrib/3rdparty/Windows/openvpn-tap32/tapw32/tap0901.cat similarity index 100% rename from contrib/openvpn-tap32/tapw32/tap0901.cat rename to contrib/3rdparty/Windows/openvpn-tap32/tapw32/tap0901.cat diff --git a/contrib/openvpn-tap32/tapw32/tap0901.sys b/contrib/3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys similarity index 100% rename from contrib/openvpn-tap32/tapw32/tap0901.sys rename to contrib/3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys diff --git a/contrib/openvpn-tap32/tapw64/OemWin2k.inf b/contrib/3rdparty/Windows/openvpn-tap32/tapw64/OemWin2k.inf similarity index 100% rename from contrib/openvpn-tap32/tapw64/OemWin2k.inf rename to contrib/3rdparty/Windows/openvpn-tap32/tapw64/OemWin2k.inf diff --git a/contrib/openvpn-tap32/tapw64/tap0901.cat b/contrib/3rdparty/Windows/openvpn-tap32/tapw64/tap0901.cat similarity index 100% rename from contrib/openvpn-tap32/tapw64/tap0901.cat rename to contrib/3rdparty/Windows/openvpn-tap32/tapw64/tap0901.cat diff --git a/contrib/openvpn-tap32/tapw64/tap0901.sys b/contrib/3rdparty/Windows/openvpn-tap32/tapw64/tap0901.sys similarity index 100% rename from contrib/openvpn-tap32/tapw64/tap0901.sys rename to contrib/3rdparty/Windows/openvpn-tap32/tapw64/tap0901.sys diff --git a/contrib/Makefile.am b/contrib/Makefile.am index 40e6d3e92..8e07a5d8c 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -17,54 +17,62 @@ timeout_watchdog_SOURCES = \ endif noinst_SCRIPTS = \ - terminate.py \ - pydiffer.py \ - removetrailingwhitespace.py \ - gnunet_pyexpect.py \ - gnunet_janitor.py \ - gnunet-chk.py + scripts/terminate.py \ + scripts/pydiffer.py \ + scripts/removetrailingwhitespace.py \ + scripts/gnunet_pyexpect.py \ + scripts/gnunet_janitor.py \ + scripts/gnunet-chk.py dist_pkgdata_DATA = \ - gns-bcd.html \ - gns-bcd.tex \ - gnunet-logo.pdf \ - gnunet-logo-color.png \ + gns/gns-bcd.html \ + gns/gns-bcd.tex \ + gns/def.tex \ + gns/gns-form-fields.xml \ + gns/gns-form.xslt \ + branding/logo/gnunet-logo.pdf \ + branding/logo/gnunet-logo-color.png \ + scripts/report.sh \ testing_hostkeys.ecc if MINGW tap32_DATA = \ - openvpn-tap32/tapw32/tap0901.sys \ - openvpn-tap32/tapw32/tap0901.cat \ - openvpn-tap32/tapw32/OemWin2k.inf + 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \ + 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.cat \ + 3rdparty/Windows/openvpn-tap32/tapw32/OemWin2k.inf tap64_DATA = \ - openvpn-tap32/tapw64/tap0901.sys \ - openvpn-tap32/tapw64/tap0901.cat \ - openvpn-tap32/tapw64/OemWin2k.inf + 3rdparty/Windows/openvpn-tap32/tapw64/tap0901.sys \ + 3rdparty/Windows/openvpn-tap32/tapw64/tap0901.cat \ + 3rdparty/Windows/openvpn-tap32/tapw64/OemWin2k.inf endif EXTRA_DIST = \ - no_forcestart.conf \ - no_autostart_above_core.conf \ - coverage.sh \ - nssswitch.conf \ - report.sh \ - terminate.py.in \ - gnunet_pyexpect.py.in \ - gnunet_janitor.py.in \ - gnunet-chk.py.in \ - removetrailingwhitespace.py.in \ - pydiffer.py.in \ - gnunet-gns-import.sh \ - openvpn-tap32/tapw32/tap0901.sys \ - openvpn-tap32/tapw32/tap0901.cat \ - openvpn-tap32/tapw32/OemWin2k.inf \ - openvpn-tap32/tapw64/tap0901.sys \ - openvpn-tap32/tapw64/tap0901.cat \ - openvpn-tap32/tapw64/OemWin2k.inf \ - openvpn-tap32/INSTALL \ - openvpn-tap32/tap32-signed-i386-2.1.zip \ - openvpn-tap32/tap32-source-2.1.zip + conf/colorit/colorit.conf \ + conf/editors/eclipse/gnunet_codingstyle.xml \ + conf/gnunet/no_forcestart.conf \ + conf/gnunet/no_autostart_above_core.conf \ + conf/nss/nssswitch.conf \ + conf/wireshark/wireshark.lua \ + scripts/coverage.sh \ + scripts/terminate.py.in \ + scripts/gnunet_pyexpect.py.in \ + scripts/gnunet_janitor.py.in \ + scripts/gnunet-chk.py.in \ + scripts/removetrailingwhitespace.py.in \ + scripts/pydiffer.py.in \ + scripts/gnunet-gns-import.sh \ + packages/nix/default.nix \ + packages/nix/gnunet-dex.nix \ + 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \ + 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.cat \ + 3rdparty/Windows/openvpn-tap32/tapw32/OemWin2k.inf \ + 3rdparty/Windows/openvpn-tap32/tapw64/tap0901.sys \ + 3rdparty/Windows/openvpn-tap32/tapw64/tap0901.cat \ + 3rdparty/Windows/openvpn-tap32/tapw64/OemWin2k.inf \ + 3rdparty/Windows/openvpn-tap32/INSTALL \ + 3rdparty/Windows/openvpn-tap32/tap32-signed-i386-2.1.zip \ + 3rdparty/Windows/openvpn-tap32/tap32-source-2.1.zip CLEANFILES = \ $(noinst_SCRIPTS) @@ -82,21 +90,13 @@ do_subst = $(SED) -e 's,[@]PYTHON[@],$(PYTHON),g' # # instead of this: +SUFFIXES = SUFFIXES = .py.in .py .py.in.py: $(do_subst) < $< > $@ chmod +x $@ -# init_gnunet_redhat \ -# init_gnunet_ubuntu \ -# visualize_stats.sh \ -# gnmessage.sh \ -# junkinsert.sh \ -# junklookup.sh \ -# namespacehelper.sh - - check_PROGRAMS = \ test_gnunet_prefix diff --git a/contrib/gnunet-logo-big.png b/contrib/branding/logo/gnunet-logo-big.png similarity index 100% rename from contrib/gnunet-logo-big.png rename to contrib/branding/logo/gnunet-logo-big.png diff --git a/contrib/gnunet-logo-color.png b/contrib/branding/logo/gnunet-logo-color.png similarity index 100% rename from contrib/gnunet-logo-color.png rename to contrib/branding/logo/gnunet-logo-color.png diff --git a/contrib/gnunet-logo.pdf b/contrib/branding/logo/gnunet-logo.pdf similarity index 100% rename from contrib/gnunet-logo.pdf rename to contrib/branding/logo/gnunet-logo.pdf diff --git a/contrib/buildslave-0.8.6p1-gnunet-w32.patch b/contrib/buildslave-0.8.6p1-gnunet-w32.patch deleted file mode 100644 index 265db4d71..000000000 --- a/contrib/buildslave-0.8.6p1-gnunet-w32.patch +++ /dev/null @@ -1,202 +0,0 @@ -diff -urN /src/buildbot-slave-0.8.6p1.orig/buildslave/runprocess.py /src/buildbot-slave-0.8.6p1/buildslave/runprocess.py ---- buildbot-slave-0.8.6p1.orig/buildslave/runprocess.py 2012-03-26 04:09:10 +0400 -+++ buildbot-slave-0.8.6p1/buildslave/runprocess.py 2013-03-31 05:18:55 +0400 -@@ -24,6 +24,7 @@ - import re - import subprocess - import traceback -+import tempfile - import stat - from collections import deque - -@@ -36,6 +37,89 @@ - if runtime.platformType == 'posix': - from twisted.internet.process import Process - -+if os.name == 'nt': -+ import win32api -+ import win32process -+ import win32event -+ import pywintypes -+ -+def safe_terminate_process (proc, code): -+ if os.name == 'nt': -+ log.msg ("Obtaining current process handle") -+ cp = win32api.GetCurrentProcess () -+ result = False -+ log.msg ("Expanding target process handle permissions") -+ dupproc = win32api.DuplicateHandle (cp, proc._handle, cp, 2 | 1024 | 8 | 32 | 16 | 0x100000, 0, 0) -+ log.msg ("Expanded.") -+ try: -+ log.msg ("Checking exit code of target process") -+ exitcode = win32process.GetExitCodeProcess (dupproc) -+ log.msg ("Exit code is %d" % exitcode) -+ if exitcode == 0x103: -+ log.msg ("Opening kernel32.dll") -+ kernel32 = win32api.GetModuleHandle ("kernel32") -+ log.msg ("Getting ExitProcess() address") -+ exitprocess = win32api.GetProcAddress (kernel32, "ExitProcess") -+ try: -+ log.msg ("Creating remote thread") -+ th = 0 -+ tid = 0 -+ failed = False -+ th, tid = win32process.CreateRemoteThread (dupproc, None, 0, exitprocess, code, 0) -+ log.msg ("Created remote thread %d" % tid) -+ except pywintypes.error as e: -+ if e[0] == 5: -+ log.msg ("Access denied. It still might die, so don't fail yet") -+ pass -+ else: -+ log.msg("exception %s - %s" % (sys.exc_info()[0], sys.exc_info()[1])) -+ failed = True -+ except Exception as e: -+ log.msg("exception %s - %s" % (sys.exc_info()[0], sys.exc_info()[1])) -+ failed = True -+ if not failed: -+ log.msg ("Wait for 5 seconds or until it dies (usually takes around 1 microsecond)") -+ waitresult = win32event.WaitForSingleObject (dupproc, 5) -+ log.msg ("Result of waiting: %d" % waitresult) -+ win32api.CloseHandle (th) -+ if waitresult == 0: -+ result = True -+ else: -+ result = True -+ except: -+ log.msg("exception %s - %s" % (sys.exc_info()[0], sys.exc_info()[1])) -+ finally: -+ win32api.CloseHandle (dupproc) -+ return result -+ else: -+ return proc.kill () -+ -+class Dummy(object): -+ def SetHandle (self, h): -+ self._handle = h -+ -+def safe_terminate_process_by_pid (proc, code): -+ if os.name == 'nt': -+ try: -+ log.msg("Opening process %d" % proc) -+ openproc = win32api.OpenProcess (2 | 1024 | 8 | 32 | 16 | 0x100000, 0, proc) -+ log.msg("Opened process %d" % proc) -+ try: -+ d = Dummy () -+ d.SetHandle (openproc) -+ log.msg("Terminating it safely") -+ safe_terminate_process (d, code) -+ log.msg("Finished terminating") -+ finally: -+ log.msg("Closing process handle") -+ win32api.CloseHandle (openproc) -+ except: -+ log.msg("exception %s - %s" % (sys.exc_info()[0], sys.exc_info()[1])) -+ pass -+ else: -+ return os.kill (proc, code) -+ -+ - def shell_quote(cmd_list): - # attempt to quote cmd_list such that a shell will properly re-interpret - # it. The pipes module is only available on UNIX, and Windows "shell" -@@ -148,6 +232,7 @@ - self.pending_stdin = "" - self.stdin_finished = False - self.killed = False -+ self.scriptfile = "" - - def setStdin(self, data): - assert not self.connected -@@ -198,6 +283,11 @@ - rc = 1 - else: - rc = -1 -+ if self.scriptfile: -+ try: -+ os.remove (self.scriptfile) -+ except: -+ pass - self.command.finished(sig, rc) - - -@@ -408,9 +498,14 @@ - - if type(self.command) in types.StringTypes: - if runtime.platformType == 'win32': -- argv = os.environ['COMSPEC'].split() # allow %COMSPEC% to have args -- if '/c' not in argv: argv += ['/c'] -- argv += [self.command] -+ if os.environ['BUILDSLAVE_SHELL']: -+ argv = os.environ['BUILDSLAVE_SHELL'].split() # allow %COMSPEC% to have args -+ argv += [self.command] -+ else: -+ argv = os.environ['COMSPEC'].split() # allow %COMSPEC% to have args -+ if '/c' not in argv: -+ argv += ['/c'] -+ argv += [self.command] - else: - # for posix, use /bin/sh. for other non-posix, well, doesn't - # hurt to try -@@ -424,9 +519,26 @@ - # handle path searching, etc. - if runtime.platformType == 'win32' and not \ - (self.command[0].lower().endswith(".exe") and os.path.isabs(self.command[0])): -- argv = os.environ['COMSPEC'].split() # allow %COMSPEC% to have args -- if '/c' not in argv: argv += ['/c'] -- argv += list(self.command) -+ if os.environ['BUILDSLAVE_SHELL']: -+ argv = os.environ['BUILDSLAVE_SHELL'].split() -+ # Create a temporary script file that changes current directory -+ # and runs the command we want -+ # It will be deleted after command is finished running (see RunProcessPP) -+ tf, tf_name = tempfile.mkstemp () -+ f = os.fdopen (tf, 'wb') -+ fcontents = '#!/bin/sh\ncd {}\n{}'.format ( -+ re.sub(r'(?