[Pkg-cli-libs-commits] [SCM] gdata-sharp branch, master, updated. upstream/1.4.0.2-15-g93f0627

Chow Loong Jin hyperair at gmail.com
Wed Mar 18 21:24:12 UTC 2009


The following commit has been merged in the master branch:
commit 0976e852060a072d40fd4fc900b7b0cf214cadf0
Author: Chow Loong Jin <hyperair at gmail.com>
Date:   Thu Mar 19 04:52:28 2009 +0800

    Disable tests, new patch: 04_cli-2.0-port.patch
    
    * debian/rules:
      + Uncomment the section which disables tests
    * debian/patches/02_zlib-soname.patch:
      + Move the stuff to 04_cli-2.0-port.patch

diff --git a/debian/patches/02_zlib-soname.patch b/debian/patches/02_zlib-soname.patch
index a2dd9d2..d04170f 100644
--- a/debian/patches/02_zlib-soname.patch
+++ b/debian/patches/02_zlib-soname.patch
@@ -1,23 +1,10 @@
 Index: gdata-sharp/misc/Google.GData.Client.dll.config
 ===================================================================
---- gdata-sharp.orig/misc/Google.GData.Client.dll.config	2009-03-17 00:23:08.000000000 +0800
-+++ gdata-sharp/misc/Google.GData.Client.dll.config	2009-03-18 07:26:45.000000000 +0800
+--- gdata-sharp.orig/misc/Google.GData.Client.dll.config	2009-03-18 14:26:31.000000000 +0800
++++ gdata-sharp/misc/Google.GData.Client.dll.config	2009-03-19 04:22:43.000000000 +0800
 @@ -1,4 +1,4 @@
  <configuration>
      <!-- Map to libz.so.1.2.3 on everything but windows, as we ship it for windows. -->
 -    <dllmap os="linux,osx,solaris,freebsd,openbsd,netbsd,aix,hpux" dll="zlib.x86.dll" target="libz.so.1.2.3"/>
 +    <dllmap os="linux,osx,solaris,freebsd,openbsd,netbsd,aix,hpux" dll="zlib.x86.dll" target="libz.so.1"/>
  </configuration>
