pkgsrc/www/raggle/patches/patch-ab
taca 18d8bcdb78 * Handle gracefuly Ruby iconv depends on, fix PR pkg/36474.
* Fix wrong condition check of mandatory libraries.
* Proper load gem based ruby-ncurses.

Bump PKGREVISION.
2008-09-14 13:58:57 +00:00

39 lines
1.3 KiB
Text

$NetBSD: patch-ab,v 1.1 2008/09/14 13:58:57 taca Exp $
--- raggle.orig 2005-12-15 07:54:11.000000000 +0900
+++ raggle
@@ -81,6 +81,7 @@ require 'pstore'
require 'thread'
require 'time'
require 'uri'
+require 'rubygems' if RUBY_VERSION.sub(/\.\d+$/, "") < "1.9"
#########################
# load external modules #
@@ -132,7 +133,7 @@ if $HAVE_LIB['gettext']
GetText::bindtextdomain('raggle', nil)
end
-unless $HAVE_LIB['webrick'] || $HAVE_LIB['ncurses']
+unless $HAVE_LIB['webrick'] and $HAVE_LIB['ncurses']
$stderr.puts _(<<-ENDERR
ERROR: No interfaces available.
You're missing the both the Ncurses-Ruby and WEBrick modules. You need
@@ -1813,8 +1814,15 @@ ENDWARNING
if $HAVE_LIB['iconv'] && $config['use_iconv']
unless $iconv
# $iconv hasn't been intialized; create it
- enc += '//TRANSLIT' if $config['use_iconv_translit']
- $iconv = Iconv.new(enc, 'UTF-8')
+ if $config['use_iconv_translit']
+ begin
+ $iconv = Iconv.new(enc + '//TRANSLIT', 'UTF-8')
+ rescue Iconv::InvalidEncoding
+ $iconv = Iconv.new(enc, 'UTF-8')
+ end
+ else
+ $iconv = Iconv.new(enc, 'UTF-8')
+ end
end
# decode element using iconv