wslc-wip 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0fdc63759c329dc9cbc9a60a0ef184db31087d454070871bc3f39a1982d7426
4
- data.tar.gz: 447d4f3206b3662def93d376b950de99564f3efbfc85e8607bbaad6fb432545d
3
+ metadata.gz: '029d796a1f1d80a039fc1765f194b6b9cd144ceed002568bc9f38275814bb31a'
4
+ data.tar.gz: 13c45a601b75b7a32dba0824a3424f1f34adc86dc176957318eabc783416ca2d
5
5
  SHA512:
6
- metadata.gz: fc07a96116a3c737332a313447663a1730d6d15729c329b6e121a356de2bf62ba696b7386a854c685a7bb2415fc5b7c0edc42437ec86b80b2d13de99b6075cad
7
- data.tar.gz: 61b8a28cd2953335ca38a97cf15f52302aa070698d183d95fefc1edcd7d85d661cb8461ebe1de830969f4b9480734dfeb13c6431821925a500377eb56b1a4221
6
+ metadata.gz: b9941bb1dab65040e55e2711681283ab43a12c5715ea3af8a64b349a110a80e2066380109d6567667bb00fa898b9f66b34f5c000d382d989419e310d14a27531
7
+ data.tar.gz: 6e5f11ceb6282415d6f8d164c3bde0620c9d2f9886af96d8c08f55d329ebb21efd65d4198dad3669e19566075b08df324abdfe3c0feb57eb605820f5ccff1447
@@ -29,7 +29,10 @@ module Wip
29
29
  each_included_file do |relative_path|
30
30
  target = destination.join(relative_path)
31
31
  FileUtils.mkdir_p(target.dirname)
32
- FileUtils.cp(@root.join(relative_path), target)
32
+ # Keep links as links. Dereferencing a link here could copy arbitrary
33
+ # host files outside the build context (for example, ~/.ssh/id_rsa)
34
+ # into the staged directory and expose them to the image build.
35
+ FileUtils.copy_entry(@root.join(relative_path), target, false, false, false)
33
36
  end
34
37
  end
35
38
 
@@ -38,7 +41,7 @@ module Wip
38
41
  next if %w[. ..].include?(entry)
39
42
 
40
43
  path = @root.join(entry)
41
- next unless path.file?
44
+ next unless path.file? || path.symlink?
42
45
  next if @ignore.ignored?(entry)
43
46
 
44
47
  yield entry
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'tmpdir'
4
+ require 'tempfile'
4
5
 
5
6
  module Wip
6
7
  # Prints each step wip takes and how long it took, when debug mode is enabled.
@@ -45,8 +46,14 @@ module Wip
45
46
  return open_log(@log, "streaming resource snapshots to #{@log}") if @log
46
47
  return nil if live
47
48
 
48
- path = File.join(Dir.tmpdir, "wip-debug-#{Process.pid}-#{Time.now.to_i}.log")
49
- open_log(path, "command owns the terminal; streaming resource snapshots to #{path}")
49
+ # `Tempfile.create`, unlike `Tempfile.new`, leaves the file on disk after
50
+ # we close it, so the path printed just below is still there to read.
51
+ # It still creates with O_EXCL and 0600, which is what stops a
52
+ # predictable name in a shared /tmp from being pre-created as a symlink.
53
+ file = Tempfile.create(['wip-debug-', '.log'])
54
+ file.sync = true
55
+ @out.puts "wip: [debug] command owns the terminal; streaming resource snapshots to #{file.path}"
56
+ file
50
57
  end
51
58
 
52
59
  def open_log(path, notice)
data/lib/wip/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Wip
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wslc-wip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wip contributors