[DRE-commits] [SCM] ruby-rchardet.git branch, master, updated. debian/1.3-2

Paul van Tilburg paul at luon.net
Wed Dec 28 17:22:43 UTC 2011


The following commit has been merged in the master branch:
commit 29434646835a98d23c22319afa23f65c0aefd19e
Author: Paul van Tilburg <paul at luon.net>
Date:   Tue Nov 8 21:28:22 2011 +0100

    Added patch remote-syntax-errors-for-ruby1.9 to ensure that the lib also works for Ruby1.9 (closes: #643770).
    
    * debian/patches/*:  added patch remote-syntax-errors-for-ruby1.9 to
        ensure that the lib also works for Ruby1.9 (closes:  #643770);
        patch courtesy of Bram Senders <bram at proggerij.nl>.
    * debian/rules: added myself to the uploaders.

diff --git a/debian/changelog b/debian/changelog
index 0f990f3..e4f8087 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+ruby-rchardet (1.3-2) unstable; urgency=low
+
+  * debian/patches/*:  added patch remote-syntax-errors-for-ruby1.9 to
+      ensure that the lib also works for Ruby1.9 (closes:  #643770);
+      patch courtesy of Bram Senders <bram at proggerij.nl>.
+  * debian/rules: added myself to the uploaders.
+
+ -- Paul van Tilburg <paulvt at debian.org>  Tue, 08 Nov 2011 21:23:18 +0100
+
 ruby-rchardet (1.3-1) unstable; urgency=low
 
   * Initial release (Closes: #628139)
diff --git a/debian/control b/debian/control
index aa62289..a57f06f 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: ruby-rchardet
 Section: ruby
 Priority: optional
 Maintainer: Debian Ruby Extras Maintainers <pkg-ruby-extras-maintainers at lists.alioth.debian.org>
-Uploaders: Ondřej Surý <ondrej at debian.org>
+Uploaders: Ondřej Surý <ondrej at debian.org>, Paul van Tilburg <paulvt at debian.org>
 DM-Upload-Allowed: yes
 Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.3~)
 Standards-Version: 3.9.2
diff --git a/debian/patches/remove-syntax-errors-for-ruby1.9.patch b/debian/patches/remove-syntax-errors-for-ruby1.9.patch
new file mode 100644
index 0000000..0e8148a
--- /dev/null
+++ b/debian/patches/remove-syntax-errors-for-ruby1.9.patch
@@ -0,0 +1,165 @@
+Index: ruby-rchardet/lib/rchardet/chardistribution.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/chardistribution.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/chardistribution.rb	2011-11-08 21:16:24.000000000 +0100
+@@ -57,8 +57,8 @@
+       if order >= 0
+ 	@_mTotalChars += 1
+ 	# order is valid
+-	if order < @_mTableSize:
+-	  if 512 > @_mCharToFreqOrder[order]:
++	if order < @_mTableSize
++	  if 512 > @_mCharToFreqOrder[order]
+ 	    @_mFreqChars += 1
+ 	  end
+ 	end
+@@ -72,7 +72,7 @@
+ 	return SURE_NO
+       end
+ 
+-      if @_mTotalChars != @_mFreqChars:
++      if @_mTotalChars != @_mFreqChars
+ 	r = @_mFreqChars / ((@_mTotalChars - @_mFreqChars) * @_mTypicalDistributionRatio)
+ 	if r < SURE_YES
+ 	  return r
+@@ -227,7 +227,7 @@
+       #   first  byte range: 0xa0 -- 0xfe
+       #   second byte range: 0xa1 -- 0xfe
+       # no validation needed here. State machine has done that
+-      if aStr[0..0] >= "\xA0":
++      if aStr[0..0] >= "\xA0"
+ 	return 94 * (aStr[0] - 0xA1) + aStr[1] - 0xa1
+       else
+ 	return -1
+Index: ruby-rchardet/lib/rchardet/charsetgroupprober.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/charsetgroupprober.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/charsetgroupprober.rb	2011-11-08 21:16:44.000000000 +0100
+@@ -40,7 +40,7 @@
+       super
+       @_mActiveNum = 0
+ 
+-      for prober in @_mProbers:
++      for prober in @_mProbers
+ 	if prober
+ 	  prober.reset()
+ 	  prober.active = true
+Index: ruby-rchardet/lib/rchardet/escprober.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/escprober.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/escprober.rb	2011-11-08 21:16:56.000000000 +0100
+@@ -41,7 +41,7 @@
+ 
+     def reset
+       super()
+-      for codingSM in @_mCodingSM:
++      for codingSM in @_mCodingSM
+ 	next if not codingSM
+ 	codingSM.active = true
+ 	codingSM.reset()
+Index: ruby-rchardet/lib/rchardet/eucjpprober.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/eucjpprober.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/eucjpprober.rb	2011-11-08 21:17:10.000000000 +0100
+@@ -56,7 +56,7 @@
+ 	elsif codingState == EItsMe
+ 	  @_mState = EFoundIt
+ 	  break
+-	elsif codingState == EStart:
++	elsif codingState == EStart
+ 	  charLen = @_mCodingSM.get_current_charlen()
+ 	  if i == 0
+ 	    @_mLastChar[1] = aBuf[0..0]
+Index: ruby-rchardet/lib/rchardet/jpcntx.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/jpcntx.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/jpcntx.rb	2011-11-08 21:17:30.000000000 +0100
+@@ -150,9 +150,9 @@
+ 	  @_mNeedToSkipCharNum = i - aLen
+ 	  @_mLastCharOrder = -1
+ 	else
+-	  if (order != -1) and (@_mLastCharOrder != -1):
++	  if (order != -1) and (@_mLastCharOrder != -1)
+ 	    @_mTotalRel += 1
+-	    if @_mTotalRel > MAX_REL_THRESHOLD:
++	    if @_mTotalRel > MAX_REL_THRESHOLD
+ 	      @_mDone = true
+ 	      break
+ 	    end
+@@ -169,7 +169,7 @@
+ 
+     def get_confidence
+       # This is just one way to calculate confidence. It works well for me.
+-      if @_mTotalRel > MINIMUM_DATA_THRESHOLD:
++      if @_mTotalRel > MINIMUM_DATA_THRESHOLD
+ 	return (@_mTotalRel - @_mRelSample[0]) / @_mTotalRel
+       else
+ 	return DONT_KNOW
+@@ -208,7 +208,7 @@
+       return -1, 1 unless aStr
+       # find out current char's byte length
+       aStr = aStr[0..1].join if aStr.class == Array
+-      if (aStr[0..0] == "\x8E") or ((aStr[0..0] >= "\xA1") and (aStr[0..0] <= "\xFE")):
++      if (aStr[0..0] == "\x8E") or ((aStr[0..0] >= "\xA1") and (aStr[0..0] <= "\xFE"))
+ 	charLen = 2
+       elsif aStr[0..0] == "\x8F"
+ 	charLen = 3
+Index: ruby-rchardet/lib/rchardet/sjisprober.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/sjisprober.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/sjisprober.rb	2011-11-08 21:17:45.000000000 +0100
+@@ -71,7 +71,7 @@
+ 
+       @_mLastChar[0] = aBuf[aLen - 1.. aLen-1]
+ 
+-      if get_state() == EDetecting:
++      if get_state() == EDetecting
+ 	if @_mContextAnalyzer.got_enough_data() and (get_confidence() > SHORTCUT_THRESHOLD)
+ 	  @_mState = EFoundIt
+ 	end
+Index: ruby-rchardet/lib/rchardet/universaldetector.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/universaldetector.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/universaldetector.rb	2011-11-08 21:18:00.000000000 +0100
+@@ -91,11 +91,11 @@
+       end
+ 
+       @_mGotData = true
+-      if @result['encoding'] and (@result['confidence'] > 0.0):
++      if @result['encoding'] and (@result['confidence'] > 0.0)
+ 	@done = true
+ 	return
+       end
+-      if @_mInputState == EPureAscii:
++      if @_mInputState == EPureAscii
+ 	if @_highBitDetector =~ (aBuf)
+ 	  @_mInputState = EHighbyte
+ 	elsif (@_mInputState == EPureAscii) and @_escDetector =~ (@_mLastChar + aBuf)
+@@ -138,12 +138,12 @@
+       end
+       @done = true
+ 
+-      if @_mInputState == EPureAscii:
++      if @_mInputState == EPureAscii
+ 	@result = {'encoding' => 'ascii', 'confidence' => 1.0}
+ 	return @result
+       end
+ 
+-      if @_mInputState == EHighbyte:
++      if @_mInputState == EHighbyte
+ 	confidences = {}
+         @_mCharSetProbers.each{ |prober| confidences[prober] = prober.get_confidence }
+ 	maxProber = @_mCharSetProbers.max{ |a,b| confidences[a] <=> confidences[b] }
+Index: ruby-rchardet/lib/rchardet/utf8prober.rb
+===================================================================
+--- ruby-rchardet.orig/lib/rchardet/utf8prober.rb	2011-10-31 16:20:34.000000000 +0100
++++ ruby-rchardet/lib/rchardet/utf8prober.rb	2011-11-08 21:18:13.000000000 +0100
+@@ -63,7 +63,7 @@
+ 	end
+       end
+ 
+-      if get_state() == EDetecting:
++      if get_state() == EDetecting
+ 	if get_confidence() > SHORTCUT_THRESHOLD
+ 	  @_mState = EFoundIt
+ 	end
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ea7d158
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+remove-syntax-errors-for-ruby1.9.patch

-- 
ruby-rchardet.git



More information about the Pkg-ruby-extras-commits mailing list