[DRE-commits] [ruby-pygments.rb] 04/07: refresh patches
Cédric Boutillier
boutil at moszumanska.debian.org
Tue Mar 1 17:45:23 UTC 2016
This is an automated email from the git hooks/post-receive script.
boutil pushed a commit to branch master
in repository ruby-pygments.rb.
commit ee338d5467fae8eecb5252f8298738d1600387cd
Author: Cédric Boutillier <boutil at debian.org>
Date: Tue Mar 1 18:22:56 2016 +0100
refresh patches
---
.../patches/0001-Remove-gemspec-git-ls-files.patch | 4 +---
.../0003-Conditional-use-of-lexers-file-path.patch | 4 ++--
.../0004-Remove-unshipped-custom-lexers.patch | 8 +++++---
.../0006-Invoke-mentos-directly-on-GNU-Linux.patch | 23 +++++++++++-----------
4 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/debian/patches/0001-Remove-gemspec-git-ls-files.patch b/debian/patches/0001-Remove-gemspec-git-ls-files.patch
index 458bedb..ac65302 100644
--- a/debian/patches/0001-Remove-gemspec-git-ls-files.patch
+++ b/debian/patches/0001-Remove-gemspec-git-ls-files.patch
@@ -6,11 +6,9 @@ From:Per Andersson <avtobiff at gmail.com>
pygments.rb.gemspec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/pygments.rb.gemspec b/pygments.rb.gemspec
-index 2968764..3eb63c9 100644
--- a/pygments.rb.gemspec
+++ b/pygments.rb.gemspec
-@@ -20,5 +20,5 @@ Gem::Specification.new do |s|
+@@ -21,5 +21,5 @@
# s.extensions = ['ext/extconf.rb']
s.require_paths = ['lib']
diff --git a/debian/patches/0003-Conditional-use-of-lexers-file-path.patch b/debian/patches/0003-Conditional-use-of-lexers-file-path.patch
index 8cf3972..73f6901 100644
--- a/debian/patches/0003-Conditional-use-of-lexers-file-path.patch
+++ b/debian/patches/0003-Conditional-use-of-lexers-file-path.patch
@@ -7,7 +7,7 @@ From:Per Andersson <avtobiff at gmail.com>
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
-@@ -119,7 +119,10 @@
+@@ -131,7 +131,10 @@
# Returns an array of lexers
def lexers
begin
@@ -16,6 +16,6 @@ From:Per Andersson <avtobiff at gmail.com>
+ upstream_file = File.expand_path('../../../lexers', __FILE__)
+ debian_file = '/usr/share/ruby-pygments.rb/lexers'
+ lexer_file = File.exists?(debian_file) ? debian_file : upstream_file
- raw = File.open(lexer_file, "r").read
+ raw = File.open(lexer_file, "rb").read
Marshal.load(raw)
rescue Errno::ENOENT
diff --git a/debian/patches/0004-Remove-unshipped-custom-lexers.patch b/debian/patches/0004-Remove-unshipped-custom-lexers.patch
index 1e4ba51..1cdffa8 100644
--- a/debian/patches/0004-Remove-unshipped-custom-lexers.patch
+++ b/debian/patches/0004-Remove-unshipped-custom-lexers.patch
@@ -3,17 +3,19 @@ Subject: Remove unshipped custom lexers
From: Per Andersson <avtobiff at gmail.com>
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
-@@ -142,10 +142,10 @@
+@@ -154,11 +154,11 @@
:filenames => lxr[2],
:mimetypes => lxr[3]
}
-- hash["Augeas"] = {:name=>"Augeas", :aliases=>["augeas"], :filenames=>["*.aug"], :mimetypes=>[]}
- hash["dasm16"] = {:name=>"dasm16", :aliases=>["DASM16"], :filenames=>["*.dasm16", "*.dasm"], :mimetypes=>['text/x-dasm16']}
- hash["Puppet"] = {:name=>"Puppet", :aliases=>["puppet"], :filenames=>["*.pp"], :mimetypes=>[]}
+- hash["Augeas"] = {:name=>"Augeas", :aliases=>["augeas"], :filenames=>["*.aug"], :mimetypes=>[]}
+- hash["TOML"] = {:name=>"TOML", :aliases=>["toml"], :filenames=>["*.toml"], :mimetypes=>[]}
- hash["Slash"] = {:name=>"Slash", :aliases=>["slash"], :filenames=>["*.sl"], :mimetypes=>[]}
-+ #hash["Augeas"] = {:name=>"Augeas", :aliases=>["augeas"], :filenames=>["*.aug"], :mimetypes=>[]}
+ #hash["dasm16"] = {:name=>"dasm16", :aliases=>["DASM16"], :filenames=>["*.dasm16", "*.dasm"], :mimetypes=>['text/x-dasm16']}
+ #hash["Puppet"] = {:name=>"Puppet", :aliases=>["puppet"], :filenames=>["*.pp"], :mimetypes=>[]}
++ #hash["Augeas"] = {:name=>"Augeas", :aliases=>["augeas"], :filenames=>["*.aug"], :mimetypes=>[]}
++ #hash["TOML"] = {:name=>"TOML", :aliases=>["toml"], :filenames=>["*.toml"], :mimetypes=>[]}
+ #hash["Slash"] = {:name=>"Slash", :aliases=>["slash"], :filenames=>["*.sl"], :mimetypes=>[]}
hash
end
diff --git a/debian/patches/0006-Invoke-mentos-directly-on-GNU-Linux.patch b/debian/patches/0006-Invoke-mentos-directly-on-GNU-Linux.patch
index 824f4d7..dd25dd0 100644
--- a/debian/patches/0006-Invoke-mentos-directly-on-GNU-Linux.patch
+++ b/debian/patches/0006-Invoke-mentos-directly-on-GNU-Linux.patch
@@ -20,27 +20,26 @@ This is forwarded upstream https://github.com/tmm1/pygments.rb/pull/119
--- a/lib/pygments/popen.rb
+++ b/lib/pygments/popen.rb
-@@ -37,21 +37,12 @@
+@@ -37,20 +37,12 @@
# A pipe to the mentos python process. #popen4 gives us
# the pid and three IO objects to write and read.
-- script = "#{python_binary} #{File.expand_path('../mentos.py', __FILE__)}"
+- python_path = python_binary(is_windows)
+- script = "#{python_path} #{File.expand_path('../mentos.py', __FILE__)}"
+ script = "#{File.expand_path('../mentos.py', __FILE__)}"
+ script = "python " + script if is_windows
@pid, @in, @out, @err = popen4(script)
@log.info "[#{Time.now.iso8601}] Starting pid #{@pid.to_s} with fd #{@out.to_i.to_s}."
end
-- # Detect a suitable Python binary to use. We can't just use `python2`
-- # because apparently some old versions of Debian only have `python` or
-- # something like that.
-- def python_binary
-- @python_binary ||= begin
-- `which python2`
-- $?.success? ? "python2" : "python"
+- # Detect a suitable Python binary to use.
+- def python_binary(is_windows)
+- if is_windows && which('py')
+- return 'py -2'
- end
+- return which('python2') || 'python'
- end
-
- # Stop the child process by issuing a kill -9.
- #
- # We then call waitpid() with the pid, which waits for that particular
+ # Cross platform which command
+ # from http://stackoverflow.com/a/5471032/284795
+ def which(command)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pygments.rb.git
More information about the Pkg-ruby-extras-commits
mailing list