termux-packages/packages/ruby/lib-tmpdir.rb.patch

31 lines
1.0 KiB
Diff
Raw Normal View History

diff -u -r ../ruby-2.4.0/lib/tmpdir.rb ./lib/tmpdir.rb
--- ../ruby-2.4.0/lib/tmpdir.rb 2016-02-26 03:11:14.000000000 +0100
+++ ./lib/tmpdir.rb 2017-01-18 04:13:47.675833299 +0100
@@ -13,7 +13,7 @@
class Dir
- @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '/tmp'
+ @@systmpdir ||= defined?(Etc.systmpdir) ? Etc.systmpdir : '@TERMUX_PREFIX@/tmp'
##
# Returns the operating system's temporary file path.
@@ -23,7 +23,7 @@
@@systmpdir.dup
else
tmp = nil
- [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.'].each do |dir|
+ [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '@TERMUX_PREFIX@/tmp', '.'].each do |dir|
next if !dir
dir = File.expand_path(dir)
if stat = File.stat(dir) and stat.directory? and stat.writable? and
@@ -120,7 +120,7 @@
def create(basename, tmpdir=nil, max_try: nil, **opts)
if $SAFE > 0 and tmpdir.tainted?
- tmpdir = '/tmp'
+ tmpdir = '@TERMUX_PREFIX@/tmp'
else
tmpdir ||= tmpdir()
end