-Index: gdata-sharp/src/core/gzipstream.cs
-===================================================================
---- gdata-sharp.orig/src/core/gzipstream.cs	2009-03-18 07:27:30.000000000 +0800
-+++ gdata-sharp/src/core/gzipstream.cs	2009-03-18 12:06:04.000000000 +0800
-@@ -17,7 +17,7 @@
-     public class GZipStream : Stream
-     {
-         #region Native const, structs, and defs
--        private const string ZLibVersion = "1.2.3";
-+        private const string ZLibVersion = "1";
- 
-         private enum ZLibReturnCode
-         {
diff --git a/debian/patches/04_cli-2.0-port.patch b/debian/patches/04_cli-2.0-port.patch
new file mode 100644
index 0000000..dc29501
--- /dev/null
+++ b/debian/patches/04_cli-2.0-port.patch
@@ -0,0 +1,325 @@
+Index: gdata-sharp/src/core/gzipstream.cs
+===================================================================
+--- gdata-sharp.orig/src/core/gzipstream.cs	2009-03-19 04:49:18.000000000 +0800
++++ gdata-sharp/src/core/gzipstream.cs	2009-03-19 04:51:59.000000000 +0800
+@@ -4,308 +4,4 @@
+ 
+ namespace Google.GData.Client
+ {
+-    /// <summary>Type of compression to use for the GZipStream. Currently only Decompress is supported.</summary>
+-    public enum CompressionMode
+-	{
+-        /// <summary>Compresses the underlying stream.</summary>
+-        Compress,
+-        /// <summary>Decompresses the underlying stream.</summary>
+-        Decompress,
+-	}
+-
+-    /// <summary>Provides methods and properties used to compress and decompress streams.</summary>
+-    public class GZipStream : Stream
+-    {
+-        #region Native const, structs, and defs
+-        private const string ZLibVersion = "1.2.3";
+-
+-        private enum ZLibReturnCode
+-        {
+-            Ok = 0,
+-            StreamEnd = 1,
+-            NeedDictionary = 2,
+-            Errno = -1,
+-            StreamError = -2,
+-            DataError = -3,
+-            MemoryError = -4,
+-            BufferError = -5,
+-            VersionError = -6
+-        }
+-
+-        private enum ZLibFlush
+-        {
+-            NoFlush = 0,
+-            PartialFlush = 1,
+-            SyncFlush = 2,
+-            FullFlush = 3,
+-            Finish = 4
+-        }
+-
+-        private enum ZLibCompressionLevel
+-        {
+-            NoCompression = 0,
+-            BestSpeed = 1,
+-            BestCompression = 2,
+-            DefaultCompression = 3
+-        }
+-
+-        private enum ZLibCompressionStrategy
+-        {
+-            Filtered = 1,
+-            HuffmanOnly = 2,
+-            DefaultStrategy = 0
+-        }
+-
+-        private enum ZLibCompressionMethod
+-        {
+-            Delated = 8
+-        }
+-
+-        private enum ZLibDataType
+-        {
+-            Binary = 0,
+-            Ascii = 1,
+-            Unknown = 2,
+-        }
+-
+-        private enum ZLibOpenType
+-        {
+-            ZLib = 15,
+-            GZip = 15 + 16,
+-            Both = 15 + 32,
+-        }
+-
+-
+-        [StructLayoutAttribute(LayoutKind.Sequential)]
+-        private struct z_stream
+-        {
+-            public IntPtr next_in;  /* next input byte */
+-            public uint avail_in;  /* number of bytes available at next_in */
+-            public uint total_in;  /* total nb of input bytes read so far */
+-
+-            public IntPtr next_out; /* next output byte should be put there */
+-            public uint avail_out; /* remaining free space at next_out */
+-            public uint total_out; /* total nb of bytes output so far */
+-
+-            public IntPtr msg;      /* last error message, NULL if no error */
+-            public IntPtr state; /* not visible by applications */
+-
+-            public IntPtr zalloc;  /* used to allocate the internal state */
+-            public IntPtr zfree;   /* used to free the internal state */
+-            public IntPtr opaque;  /* private data object passed to zalloc and zfree */
+-
+-            public ZLibDataType data_type;  /* best guess about the data type: ascii or binary */
+-            public uint adler;      /* adler32 value of the uncompressed data */
+-            public uint reserved;   /* reserved for future use */
+-        };
+-        #endregion
+-
+-        #region P/Invoke
+-#if WindowsCE || PocketPC
+-        [DllImport("zlib.arm.dll", EntryPoint = "inflateInit2_", CharSet = CharSet.Auto)]
+-#else
+-        [DllImport("zlib.x86.dll", EntryPoint = "inflateInit2_", CharSet = CharSet.Ansi)]
+-#endif
+-        private static extern ZLibReturnCode    inflateInit2(ref z_stream strm, ZLibOpenType windowBits, string version, int stream_size);
+-
+-#if WindowsCE || PocketPC
+-        [DllImport("zlib.arm.dll", CharSet = CharSet.Auto)]
+-#else
+-        [DllImport("zlib.x86.dll", CharSet = CharSet.Ansi)]
+-#endif
+-        private static extern ZLibReturnCode     inflate(ref z_stream strm, ZLibFlush flush);
+-
+-#if WindowsCE || PocketPC
+-        [DllImport("zlib.arm.dll", CharSet = CharSet.Auto)]
+-#else
+-        [DllImport("zlib.x86.dll", CharSet = CharSet.Ansi)]
+-#endif
+-        private static extern ZLibReturnCode    inflateEnd(ref z_stream strm);
+-        #endregion
+-
+-        private const int           BufferSize = 16384;
+-
+-        private Stream              compressedStream;
+-        private CompressionMode     mode;
+-
+-        private z_stream            zstream = new z_stream();
+-
+-        private byte[]              inputBuffer = new byte[BufferSize];
+-        private GCHandle            inputBufferHandle;
+-
+-        /// <summary>Initializes a new instance of the GZipStream class using the specified stream and CompressionMode value.</summary>
+-        /// <param name="stream">The stream to compress or decompress.</param>
+-        /// <param name="mode">One of the CompressionMode values that indicates the action to take.</param>
+-        public GZipStream(Stream stream, CompressionMode mode)
+-        {
+-            if (mode != CompressionMode.Decompress)
+-                throw new NotImplementedException("Compression is not implemented.");
+-
+-            this.compressedStream = stream;
+-            this.mode = mode;
+-
+-            this.zstream.zalloc = IntPtr.Zero;
+-            this.zstream.zfree = IntPtr.Zero;
+-            this.zstream.opaque = IntPtr.Zero;
+-
+-            ZLibReturnCode ret = inflateInit2(ref this.zstream, ZLibOpenType.Both, ZLibVersion, Marshal.SizeOf(typeof(z_stream)));
+-
+-            if (ret != ZLibReturnCode.Ok)
+-                throw new ArgumentException("Unable to init ZLib. Return code: " + ret.ToString());
+-
+-            this.inputBufferHandle = GCHandle.Alloc(inputBuffer, GCHandleType.Pinned);
+-        }
+-
+-        /// <summary>GZipStream destructor. Cleans all allocated resources.</summary>
+-        ~GZipStream()
+-        {
+-			Dispose(false);
+-		}
+-
+-		//////////////////////////////////////////////////////////////////////
+-		/// <summary>Handle Dispose since Stream implements IDisposable</summary> 
+-		/// <param name="disposing">indicates if dispose called it or finalize</param>
+-		//////////////////////////////////////////////////////////////////////
+-		protected override void Dispose(bool disposing)
+-		{
+-			base.Dispose(disposing);
+-
+-			if (inputBufferHandle.IsAllocated)
+-			{
+-				inputBufferHandle.Free();
+-				inflateEnd(ref this.zstream);
+-			}
+-		}
+-
+-
+-        /// <summary>Reads a number of decompressed bytes into the specified byte array.</summary>
+-        /// <param name="buffer">The array used to store decompressed bytes.</param>
+-        /// <param name="offset">The location in the array to begin reading.</param>
+-        /// <param name="count">The number of bytes decompressed.</param>
+-        /// <returns>The number of bytes that were decompressed into the byte array. If the end of the stream has been reached, zero or the number of bytes read is returned.</returns>
+-        public override int Read(byte[] buffer, int offset, int count)
+-        {
+-            if (this.mode == CompressionMode.Compress)
+-                throw new NotSupportedException("Can't read on a compress stream!");
+-
+-            bool exitLoop = false;
+-
+-            byte[] tmpOutputBuffer = new byte[count];
+-            GCHandle tmpOutpuBufferHandle = GCHandle.Alloc(tmpOutputBuffer, GCHandleType.Pinned);
+-
+-            this.zstream.next_out = tmpOutpuBufferHandle.AddrOfPinnedObject();
+-            this.zstream.avail_out = (uint)tmpOutputBuffer.Length;
+-
+-            try
+-            {
+-                while (this.zstream.avail_out > 0 && exitLoop == false)
+-                {
+-                    if (this.zstream.avail_in == 0)
+-                    {
+-                        int readLength = this.compressedStream.Read(inputBuffer, 0, inputBuffer.Length);
+-                        this.zstream.avail_in = (uint)readLength;
+-                        this.zstream.next_in = this.inputBufferHandle.AddrOfPinnedObject();
+-                    }
+-                    ZLibReturnCode  result = inflate(ref zstream, ZLibFlush.NoFlush);
+-                    switch (result)
+-                    {
+-                        case ZLibReturnCode.StreamEnd:
+-                            exitLoop = true;
+-                            Array.Copy(tmpOutputBuffer, 0, buffer, offset, count - (int)this.zstream.avail_out);
+-                            break;
+-                        case ZLibReturnCode.Ok:
+-                            Array.Copy(tmpOutputBuffer, 0, buffer, offset, count - (int)this.zstream.avail_out);
+-                            break;
+-                        case ZLibReturnCode.MemoryError:
+-                            throw new OutOfMemoryException("ZLib return code: " + result.ToString());
+-                        default:
+-                            throw new Exception("ZLib return code: " + result.ToString());
+-                    }
+-                }
+-
+-                return (count - (int)this.zstream.avail_out);
+-            }
+-            finally
+-            {
+-                tmpOutpuBufferHandle.Free();
+-            }
+-        }
+-
+-        /// <summary>Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.</summary>
+-        public override void Close()
+-        {
+-            this.compressedStream.Close();
+-            base.Close();
+-        }
+-
+-        /// <summary>Gets a value indicating whether the stream supports reading while decompressing a file.</summary>
+-        public override bool CanRead
+-        {
+-            get { return (this.mode == CompressionMode.Decompress ? true : false); }
+-        }
+-
+-        /// <summary>Gets a value indicating whether the stream supports writing.</summary>
+-        public override bool CanWrite
+-        {
+-            get { return (this.mode == CompressionMode.Compress ? true : false); }
+-        }
+-
+-        /// <summary>Gets a value indicating whether the stream supports seeking.</summary>
+-        public override bool CanSeek
+-        {
+-            get { return (false); }
+-        }
+-
+-        /// <summary>Gets a reference to the underlying stream.</summary>
+-        public Stream BaseStream
+-        {
+-            get { return (this.compressedStream); }
+-        }
+-
+-        #region Not yet supported
+-        /// <summary>Flushes the contents of the internal buffer of the current GZipStream object to the underlying stream.</summary>
+-        public override void Flush()
+-        {
+-            throw new NotSupportedException("The method or operation is not implemented.");
+-        }
+-
+-        /// <summary>This property is not supported and always throws a NotSupportedException.</summary>
+-        /// <param name="offset">The location in the stream.</param>
+-        /// <param name="origin">One of the SeekOrigin values.</param>
+-        /// <returns>A long value.</returns>
+-        public override long Seek(long offset, SeekOrigin origin)
+-        {
+-            throw new NotSupportedException();
+-        }
+-
+-        /// <summary>This property is not supported and always throws a NotSupportedException.</summary>
+-        /// <param name="value">The length of the stream.</param>
+-        public override void SetLength(long value)
+-        {
+-            throw new NotSupportedException();
+-        }
+-
+-        /// <summary>This property is not supported and always throws a NotSupportedException.</summary>
+-        /// <param name="buffer">The array used to store compressed bytes.</param>
+-        /// <param name="offset">The location in the array to begin reading.</param>
+-        /// <param name="count">The number of bytes compressed.</param>
+-        public override void Write(byte[] buffer, int offset, int count)
+-        {
+-            throw new NotSupportedException("Not yet supported!");
+-        }
+-
+-        /// <summary>This property is not supported and always throws a NotSupportedException.</summary>
+-        public override long Length
+-        {
+-            get { throw new NotSupportedException(); }
+-        }
+-
+-        /// <summary>This property is not supported and always throws a NotSupportedException.</summary>
+-        public override long Position
+-        {
+-            get { throw new NotSupportedException(); }
+-            set { throw new NotSupportedException(); }
+-        }
+-        #endregion
+-    }
+ }
+Index: gdata-sharp/src/core/request.cs
+===================================================================
+--- gdata-sharp.orig/src/core/request.cs	2009-03-19 04:49:18.000000000 +0800
++++ gdata-sharp/src/core/request.cs	2009-03-19 04:51:29.000000000 +0800
+@@ -22,6 +22,7 @@
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.ComponentModel;
++using System.IO.Compression;
+ 
+ #endregion
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 7bfb604..82bce19 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 01_pkgconfig-paths.patch
 02_zlib-soname.patch
 03_nunit-console.patch
+04_cli-2.0-port.patch
diff --git a/debian/rules b/debian/rules
index 9691fe4..4363c82 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,7 +18,7 @@ override_dh_auto_install:
 	$(MAKE) install DESTDIR=debian/tmp PREFIX=/usr
 
 # override dh_auto_test for the time being
-#override_dh_auto_test:
+override_dh_auto_test:
 	
 
 %:

-- 
gdata-sharp



More information about the Pkg-cli-libs-commits mailing list