[DRE-commits] [ruby-uglifier] 05/09: refresh patch modified: debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Sat Jan 28 20:20:53 UTC 2017


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository ruby-uglifier.

commit 6113f28e2fa737edd2ead7449a743ac9af7217b4
Author: Pirate Praveen <praveen at debian.org>
Date:   Sat Jan 28 20:37:47 2017 +0530

    refresh patch
    	modified:   debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch
---
 ...0001-Use-packaged-UglifyJS-and-Source-Map.patch | 31 +++++++++++++---------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch b/debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch
index 3c8bed3..c22723c 100644
--- a/debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch
+++ b/debian/patches/0001-Use-packaged-UglifyJS-and-Source-Map.patch
@@ -7,13 +7,11 @@ This patch is Debian-specific
  lib/uglifier.rb | 30 ++++++++++++++++++++++++------
  1 file changed, 24 insertions(+), 6 deletions(-)
 
-diff --git a/lib/uglifier.rb b/lib/uglifier.rb
-index a2b9671..7e3d7db 100644
 --- a/lib/uglifier.rb
 +++ b/lib/uglifier.rb
-@@ -74,12 +74,21 @@ class Uglifier
-     })
-   JS
+@@ -10,16 +10,23 @@
+   # Error class for compilation errors.
+   Error = ExecJS::Error
  
 +  def self.find_asset(filename)
 +    [
@@ -26,6 +24,8 @@ index a2b9671..7e3d7db 100644
 +  SourceMapPath = "/usr/share/javascript/source-map/source-map.js"
    # UglifyJS source path
 -  SourcePath = File.expand_path("../uglify.js", __FILE__)
+-  # Source Map path
+-  SourceMapPath = File.expand_path("../source-map.js", __FILE__)
 +  SourcePath = "/usr/share/javascript/uglifyjs/uglify.js"
    # ES5 shims source path
 -  ES5FallbackPath = File.expand_path("../es5.js", __FILE__)
@@ -33,15 +33,19 @@ index a2b9671..7e3d7db 100644
    # String.split shim source path
 -  SplitFallbackPath = File.expand_path("../split.js", __FILE__)
 +  SplitFallbackPath = find_asset("split.js")
+   # UglifyJS wrapper path
+-  UglifyJSWrapperPath = File.expand_path("../uglifier.js", __FILE__)
++  UglifyJSWrapperPath = find_asset("uglifier.js")
  
    # Default options for compilation
    DEFAULTS = {
-@@ -191,9 +200,18 @@ class Uglifier
+@@ -159,12 +166,21 @@
    private
  
    def uglifyjs_source
--    [ES5FallbackPath, SplitFallbackPath, SourcePath].map do |file|
--      File.open(file, "r:UTF-8") { |f| f.read }
+-    [ES5FallbackPath, SplitFallbackPath, SourceMapPath, SourcePath,
+-     UglifyJSWrapperPath].map do |file|
+-      File.open(file, "r:UTF-8", &:read)
 -    end.join("\n")
 +    [
 +      __read__(ES5FallbackPath),
@@ -50,11 +54,14 @@ index a2b9671..7e3d7db 100644
 +      __read__(SourceMapPath),
 +      "MOZ_SourceMap = sourceMap;",
 +      __read__(SourcePath),
++      __read__(UglifyJSWrapperPath),
 +    ].join("\n")
-+  end
-+
-+  def __read__(file)
-+    File.open(file, "r:UTF-8") { |f| f.read }
    end
  
++  def __read__(file)
++    File.open(file, "r:UTF-8") { |f| f.read }
++  end
++ 
    # Run UglifyJS for given source code
+   def run_uglifyjs(input, generate_map)
+     source = read_source(input)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-uglifier.git



More information about the Pkg-ruby-extras-commits mailing list