machinery-tool 1.14.1 → 1.14.2

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: 33410867e48fc0bcb7307a3bf675c5625ea2f4ad
4
- data.tar.gz: b6b56186b5adc312ec8e95eca05aaa42975317ca
3
+ metadata.gz: ff11a934561d9adad04837ec1de84ed5024afe81
4
+ data.tar.gz: 591a93b21e2746297042cf185f7f6633f08f21fe
5
5
  SHA512:
6
- metadata.gz: 01c9c1baa1f5d82665df2c5b590020a87ccf75caf4906e691f80fbb9064f831419fab55958b855016298dbb87d4edf2ef656de23eaa947e4a182db37ab3cce31
7
- data.tar.gz: 406612f5da1d81f847e329fc755b6780f7fa5c65d1c31baf09f2c629ef8134105c116c996fc1e53fefd33757a337bcf992cb2d88110615a052bddd47d4140c0f
6
+ metadata.gz: b9eb62471db592d4d575fe9374a09704b2d7bbb8480904087bf546819a562df955cad13d35d6f890403eba1b11806e44245a84737f53a3f41d49f6555c5ff201
7
+ data.tar.gz: db1e12957fd5b529871e47b0bec09379f1351d9345e7553d87f4d737aa63586e61789bcbaeca85434b90ec94b124f98a1551f7f6945e457afbe7d13b2f7eebe3
data/.git_revision CHANGED
@@ -1 +1 @@
1
- a879bc791c625025e2861c0bc37a2d2207da250a
1
+ b8c8eec01238e18a5ce1d9c53590c5c971e01703
data/NEWS CHANGED
@@ -1,6 +1,10 @@
1
1
  # Machinery Release Notes
2
2
 
3
3
 
