Switch to side-by-side view

--- a/ohbuild.sh
+++ b/ohbuild.sh
@@ -173,6 +173,22 @@
  else
 EOF
 
+    git checkout OpenHome/TestFramework/OptionParser.cpp
+    patch -p1 << "EOF"
+diff --git a/OpenHome/TestFramework/OptionParser.cpp b/OpenHome/TestFramework/OptionParser.cpp
+index fe90233..644fc0b 100644
+--- a/OpenHome/TestFramework/OptionParser.cpp
++++ b/OpenHome/TestFramework/OptionParser.cpp
+@@ -282,7 +282,7 @@ void OptionParser::SetUsage(const TChar* aUsage)
+ {
+     delete iUsage;
+     iUsage = NULL;
+-    iUsage = new TChar[strlen(iUsage)];
++    iUsage = new TChar[strlen(aUsage)];
+     (void)strcpy(iUsage, aUsage);
+ }
+EOF
+
     cd  $topdir/ohNetGenerated
     # Tue May 9 08:54:47 2017 
     git checkout e3edb912410d4c5a4d5323bb1e9c27660a42d78f || exit 1
@@ -209,23 +225,32 @@
      ifneq (,$(findstring i686,$(gcc_machine)))
        detected_openhome_architecture = x86
 EOF
-
-    git checkout OpenHome/TestFramework/OptionParser.cpp
-    patch -p1 << "EOF"
-diff --git a/OpenHome/TestFramework/OptionParser.cpp b/OpenHome/TestFramework/OptionParser.cpp
-index fe90233..644fc0b 100644
---- a/OpenHome/TestFramework/OptionParser.cpp
-+++ b/OpenHome/TestFramework/OptionParser.cpp
-@@ -282,7 +282,7 @@ void OptionParser::SetUsage(const TChar* aUsage)
- {
-     delete iUsage;
-     iUsage = NULL;
--    iUsage = new TChar[strlen(iUsage)];
-+    iUsage = new TChar[strlen(aUsage)];
-     (void)strcpy(iUsage, aUsage);
- }
+patch -p1 << "EOF"
+diff -u ./Common.mak ../../openhome/ohNetGenerated/Common.mak
+--- ./Common.mak	2017-09-19 10:51:13.000000000 +0200
++++ ../../openhome/ohNetGenerated/Common.mak	2017-09-19 13:21:25.984071432 +0200
+@@ -17,20 +17,6 @@
+ $(objdir)ohnet-generated.jar : CpProxyJavaClasses DvDeviceJavaClasses
+ 	$(jar) $(jarflags) $(objdir)ohnet-generated.jar -C $(objdir) org
+ 
+-Generated$(dirsep)GenerateSourceFiles.mak : $(tt) OpenHome$(dirsep)Net$(dirsep)Service$(dirsep)Services.xml OpenHome/Net/T4/Templates/UpnpMakeT4.tt
+-	$(mkdir) Generated
+-	$(t4) -o Generated$(dirsep)GenerateSourceFiles.mak OpenHome/Net/T4/Templates/UpnpMakeT4.tt -a xml:OpenHome/Net/Service/Services.xml
+-	@echo Attention: a makefile has been re-generated.
+-
+-Generated$(dirsep)Proxies.mak : $(tt) OpenHome$(dirsep)Net$(dirsep)Service$(dirsep)Services.xml OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt
+-	$(mkdir) Generated
+-	$(t4) -o Generated$(dirsep)Proxies.mak OpenHome/Net/T4/Templates/CpUpnpMakeProxies.tt -a xml:OpenHome/Net/Service/Services.xml
+-	@echo Attention: a makefile has been re-generated.
+-
+-Generated$(dirsep)Devices.mak : $(tt) OpenHome$(dirsep)Net$(dirsep)Service$(dirsep)Services.xml OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt
+-	$(mkdir) Generated
+-	$(t4) -o Generated$(dirsep)Devices.mak OpenHome/Net/T4/Templates/DvUpnpMakeDevices.tt -a xml:OpenHome/Net/Service/Services.xml
+-	@echo Attention: a makefile has been re-generated.
+ 
+ native_targets = make_obj_dir copy_build_includes proxies devices
+ 
 EOF
-    
     cd  $topdir/ohTopology
     # Wed Mar 22 11:15:28 2017 +0000
     git checkout cc09c09da4be8d3d04adae5b8f0daaf8450906a3 || exit 1
@@ -243,9 +268,8 @@
     # produce a tar file for reproduction
     for dir in ohNet ohNetGenerated ohdevtools ohTopology ohSongcast;do
         test -d $dir || fatal no "'$dir'" in "'$topdir'"
-        rm -rf $topdir/$dir/.git
     done
-    rm -rf $topdir/ohNet/thirdparty
+    #rm -rf $topdir/ohNet/thirdparty
     rm -rf $topdir/ohNetGenerated/OpenHome/Net/Bindings/Cs
     rm -rf $topdir/ohNetGenerated/OpenHome/Net/Bindings/Java
     rm -rf $topdir/ohNetGenerated/OpenHome/Net/Bindings/Js
@@ -257,7 +281,7 @@
     rm -rf $topdir/ohdevtools/nuget
     
     dt=`date +%Y%m%d`
-    tar czf $tarfile/tmp/openhome-sc2-${dt}.tar.gz .
+    tar --exclude='.git' -czf $tarfile/tmp/openhome-sc2-${dt}.tar.gz .
 }
 
 build_ohNet()
@@ -292,7 +316,8 @@
 
 
     make native_only=yes
-
+    # Expect error here, but the relevant bits have been built
+    
     # Copy the includes from here to the ohNet dir where ohTopology
     # will want them
     tar cf - Build/Include | (cd $topdir/ohNet/;tar xvf -) || exit 1