1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
From: Debian Ruby Team <pkg-ruby-extras-maintainers@lists.alioth.debian.org>
Date: Thu, 30 Nov 2023 00:19:53 +0100
Subject: Don't set PYGMENTS_PATH and remove sys.path appends
No need to use those as everything is installed already. This is just an updated
version of the previous already existing patch from Debian Ruby Extras Maintainers.
Author: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Origin: other
Last-Update: 2022-01-06
---
lib/pygments/mentos.py | 11 ++++++-----
lib/pygments/popen.rb | 5 +++--
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/lib/pygments/mentos.py b/lib/pygments/mentos.py
index fe89caa..ca4f57b 100755
--- a/lib/pygments/mentos.py
+++ b/lib/pygments/mentos.py
@@ -4,13 +4,14 @@
import struct
import sys, re, os, signal
import traceback
-if 'PYGMENTS_PATH' in os.environ:
- sys.path.insert(0, os.environ['PYGMENTS_PATH'])
+# in debian we have everything we need installed
+#if 'PYGMENTS_PATH' in os.environ:
+# sys.path.insert(0, os.environ['PYGMENTS_PATH'])
-dirname = os.path.dirname
+#dirname = os.path.dirname
-base_dir = dirname(dirname(dirname(os.path.abspath(__file__))))
-sys.path.append(base_dir + "/vendor/pygments-main")
+#base_dir = dirname(dirname(dirname(os.path.abspath(__file__))))
+#sys.path.append(base_dir + "/vendor/pygments-main")
import pygments
from pygments import lexers, formatters, styles, filters
diff --git a/lib/pygments/popen.rb b/lib/pygments/popen.rb
index b819235..f242479 100644
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
@@ -16,12 +16,13 @@ module Pygments
# Get things started by opening a pipe to mentos (the freshmaker), a
# Python process that talks to the Pygments library. We'll talk back and
# forth across this pipe.
- def start(pygments_path = File.join(__dir__, '..', '..', 'vendor', 'pygments-main'))
+ def start # (pygments_path = File.join(__dir__, '..', '..', 'vendor', 'pygments-main') )
@log = Logger.new(ENV.fetch('MENTOS_LOG', File::NULL))
@log.level = Logger::INFO
@log.datetime_format = '%Y-%m-%d %H:%M '
- ENV['PYGMENTS_PATH'] = pygments_path
+ # in debian we have python-pygments installed
+ #ENV['PYGMENTS_PATH'] = pygments_path
# Make sure we kill off the child when we're done
at_exit { stop 'Exiting' }
|