@@ -119,7 +119,7 @@ def self.parse(input)
119119 headers [ field ] = [ ]
120120 end
121121
122- while !s . eos? and !s . scan ( " \n " ) do
122+ while !s . eos? and !s . scan ( / \n / ) do
123123 # Field is non-space up, but excluding the colon
124124 field = s . scan ( /[^\s :]+/ )
125125
@@ -148,11 +148,11 @@ def self.parse(input)
148148 # Per Python core-metadata spec:
149149 # > Changed in version 2.1: This field may be specified in the message body instead.
150150 #return PythonMetadata.new(headers, s.string[s.pos ...])
151- return headers , s . string [ s . pos ... ]
151+ return headers , s . string [ s . pos .. - 1 ]
152152 elsif headers [ "Metadata-Version" ] . to_f >= 2.0
153153 # dnspython v1.15.0 has a description body and Metadata-Version 2.0
154154 # this seems out of spec, but let's accept it anyway.
155- return headers , s . string [ s . pos ... ]
155+ return headers , s . string [ s . pos .. - 1 ]
156156 else
157157 raise "After reading METADATA headers, extra data is in the file but was not expected. This may be a bug in fpm."
158158 end
@@ -166,7 +166,7 @@ def self.parse(input)
166166 puts "---"
167167 puts input
168168 puts "==="
169- puts input [ s . pointer ... ]
169+ puts input [ s . pointer ..- 1 ]
170170 puts "---"
171171 raise e
172172 end # self.parse
@@ -453,7 +453,7 @@ def download_if_necessary(package, version=nil)
453453
454454 safesystem ( *setup_cmd )
455455
456- files = ::Dir . entries ( target ) . filter { |entry | entry =~ /\. (whl|tgz|tar\. gz|zip)$/ }
456+ files = ::Dir . entries ( target ) . select { |entry | entry =~ /\. (whl|tgz|tar\. gz|zip)$/ }
457457 if files . length != 1
458458 raise "Unexpected directory layout after `pip download ...`. This might be an fpm bug? The directory contains these files: #{ files . inspect } "
459459 end
0 commit comments