File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,8 @@ Here is an example:
151
151
name " ruby"
152
152
default_version " 1.9.2-p290"
153
153
source url: " http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-#{ version } .tar.gz" ,
154
- md5: " 604da71839a6ae02b5b5b5e1b792d5eb"
154
+ md5: " 604da71839a6ae02b5b5b5e1b792d5eb" ,
155
+ extract: false
155
156
156
157
dependency " zlib"
157
158
dependency " ncurses"
Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ def fetch_required?
44
44
!( File . exist? ( downloaded_file ) && digest ( downloaded_file , digest_type ) == checksum )
45
45
end
46
46
47
+ #
48
+ # A extract is required if the downloaded_file is an archive and
49
+ # source[:extract] is set to true if provided. Default: true
50
+ #
51
+ # @return [true, false]
52
+ #
53
+ def extract_required?
54
+ return false unless downloaded_file . end_with? ( *ALL_EXTENSIONS )
55
+ !source . key? ( :extract ) ? true : source [ :extract ]
56
+ end
47
57
#
48
58
# The version identifier for this remote location. This is computed using
49
59
# the name of the software, the version of the software, and the checksum.
@@ -182,11 +192,15 @@ def download
182
192
# is copied over as a raw file.
183
193
#
184
194
def deploy
185
- if downloaded_file . end_with? ( *ALL_EXTENSIONS )
195
+ if downloaded_file . end_with? ( *ALL_EXTENSIONS ) && extract_required?
186
196
log . info ( log_key ) { "Extracting `#{ safe_downloaded_file } ' to `#{ safe_project_dir } '" }
187
197
extract
188
198
else
189
- log . info ( log_key ) { "`#{ safe_downloaded_file } ' is not an archive - copying to `#{ safe_project_dir } '" }
199
+ if extract_required?
200
+ log . info ( log_key ) { "`#{ safe_downloaded_file } ' has extraction disabled - copying to `#{ safe_project_dir } '" }
201
+ else
202
+ log . info ( log_key ) { "`#{ safe_downloaded_file } ' is not an archive - copying to `#{ safe_project_dir } '" }
203
+ end
190
204
191
205
if File . directory? ( downloaded_file )
192
206
# If the file itself was a directory, copy the whole thing over. This
You can’t perform that action at this time.
0 commit comments