4
+ ## Version 1.14.2 - Wed Oct 14 18:00:51 CEST 2015 - thardeck@suse.de
5
+
6
+ * Fix typo in HTML package view (gh#SUSE/machinery#1493)
7
+
4
8
  ## Version 1.14.1 - Fri Oct 09 18:30:13 CEST 2015 - thardeck@suse.de
5
9
 
6
10
  * Fix: Clean up binding the server for HTML view to IP addresses
@@ -5,7 +5,7 @@
5
5
  = render_partial "scope_header",
6
6
  :scope => "packages",
7
7
  :title => "Packages",
8
- :count => "#{packages.length} #{Machinery.pluralize(packages.length, "packages")}"
8
+ :count => "#{packages.length} #{Machinery.pluralize(packages.length, "package")}"
9
9
 
10
10
  .row.scope_content.collapse.in
11
11
  .col-xs-1
data/lib/hint.rb CHANGED
@@ -67,7 +67,7 @@ class Hint
67
67
  "#{program_name} inspect #{options[:host]} --name #{options[:name]} --extract-files"
68
68
  elsif options[:docker_container]
69
69
  "To do a full inspection containing all scopes and to extract files run:\n" \
70
- "#{program_name} inspect-container #{options[:docker_container]}" \
70
+ "#{program_name} inspect-container #{options[:docker_container]} " \
71
71
  "--name #{options[:name]} --extract-files"
72
72
  end
73
73
  end
data/lib/version.rb CHANGED
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Machinery
19
19
 
20
- VERSION = "1.14.1"
20
+ VERSION = "1.14.2"
21
21
 
22
22
  end
@@ -15,110 +15,20 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
+ require_relative "../tools/helper_builder"
19
+
18
20
  task :default => "try_build"
19
21
 
20
22
  HELPER_DIR = File.expand_path(File.dirname(__FILE__))
21
- GIT_REVISION_FILE = File.join(HELPER_DIR, "..", ".git_revision")
22
-
23
- def write_go_version_file
24
- file = <<-EOF
25
- // This is a generated file and shouldn't be changed
26
-
27
- package main
28
-
29
- const VERSION = "#{git_revision}"
30
- EOF
31
- File.write(File.join(HELPER_DIR, "version.go"), file)
32
- end
33
-
34
- def build_machinery_helper
35
- FileUtils.rm_f(File.join(HELPER_DIR, "machinery-helper"))
36
- Dir.chdir(HELPER_DIR) do
37
- puts("Building machinery-helper binary.")
38
- if !system("go build")
39
- STDERR.puts("Warning: Building of the machinery-helper failed!")
40
- false
41
- else
42
- true
43
- end
44
- end
45
- end
46
-
47
- def go_available?
48
- if !system("which go > /dev/null 2>&1")
49
- STDERR.puts(
50
- "Warning: The Go compiler is not available on this system. Skipping building the" \
51
- " machinery-helper.\nThe machinery-helper increases the inspection speed significantly."
52
- )
53
- false
54
- else
55
- true
56
- end
57
- end
58
-
59
- def arch_supported?
60
- arch = `uname -p`.chomp
61
- if !["x86_64"].include?(arch)
62
- STDERR.puts(
63
- "Warning: The hardware architecture #{arch} is not yet supported by the machinery-helper."
64
- )
65
- false
66
- else
67
- true
68
- end
69
- end
70
-
71
- def runs_in_git?
72
- Dir.exist?(File.join(HELPER_DIR, "..", ".git")) && system("which git > /dev/null 2>&1")
73
- end
74
-
75
- def git_revision
76
- `git rev-parse HEAD`.chomp
77
- end
78
-
79
- def write_git_revision_file
80
- File.write(GIT_REVISION_FILE, git_revision)
81
- end
82
-
83
- def changed_revision?
84
- if File.exist?(GIT_REVISION_FILE)
85
- old_revision = File.read(GIT_REVISION_FILE)
86
- else
87
- old_revision = "unknown"
88
- end
89
- git_revision != old_revision
90
- end
91
-
92
- def run_build
93
- # An unsupported architecture is no error
94
- return true if !arch_supported?
95
- return false if !go_available?
96
-
97
- # handle changed branches (where go files are older than the helper)
98
- if runs_in_git? && changed_revision?
99
- write_go_version_file
100
- if build_machinery_helper
101
- write_git_revision_file
102
- return true
103
- else
104
- return false
105
- end
106
- end
107
-
108
- if !FileUtils.uptodate?(
109
- File.join(HELPER_DIR, "machinery-helper"), Dir.glob(File.join(HELPER_DIR, "*.go"))
110
- )
111
- return build_machinery_helper
112
- end
113
- true
114
- end
115
23
 
116
24
  desc "Build the helper if needed"
117
25
  task :build do
118
- raise "Error: Build of Machinery helper failed" if !run_build
26
+ helper_builder = HelperBuilder.new(HELPER_DIR)
27
+ raise "Error: Build of Machinery helper failed" if !helper_builder.run_build
119
28
  end
120
29
 
121
30
  desc "Don't fail on build errors"
122
31
  task :try_build do
123
- run_build
32
+ helper_builder = HelperBuilder.new(HELPER_DIR)
33
+ helper_builder.run_build
124
34
  end
@@ -2,4 +2,4 @@
2
2
 
3
3
  package main
4
4
 
5
- const VERSION = "a879bc791c625025e2861c0bc37a2d2207da250a"
5
+ const VERSION = "b8c8eec01238e18a5ce1d9c53590c5c971e01703"
Binary file
@@ -0,0 +1,133 @@
1
+ # encoding:utf-8
2
+
3
+ # Copyright (c) 2013-2015 SUSE LLC
4
+ #
5
+ # This program is free software; you can redistribute it and/or
6
+ # modify it under the terms of version 3 of the GNU General Public License as
7
+ # published by the Free Software Foundation.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, contact SUSE LLC.
16
+ #
17
+ # To contact SUSE about this file by physical or electronic mail,
18
+ # you may find current contact information at www.suse.com
19
+
20
+ # This class is used in the machinery-helper/Rakefile to build the helper
21
+ class HelperBuilder
22
+ def initialize(helper_dir)
23
+ @helper_dir = helper_dir
24
+ @git_revision_file = File.join(helper_dir, "..", ".git_revision")
25
+ end
26
+
27
+ def run_build
28
+ # An unsupported architecture is no error
29
+ return true if !arch_supported?
30
+ return false if !go_available?
31
+
32
+ # handle changed branches (where go files are older than the helper)
33
+ if runs_in_git? && changed_revision?
34
+ write_go_version_file
35
+ if build_machinery_helper
36
+ write_git_revision_file
37
+ return true
38
+ else
39
+ return false
40
+ end
41
+ end
42
+
43
+ if !FileUtils.uptodate?(
44
+ File.join(@helper_dir, "machinery-helper"), Dir.glob(File.join(@helper_dir, "*.go"))
45
+ )
46
+ return build_machinery_helper
47
+ end
48
+ true
49
+ end
50
+
51
+ def write_go_version_file
52
+ file = <<-EOF
53
+ // This is a generated file and shouldn't be changed
54
+
55
+ package main
56
+
57
+ const VERSION = "#{git_revision}"
58
+ EOF
59
+ File.write(File.join(@helper_dir, "version.go"), file)
60
+ end
61
+
62
+ def build_machinery_helper
63
+ FileUtils.rm_f(File.join(@helper_dir, "machinery-helper"))
64
+ Dir.chdir(@helper_dir) do
65
+ puts("Building machinery-helper binary.")
66
+ if !run_go_build
67
+ STDERR.puts("Warning: Building of the machinery-helper failed!")
68
+ false
69
+ else
70
+ true
71
+ end
72
+ end
73
+ end
74
+
75
+ def go_available?
76
+ if !run_which_go
77
+ STDERR.puts(
78
+ "Warning: The Go compiler is not available on this system. Skipping building the" \
79
+ " machinery-helper.\nThe machinery-helper increases the inspection speed significantly."
80
+ )
81
+ false
82
+ else
83
+ true
84
+ end
85
+ end
86
+
87
+ def arch_supported?
88
+ arch = run_uname_p
89
+ if !["x86_64"].include?(arch)
90
+ STDERR.puts(
91
+ "Warning: The hardware architecture #{arch} is not yet supported by the machinery-helper."
92
+ )
93
+ false
94
+ else
95
+ true
96
+ end
97
+ end
98
+
99
+ def runs_in_git?
100
+ Dir.exist?(File.join(@helper_dir, "..", ".git")) && system("which git > /dev/null 2>&1")
101
+ end
102
+
103
+ def write_git_revision_file
104
+ File.write(@git_revision_file, git_revision)
105
+ end
106
+
107
+ def changed_revision?
108
+ if File.exist?(@git_revision_file)
109
+ old_revision = File.read(@git_revision_file)
110
+ else
111
+ old_revision = "unknown"
112
+ end
113
+ git_revision != old_revision
114
+ end
115
+
116
+ private
117
+
118
+ def run_go_build
119
+ system("go build")
120
+ end
121
+
122
+ def git_revision
123
+ `git rev-parse HEAD`.chomp
124
+ end
125
+
126
+ def run_which_go
127
+ system("which go > /dev/null 2>&1")
128
+ end
129
+
130
+ def run_uname_p
131
+ `uname -p`.chomp
132
+ end
133
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinery-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.1
4
+ version: 1.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUSE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cheetah
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.3
117
+ version: '1.3'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.3
124
+ version: '1.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: tilt
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -501,6 +501,7 @@ files:
501
501
  - schema/system-description-global.schema-v3.json
502
502
  - schema/system-description-global.schema-v4.json
503
503
  - schema/system-description-global.schema-v5.json
504
+ - tools/helper_builder.rb
504
505
  - workload_mapper/docker-registry/clue.rb
505
506
  - workload_mapper/docker-registry/compose-template.yml
506
507
  - workload_mapper/docker-registry/container/Dockerfile