Your message dated Fri, 02 Dec 2011 16:52:52 +0000
with message-id <[email protected]>
and subject line Bug#643770: fixed in ruby-rchardet 1.3-2
has caused the Debian Bug report #643770,
regarding ruby-rchardet: syntax errors when loading with ruby1.9.1
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
643770: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643770
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ruby-rchardet
Version: 1.3-1
Severity: important
Tags: patch
Hi there,
Trying to use ruby-rchardet using ruby1.9.1 gives syntax errors when
loading the module. See the following output:
bram@debian:~$ irb1.9.1 -rrchardet
<internal:lib/rubygems/custom_require>:29:in `require':
/usr/lib/ruby/vendor_ruby/rchardet/chardistribution.rb:60: syntax error,
unexpected ':', expecting keyword_then or ';' or '\n' (SyntaxError)
/usr/lib/ruby/vendor_ruby/rchardet/chardistribution.rb:61: syntax error,
unexpected ':', expecting keyword_then or ';' or '\n'
/usr/lib/ruby/vendor_ruby/rchardet/chardistribution.rb:75: syntax error,
unexpected ':', expecting keyword_then or ';' or '\n'
/usr/lib/ruby/vendor_ruby/rchardet/chardistribution.rb:84: syntax error,
unexpected keyword_end, expecting $end
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/lib/ruby/vendor_ruby/rchardet.rb:25:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules'
from /usr/lib/ruby/1.9.1/irb/init.rb:279:in `each'
from /usr/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules'
from /usr/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
from /usr/lib/ruby/1.9.1/irb.rb:53:in `start'
from /usr/bin/irb1.9.1:12:in `<main>'
This is because a number of "if" and "for" statements end with a colon,
which was apparently valid in ruby1.8, but is not valid in ruby1.9.1.
Attached is a patch that removes these colons, so that ruby-rchardet
loads without syntax errors.
Cheers,
Bram Senders
[email protected]
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages ruby-rchardet depends on:
ii ruby 4.8 ii ruby1.8
[ruby-interpreter] 1.8.7.352-2
ii ruby1.9.1 [ruby-interpreter] 1.9.2.290-2
ruby-rchardet recommends no packages.
ruby-rchardet suggests no packages.
-- no debconf information
--- rchardet/chardistribution.rb.orig 2011-09-29 14:49:18.504002350 +0200
+++ rchardet/chardistribution.rb 2011-09-29 14:49:40.715993001 +0200
@@ -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
--- rchardet/charsetgroupprober.rb.orig 2011-09-29 14:50:19.704001646 +0200
+++ rchardet/charsetgroupprober.rb 2011-09-29 14:51:26.724007530 +0200
@@ -40,7 +40,7 @@
super
@_mActiveNum = 0
- for prober in @_mProbers:
+ for prober in @_mProbers
if prober
prober.reset()
prober.active = true
--- rchardet/escprober.rb.orig 2011-09-29 14:51:47.431989041 +0200
+++ rchardet/escprober.rb 2011-09-29 14:52:01.616000777 +0200
@@ -41,7 +41,7 @@
def reset
super()
- for codingSM in @_mCodingSM:
+ for codingSM in @_mCodingSM
next if not codingSM
codingSM.active = true
codingSM.reset()
--- rchardet/eucjpprober.rb.orig 2011-09-29 14:52:23.071997248 +0200
+++ rchardet/eucjpprober.rb 2011-09-29 14:52:35.936003051 +0200
@@ -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]
--- rchardet/jpcntx.rb.orig 2011-09-29 14:53:02.935989236 +0200
+++ rchardet/jpcntx.rb 2011-09-29 14:53:26.824001825 +0200
@@ -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
--- rchardet/sjisprober.rb.orig 2011-09-29 14:53:36.076010091 +0200
+++ rchardet/sjisprober.rb 2011-09-29 14:53:46.235996348 +0200
@@ -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
--- rchardet/universaldetector.rb.orig 2011-09-29 14:54:15.824011206 +0200
+++ rchardet/universaldetector.rb 2011-09-29 14:54:28.324002819 +0200
@@ -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] }
--- rchardet/utf8prober.rb.orig 2011-09-29 14:54:50.203995741 +0200
+++ rchardet/utf8prober.rb 2011-09-29 14:54:58.976001367 +0200
@@ -63,7 +63,7 @@
end
end
- if get_state() == EDetecting:
+ if get_state() == EDetecting
if get_confidence() > SHORTCUT_THRESHOLD
@_mState = EFoundIt
end
--- End Message ---
--- Begin Message ---
Source: ruby-rchardet
Source-Version: 1.3-2
We believe that the bug you reported is fixed in the latest version of
ruby-rchardet, which is due to be installed in the Debian FTP archive:
ruby-rchardet_1.3-2.debian.tar.gz
to main/r/ruby-rchardet/ruby-rchardet_1.3-2.debian.tar.gz
ruby-rchardet_1.3-2.dsc
to main/r/ruby-rchardet/ruby-rchardet_1.3-2.dsc
ruby-rchardet_1.3-2_all.deb
to main/r/ruby-rchardet/ruby-rchardet_1.3-2_all.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Paul van Tilburg <[email protected]> (supplier of updated ruby-rchardet package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Tue, 08 Nov 2011 21:23:18 +0100
Source: ruby-rchardet
Binary: ruby-rchardet
Architecture: source all
Version: 1.3-2
Distribution: unstable
Urgency: low
Maintainer: Debian Ruby Extras Maintainers
<[email protected]>
Changed-By: Paul van Tilburg <[email protected]>
Description:
ruby-rchardet - Character encoding auto-detection for Ruby
Closes: 643770
Changes:
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 <[email protected]>.
* debian/rules: added myself to the uploaders.
Checksums-Sha1:
0dd86d63dff457251242084a5b9d512761133077 1457 ruby-rchardet_1.3-2.dsc
128c154210b705a93e08a84d2e20897697595f4a 3684 ruby-rchardet_1.3-2.debian.tar.gz
db386c5d952e61c09d05e663410b03fa838ae0ee 154122 ruby-rchardet_1.3-2_all.deb
Checksums-Sha256:
807fe6ab9b62380a37742a0b51ec263e1f20934d9fdb2758bb5c8433c7eeffae 1457
ruby-rchardet_1.3-2.dsc
d94d1b9633dd98f3140ba16a4bd17b481c44b3b3d83a13fc5dfea71856615951 3684
ruby-rchardet_1.3-2.debian.tar.gz
cf864d2c93806c5d643c3951422764ef9e93bf268c76e9b71d7322005ad82fdc 154122
ruby-rchardet_1.3-2_all.deb
Files:
1179c775e86f74213477579e4bf3578e 1457 ruby optional ruby-rchardet_1.3-2.dsc
46aa14678960f922d3281cd881f0d498 3684 ruby optional
ruby-rchardet_1.3-2.debian.tar.gz
c6097ce6fa89fd93e18a2727725ff5d9 154122 ruby optional
ruby-rchardet_1.3-2_all.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iEYEARECAAYFAk7Y/vMACgkQJBBhylAGQYFw+ACgiuWW6QEfEEFVxcWOabpUoLQh
y1IAn0yZlchXkl5FTkk5I1fBkX8uFvbv
=crHQ
-----END PGP SIGNATURE-----
--- End Message ---
_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers