Ticket #42056: texlive-context.patch

File texlive-context.patch, 1.8 KB (added by mojca (Mojca Miklavec), 10 years ago)

a patch to make ConTeXt work with ruby 2.0

  • Portfile

     
    4646                    port:texlive-fonts-recommended \
    4747                    port:texlive-math-extra
    4848
     49patchfiles          patch-ruby20.diff
     50
    4951post-deactivate {
    5052    delete ${texlive_texmfsysvar}/luatex-cache
    5153}
  • files/patch-ruby20.diff

     
     1# a patch for compatibility with ruby 2.0
     2#
     3# fixed upstream in version 2013.10.20 07:09
     4# http://www.ntg.nl/pipermail/ntg-context/2013/075016.html
     5# http://tug.org/svn/texlive?view=revision&revision=32605
     6#
     7--- runfiles/texmf-dist/scripts/context/ruby/base/switch.rb.orig
     8+++ runfiles/texmf-dist/scripts/context/ruby/base/switch.rb
     9@@ -1,3 +1,5 @@
     10+#encoding: ASCII-8BIT
     11+
     12 # module    : base/switch
     13 # copyright : PRAGMA Advanced Document Engineering
     14 # version   : 2002-2005
     15@@ -488,7 +490,7 @@ class CommandLine
     16     def dirtyvalue(value)
     17         if value then
     18             value.gsub(/([\"\'])(.*?)\1/) do
     19-                $2.gsub(/\s+/o, "\xFF")
     20+                $2.gsub(/\s+/o, "\0xFF")
     21             end
     22         else
     23             ''
     24@@ -498,7 +500,7 @@ class CommandLine
     25     def cleanvalue(value)
     26         if value then
     27             # value.sub(/^([\"\'])(.*?)\1$/) { $2.gsub(/\xFF/o, ' ') }
     28-            value.gsub(/\xFF/o, ' ')
     29+            value.gsub(/\0xFF/o, ' ')
     30         else
     31             ''
     32         end
     33@@ -567,7 +569,7 @@ class CommandLine
     34 
     35     def locateseries(series, value)
     36 
     37-        series.each do |key|
     38+        series.each_char do |key|
     39             locatesingle(key,cleanvalue(value))
     40         end
     41