specinfra 2.0.0.beta29 → 2.0.0.beta30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19b475b396b0e94a215d943a2f7edf0973772776
4
- data.tar.gz: 5ba06b04d558edc33cfc7202dd1da4ab95c36cb1
3
+ metadata.gz: ea053126dff9d347b4852ece95ef391bbabdd19b
4
+ data.tar.gz: 60e977706ddeed671ca7fabe86d8b420cff3f987
5
5
  SHA512:
6
- metadata.gz: fac9490794ce3527d376f619d3834edcef8918b3bc649c593662f30d072a8dee63bc67b70e8682c9b593181e98063d2cd2a329733653a542be7c21374464537d
7
- data.tar.gz: 9d207df541d529d36f9aefc62047d46a1622db73075784f7dba471eb3a883e0bf68a978c8f2b1ce7a893f7c98099971a8c91676cd7d614f983b843451ba2628a
6
+ metadata.gz: 0ae854501b96d2808b8576408451795ff2768caf0921c727443b75746bd466d250901c1b5db371a9de53576c271bb70f2ab7594d55f58916a130e2c5cdef4e01
7
+ data.tar.gz: 491a50ae31d09282ba7dc7f925681375661b6091a5e0e745760cd61917ff2cd8e20bd5923860654520db06994b7b050f7bde6ca1e1b878c97a2f4f4569d71051
@@ -59,14 +59,12 @@ class Specinfra::Command::Base::File < Specinfra::Command::Base
59
59
  "grep -qF -- #{escape(expected_pattern)} #{escape(file)}"
60
60
  end
61
61
 
62
- def check_has_md5checksum(file, expected)
63
- regexp = "^#{expected}"
64
- "md5sum #{escape(file)} | grep -iw -- #{escape(regexp)}"
62
+ def get_md5sum(file)
63
+ "md5sum #{escape(file)} | cut -d ' ' -f 1"
65
64
  end
66
65
 
67
- def check_has_sha256checksum(file, expected)
68
- regexp = "^#{expected}"
69
- "sha256sum #{escape(file)} | grep -iw -- #{escape(regexp)}"
66
+ def get_sha256sum(file)
67
+ "sha256sum #{escape(file)} | cut -d ' ' -f 1"
70
68
  end
71
69
 
72
70
  def get_content(file)
@@ -4,12 +4,12 @@ class Specinfra::Command::Darwin::Base::File < Specinfra::Command::Base::File
4
4
  "sudo -u #{user} -s /bin/test -#{access} #{file}"
5
5
  end
6
6
 
7
- def check_has_md5checksum(file, expected)
8
- "openssl md5 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
7
+ def get_md5sum(file)
8
+ "openssl md5 #{escape(file)} | cut -d'=' -f2 | cut -c 2-"
9
9
  end
10
10
 
11
- def check_has_sha256checksum(file, expected)
12
- "openssl sha256 #{escape(file)} | cut -d'=' -f2 | cut -c 2- | grep -E ^#{escape(expected)}$"
11
+ def get_sha256sum(file)
12
+ "openssl sha256 #{escape(file)} | cut -d'=' -f2 | cut -c 2-"
13
13
  end
14
14
 
15
15
  def check_is_linked_to(link, target)
@@ -1,13 +1,11 @@
1
1
  class Specinfra::Command::Openbsd::Base::File < Specinfra::Command::Base::File
2
2
  class << self
3
- def check_has_md5checksum(file, expected)
4
- regexp = "^#{expected}"
5
- "cksum -qa md5 #{escape(file)} | grep -w #{escape(regexp)}"
3
+ def get_md5sum(file)
4
+ "cksum -qa md5 #{escape(file)} | cut -d ' ' -f 1"
6
5
  end
7
6
 
8
- def check_has_sha256checksum(file, expected)
9
- regexp = "^#{expected}"
10
- "cksum -qa sha256 #{escape(file)} | grep -w #{escape(regexp)}"
7
+ def get_sha256sum(file)
8
+ "cksum -qa sha256 #{escape(file)} | cut -d ' ' -f 1"
11
9
  end
12
10
 
13
11
  def check_is_linked_to(link, target)
@@ -30,8 +30,8 @@ class Specinfra::Command::Solaris::V10::File < Specinfra::Command::Solaris::Base
30
30
  "grep -- #{escape(expected_pattern)} #{escape(file)}"
31
31
  end
32
32
 
33
- def check_has_md5checksum(file, expected)
34
- "digest -a md5 -v #{escape(file)} | grep -iw -- #{escape(expected)}"
33
+ def get_md5sum(file)
34
+ "digest -a md5 -v #{escape(file)} | cut -d '=' -f 2 | cut -c 2-"
35
35
  end
36
36
 
37
37
  # reference: http://perldoc.perl.org/functions/stat.html
@@ -1,3 +1,3 @@
1
1
  module Specinfra
2
- VERSION = "2.0.0.beta29"
2
+ VERSION = "2.0.0.beta30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: specinfra
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta29
4
+ version: 2.0.0.beta30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita