kameleon-builder 2.10.12 → 2.11.0
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 +4 -4
- data/CHANGES +24 -0
- data/COPYING +5 -5
- data/README.rst +20 -5
- data/RELEASING.md +41 -24
- data/completion/kameleon.bash +0 -2
- data/erb/extend.yaml.erb +1 -1
- data/kameleon-builder.gemspec +11 -9
- data/lib/kameleon/cli.rb +2 -2
- data/lib/kameleon/engine.rb +1 -1
- data/lib/kameleon/persistent_cache.rb +1 -1
- data/lib/kameleon/recipe.rb +26 -21
- data/lib/kameleon/step.rb +3 -3
- data/lib/kameleon/ui.rb +1 -1
- data/lib/kameleon/utils.rb +7 -2
- data/lib/kameleon/version.rb +1 -1
- data/lib/kameleon.rb +1 -1
- metadata +23 -61
- data/.bumpversion.cfg +0 -16
- data/contrib/scripts/VirtualBox_deploy.sh +0 -12
- data/contrib/scripts/chroot_env +0 -9
- data/contrib/scripts/create_passwd.py +0 -17
- data/contrib/scripts/umount-chroot.sh +0 -290
- data/contrib/steps/bootstrap/debian/bootstrap_if_needed.yaml +0 -47
- data/contrib/steps/bootstrap/debian/bootstrap_static.yaml +0 -38
- data/contrib/steps/bootstrap/debian/debootstrap_arm.yaml +0 -23
- data/contrib/steps/export/clean_appliance.yaml +0 -9
- data/contrib/steps/export/compact_qcow_img.yaml +0 -12
- data/contrib/steps/export/save_as_g5k.yaml +0 -63
- data/contrib/steps/setup/add_timestamp.yaml +0 -6
- data/contrib/steps/setup/add_to_sudoers.yaml +0 -5
- data/contrib/steps/setup/archlinux/configure_ruby.yaml +0 -7
- data/contrib/steps/setup/archlinux/install_dev_tools.yaml +0 -18
- data/contrib/steps/setup/archlinux/install_gnome.yaml +0 -27
- data/contrib/steps/setup/archlinux/install_yaourt.yaml +0 -29
- data/contrib/steps/setup/autologin.yaml +0 -16
- data/contrib/steps/setup/centos/6.5/configure_repo.yaml +0 -9
- data/contrib/steps/setup/copy_ssh_auth_file.yaml +0 -10
- data/contrib/steps/setup/debian/add_network_interface.yaml +0 -7
- data/contrib/steps/setup/debian/cluster_tools_install.yaml +0 -16
- data/contrib/steps/setup/debian/install_gnome.yaml +0 -13
- data/contrib/steps/setup/debian/install_kde.yaml +0 -13
- data/contrib/steps/setup/debian/network_config_static.yaml +0 -17
- data/contrib/steps/setup/generate_user_ssh_key.yaml +0 -15
- data/contrib/steps/setup/install_my_ssh_key.yaml +0 -26
- data/contrib/steps/setup/make_swap_file.yaml +0 -9
- data/contrib/steps/setup/root_ssh_config.yaml +0 -18
- data/contrib/steps/setup/set_user_password.yaml +0 -7
- data/contrib/steps/setup/system_optimization.yaml +0 -8
- data/scripts/bumpversion.py +0 -184
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a474581cf9237053d9e97441871d3cfec86a5670aec656c05dfd93d699b6098
|
4
|
+
data.tar.gz: 4636916224c68d8637a71dd427975698669d11f7ca6ec9511ece3931853d33a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27159883626026bdb00254119ea6428eba91c1cf0bc0dd30dbb3af3ded154aee855ef4d4b780a901f84e7c2563874446f0a2ca4951d5b12eedb416c5085cac67
|
7
|
+
data.tar.gz: ab15e8247297ece98afa80cfe50ba9b8d53da227ca120a8613e729fbc03749b1e22a5a095d10b130023eb837fb582741e4a6f7c04f3d7cc0406e833ce1ad0a43
|
data/CHANGES
CHANGED
@@ -1,6 +1,30 @@
|
|
1
1
|
Kameleon CHANGELOG
|
2
2
|
==================
|
3
3
|
|
4
|
+
Version 2.10.14 → 2.11.0
|
5
|
+
------------------------
|
6
|
+
|
7
|
+
Released on May 4th 2025
|
8
|
+
|
9
|
+
- Enable command aliases in the definition of checkpoint actions.
|
10
|
+
- Enable command aliases with no args.
|
11
|
+
- Fix dependencies to progressbar and ruby-graphviz (the "ruby-" prefix matters!).
|
12
|
+
- Fix terminal width issue with latest Thor.
|
13
|
+
- Fix graphviz and progress bar dependencies.
|
14
|
+
- Rework README.rst and the documentation front page.
|
15
|
+
- Some other minor changes.
|
16
|
+
|
17
|
+
Version 2.10.13
|
18
|
+
---------------
|
19
|
+
|
20
|
+
Released on March 26th 2025
|
21
|
+
|
22
|
+
- Drop useless contrib directory.
|
23
|
+
- Rework gem summary and description.
|
24
|
+
- Update gem dependencies for gem install on Debian 11 and 13.
|
25
|
+
- Adapt sources to Ruby 3.1 - Psych's YAML: explicitly use YAML.unsafe_load.
|
26
|
+
- Add git to requirements, need for kameleon repo commands.
|
27
|
+
|
4
28
|
Version 2.10.12
|
5
29
|
---------------
|
6
30
|
|
data/COPYING
CHANGED
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
|
|
55
55
|
|
56
56
|
The precise terms and conditions for copying, distribution and
|
57
57
|
modification follow.
|
58
|
-
|
58
|
+
|
59
59
|
GNU GENERAL PUBLIC LICENSE
|
60
60
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61
61
|
|
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
|
110
110
|
License. (Exception: if the Program itself is interactive but
|
111
111
|
does not normally print such an announcement, your work based on
|
112
112
|
the Program is not required to print an announcement.)
|
113
|
-
|
113
|
+
|
114
114
|
These requirements apply to the modified work as a whole. If
|
115
115
|
identifiable sections of that work are not derived from the Program,
|
116
116
|
and can be reasonably considered independent and separate works in
|
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
|
168
168
|
access to copy the source code from the same place counts as
|
169
169
|
distribution of the source code, even though third parties are not
|
170
170
|
compelled to copy the source along with the object code.
|
171
|
-
|
171
|
+
|
172
172
|
4. You may not copy, modify, sublicense, or distribute the Program
|
173
173
|
except as expressly provided under this License. Any attempt
|
174
174
|
otherwise to copy, modify, sublicense or distribute the Program is
|
@@ -225,7 +225,7 @@ impose that choice.
|
|
225
225
|
|
226
226
|
This section is intended to make thoroughly clear what is believed to
|
227
227
|
be a consequence of the rest of this License.
|
228
|
-
|
228
|
+
|
229
229
|
8. If the distribution and/or use of the Program is restricted in
|
230
230
|
certain countries either by patents or by copyrighted interfaces, the
|
231
231
|
original copyright holder who places the Program under this License
|
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
278
278
|
POSSIBILITY OF SUCH DAMAGES.
|
279
279
|
|
280
280
|
END OF TERMS AND CONDITIONS
|
281
|
-
|
281
|
+
|
282
282
|
How to Apply These Terms to Your New Programs
|
283
283
|
|
284
284
|
If you develop a new program, and you want it to be of the greatest
|
data/README.rst
CHANGED
@@ -1,11 +1,26 @@
|
|
1
1
|
Kameleon appliance builder
|
2
2
|
==========================
|
3
3
|
|
4
|
-
Kameleon is a simple but powerful tool to generate customized
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
Kameleon is a simple but powerful tool to generate customized operating system
|
5
|
+
images, based on traceable recipes.
|
6
|
+
|
7
|
+
Thanks to Kameleon, one can write recipes that describe how to create, step by
|
8
|
+
step, customized operating systems in any desired target format, and then cook
|
9
|
+
them (build them), just like GNU make cooks sources using a Makefile to build
|
10
|
+
binary programs.
|
11
|
+
|
12
|
+
For instance, Kameleon can create custom operating system images for QEMU/KVM,
|
13
|
+
VirtualBox, docker, LXC or bootable ISO. It can support creating such images
|
14
|
+
for any machine architecture (x86, ARM64, PPC64, ... ).
|
15
|
+
|
16
|
+
In fact, since the Kameleon engine by itself is very generic by design, a lot
|
17
|
+
more can be done, because most of the specialization happens in the recipes,
|
18
|
+
written in Kameleon's powerful recipe language (YAML based DSL).
|
19
|
+
|
20
|
+
Kameleon was initially developed to improve reproducibility in computer science
|
21
|
+
and engineering, providing a tool that achieves complete *reconstructability*
|
22
|
+
of system images with cache, checkpointing and interactive breakpoint
|
23
|
+
mechanisms.
|
9
24
|
|
10
25
|
* Latest documentation: http://kameleon.imag.fr/getting_started.html
|
11
26
|
* Source code and issue tracker: https://github.com/oar-team/kameleon
|
data/RELEASING.md
CHANGED
@@ -11,21 +11,23 @@ Assuming work is done in the devel branch.
|
|
11
11
|
For stable releases:
|
12
12
|
--------------------
|
13
13
|
|
14
|
-
##
|
14
|
+
## Switch and update the master branch
|
15
15
|
```
|
16
|
-
git
|
17
|
-
git
|
16
|
+
git switch master
|
17
|
+
git pull -r
|
18
18
|
```
|
19
|
+
Do whatever changes needed in the code (possibly merging a branch or a pull request).
|
20
|
+
Commit.
|
19
21
|
|
20
|
-
##
|
21
|
-
|
22
|
-
|
22
|
+
## Update changelog
|
23
|
+
Edit the `CHANGES` file.
|
24
|
+
Commit.
|
23
25
|
|
24
26
|
## Bump version
|
25
|
-
|
27
|
+
Edit the `lib/kameleon/version.rb` file and bump the version.
|
28
|
+
Commit:
|
26
29
|
```
|
27
|
-
|
28
|
-
git push
|
30
|
+
git commit -m "v2.10.16 → v.2.10.17" lib/kameleon/version.rb
|
29
31
|
```
|
30
32
|
|
31
33
|
## Build gem
|
@@ -33,9 +35,28 @@ git push
|
|
33
35
|
gem build kameleon-builder.gemspec
|
34
36
|
```
|
35
37
|
|
38
|
+
## Test
|
39
|
+
Manually install:
|
40
|
+
```
|
41
|
+
gem install --user ./kameleon-builder-2.10.17.gem
|
42
|
+
```
|
43
|
+
Test, test, test.
|
44
|
+
|
45
|
+
## Tag
|
46
|
+
If everything is ok, tag:
|
47
|
+
```
|
48
|
+
git tag -s 'v2.10.17' -m 'v2.10.17'
|
49
|
+
```
|
50
|
+
|
51
|
+
## Push git push
|
52
|
+
```
|
53
|
+
git push
|
54
|
+
```
|
55
|
+
|
56
|
+
|
36
57
|
## Push to Ruby gem repository
|
37
58
|
```
|
38
|
-
|
59
|
+
gem push kameleon-builder-2.10.17.gem
|
39
60
|
```
|
40
61
|
|
41
62
|
Note: You need a rubygem account and the owner has to give you permissions so that you can push.
|
@@ -43,27 +64,23 @@ To do so, create an account on https://rubygems.org/ and ask an owner to do
|
|
43
64
|
the following command::
|
44
65
|
|
45
66
|
```
|
46
|
-
|
67
|
+
gem owner kameleon-builder -a your@email.com
|
47
68
|
```
|
48
69
|
|
49
70
|
That's all :)
|
50
71
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
## Move to the devel branch and rebase on master
|
72
|
+
## In case a release is buggy
|
73
|
+
Yank it to remove it from the rubygems index.
|
55
74
|
```
|
56
|
-
|
57
|
-
git rebase master
|
75
|
+
gem yank kameleon-builder -v 2.10.16
|
58
76
|
```
|
59
77
|
|
60
|
-
|
61
|
-
|
78
|
+
For developments:
|
79
|
+
-----------------
|
80
|
+
|
81
|
+
Changes can be tested by locally installing the gem after building it:
|
62
82
|
```
|
63
|
-
|
83
|
+
gem build kameleon-builder.gemspec && gem install --user ./kameleon-builder-2.10.17.gem
|
64
84
|
```
|
65
85
|
|
66
|
-
|
67
|
-
And same as above to build "devel" gem and use them locally, or push them if really wanted.
|
68
|
-
|
69
|
-
Up to the time to build a new stable version.
|
86
|
+
Using git branches, github pull requests, aso, is of course good.
|
data/completion/kameleon.bash
CHANGED
data/erb/extend.yaml.erb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
#
|
7
7
|
#==============================================================================
|
8
8
|
# This recipe extends another. To look at the step involed, run:
|
9
|
-
# kameleon dryrun <%= recipe_name %>
|
9
|
+
# kameleon build --dryrun <%= recipe_name %>
|
10
10
|
# To see the variables that you can override, use the following command:
|
11
11
|
# kameleon info <%= recipe_name %>
|
12
12
|
---
|
data/kameleon-builder.gemspec
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'kameleon/version'
|
5
6
|
|
@@ -17,8 +18,8 @@ Gem::Specification.new do |s|
|
|
17
18
|
'camilo1729@gmail.com',
|
18
19
|
'pierre.neyron@imag.fr',
|
19
20
|
'bruno.bzeznik@imag.fr']
|
20
|
-
s.
|
21
|
-
s.
|
21
|
+
s.summary = 'The mindful appliance builder'
|
22
|
+
s.description = 'Kameleon is a tool to build system appliances, possibly from scratch'
|
22
23
|
s.homepage = 'http://kameleon.imag.fr/'
|
23
24
|
s.license = 'GPL-2.0-or-later'
|
24
25
|
|
@@ -28,12 +29,13 @@ Gem::Specification.new do |s|
|
|
28
29
|
s.test_files = s.files.grep(%r{^(tests|s|features)/})
|
29
30
|
s.require_paths = ['lib']
|
30
31
|
|
31
|
-
s.add_dependency 'childprocess', '~>
|
32
|
-
s.add_dependency '
|
33
|
-
s.add_dependency '
|
34
|
-
s.add_dependency 'psych', '~> 2.0'
|
32
|
+
s.add_dependency 'childprocess', '~> 4.0'
|
33
|
+
s.add_dependency 'progressbar', '~> 1.10'
|
34
|
+
s.add_dependency 'psych', '~> 5.0'
|
35
35
|
s.add_dependency 'ruby-graphviz', '~> 1.2'
|
36
|
-
s.add_dependency '
|
36
|
+
s.add_dependency 'table_print', '~> 1.5'
|
37
|
+
s.add_dependency 'thor', '~> 1.0'
|
37
38
|
|
38
|
-
s.requirements
|
39
|
+
s.requirements << 'git'
|
40
|
+
s.requirements << 'graphviz'
|
39
41
|
end
|
data/lib/kameleon/cli.rb
CHANGED
@@ -2,7 +2,7 @@ require 'kameleon/engine'
|
|
2
2
|
require 'kameleon/recipe'
|
3
3
|
require 'kameleon/utils'
|
4
4
|
require 'tempfile'
|
5
|
-
require 'graphviz'
|
5
|
+
require 'graphviz' # ruby-graphviz gem (GraphViz class), not the graphviz gem (Graphviz module)
|
6
6
|
|
7
7
|
module Kameleon
|
8
8
|
|
@@ -157,7 +157,7 @@ module Kameleon
|
|
157
157
|
class_option :verbose, :type => :boolean, :default => Kameleon.default_values[:verbose],
|
158
158
|
:desc => "Enable verbose output for kameleon users"
|
159
159
|
class_option :debug, :type => :boolean, :default => Kameleon.default_values[:debug],
|
160
|
-
:desc => "Enable debug output for kameleon
|
160
|
+
:desc => "Enable debug output for kameleon developers"
|
161
161
|
class_option :script, :type => :boolean, :default => Kameleon.default_values[:script],
|
162
162
|
:desc => "Never prompt for user intervention",
|
163
163
|
:aliases => "-s"
|
data/lib/kameleon/engine.rb
CHANGED
@@ -258,7 +258,7 @@ module Kameleon
|
|
258
258
|
end
|
259
259
|
## We have to load the file
|
260
260
|
metadata_dir = File.join(@cache_dir,"metadata")
|
261
|
-
@cmd_cached = YAML.
|
261
|
+
@cmd_cached = YAML.unsafe_load(File.read("#{metadata_dir}/cache_cmd_index"))
|
262
262
|
end
|
263
263
|
@activated = true
|
264
264
|
#@cached_recipe_dir = @cache_dir
|
data/lib/kameleon/recipe.rb
CHANGED
@@ -93,7 +93,7 @@ module Kameleon
|
|
93
93
|
Kameleon.ui.verbose("Loading #{@path}")
|
94
94
|
fail RecipeError, "Could not find this following recipe: #{@path}" \
|
95
95
|
unless File.file? @path
|
96
|
-
yaml_recipe = YAML.
|
96
|
+
yaml_recipe = YAML.unsafe_load_file @path
|
97
97
|
unless yaml_recipe.kind_of? Hash
|
98
98
|
fail RecipeError, "Invalid yaml: #{@path}"
|
99
99
|
end
|
@@ -137,7 +137,7 @@ module Kameleon
|
|
137
137
|
|
138
138
|
# Resolve dynamically-defined variables !!
|
139
139
|
resolved_global = Utils.resolve_vars(@global.to_yaml, @path, @global, self, kwargs)
|
140
|
-
resolved_global = @global.merge YAML.
|
140
|
+
resolved_global = @global.merge YAML.unsafe_load(resolved_global)
|
141
141
|
Kameleon.ui.debug("Resolved_global: #{resolved_global}")
|
142
142
|
# Loads aliases
|
143
143
|
load_aliases(yaml_recipe)
|
@@ -242,7 +242,7 @@ module Kameleon
|
|
242
242
|
base_recipe_path << ".yaml" unless base_recipe_path.end_with? ".yaml"
|
243
243
|
fail RecipeError, "Could not find this following recipe: #{@recipe_path}" \
|
244
244
|
unless File.file? path
|
245
|
-
base_yaml_recipe = YAML.
|
245
|
+
base_yaml_recipe = YAML.unsafe_load_file base_recipe_path
|
246
246
|
unless yaml_recipe.kind_of? Hash
|
247
247
|
fail RecipeError, "Invalid yaml: #{base_yaml_recipe}"
|
248
248
|
end
|
@@ -298,7 +298,7 @@ module Kameleon
|
|
298
298
|
def load_global_file(global_file, recipe_path)
|
299
299
|
def try_to_load(absolute_path)
|
300
300
|
if File.file?(absolute_path)
|
301
|
-
global_to_include = YAML.
|
301
|
+
global_to_include = YAML.unsafe_load_file(absolute_path)
|
302
302
|
if global_to_include.kind_of? Hash
|
303
303
|
@step_files.push(absolute_path)
|
304
304
|
return global_to_include
|
@@ -376,7 +376,7 @@ module Kameleon
|
|
376
376
|
path = Pathname.new(File.join(dir_path, aliases_file))
|
377
377
|
if File.file?(path)
|
378
378
|
Kameleon.ui.verbose("Loading aliases #{path}")
|
379
|
-
@aliases.merge!(YAML.
|
379
|
+
@aliases.merge!(YAML.unsafe_load_file(path))
|
380
380
|
@step_files.push(path)
|
381
381
|
return path
|
382
382
|
end
|
@@ -439,7 +439,7 @@ module Kameleon
|
|
439
439
|
path = Pathname.new(File.join(dir_path, checkpoint))
|
440
440
|
if File.file?(path)
|
441
441
|
Kameleon.ui.verbose("Loading checkpoint configuration #{path}")
|
442
|
-
@checkpoint = YAML.
|
442
|
+
@checkpoint = YAML.unsafe_load_file(path)
|
443
443
|
@checkpoint["path"] = path.to_s
|
444
444
|
@step_files.push(path)
|
445
445
|
break
|
@@ -461,7 +461,7 @@ module Kameleon
|
|
461
461
|
macrostep_yaml = args
|
462
462
|
step_path = @path
|
463
463
|
else
|
464
|
-
macrostep_yaml = YAML.
|
464
|
+
macrostep_yaml = YAML.unsafe_load_file(step_path)
|
465
465
|
# Basic macrostep syntax check
|
466
466
|
if not macrostep_yaml.kind_of? Array
|
467
467
|
fail RecipeError, "The macrostep #{step_path} is not valid "
|
@@ -550,7 +550,7 @@ module Kameleon
|
|
550
550
|
end
|
551
551
|
# Resolve dynamically-defined variables !!
|
552
552
|
resolved_global = Utils.resolve_vars(@global.to_yaml, @path, @global, self, kwargs)
|
553
|
-
@global.merge! YAML.
|
553
|
+
@global.merge! YAML.unsafe_load(resolved_global)
|
554
554
|
|
555
555
|
consistency_check
|
556
556
|
resolve_checkpoint unless @checkpoint.nil?
|
@@ -637,6 +637,9 @@ module Kameleon
|
|
637
637
|
|
638
638
|
def resolve_checkpoint()
|
639
639
|
(@checkpoint.keys - ["path"]).each do |key|
|
640
|
+
@checkpoint[key].map! do |cmd|
|
641
|
+
resolve_alias(cmd)
|
642
|
+
end.flatten!
|
640
643
|
@checkpoint[key].each do |cmd|
|
641
644
|
cmd.string_cmd = Utils.resolve_vars(cmd.string_cmd,
|
642
645
|
@checkpoint["path"],
|
@@ -648,32 +651,34 @@ module Kameleon
|
|
648
651
|
|
649
652
|
def resolve_alias(cmd)
|
650
653
|
name = cmd.key
|
651
|
-
if @aliases.keys.include?(name)
|
654
|
+
if @aliases.keys.include?(name)
|
652
655
|
Kameleon.ui.debug("Resolving alias '#{name}'")
|
653
656
|
aliases_cmd = @aliases.fetch(name).clone
|
654
657
|
aliases_cmd_str = aliases_cmd.to_yaml
|
655
|
-
|
656
|
-
args = []
|
658
|
+
yaml = YAML.unsafe_load(cmd.string_cmd)
|
659
|
+
args = []
|
660
|
+
if yaml.is_a?(Hash) # if cmd is an alias with no args, yaml is a String
|
661
|
+
args.push(yaml[name]).flatten! # convert args to array
|
662
|
+
end
|
657
663
|
expected_args_number = aliases_cmd_str.scan(/@\d+/).uniq.count
|
658
664
|
if expected_args_number != args.count
|
659
|
-
if
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
end
|
665
|
+
msg = if expected_args_number.zero?
|
666
|
+
"#{name} takes no arguments (#{args.count} given)"
|
667
|
+
else
|
668
|
+
"#{name} takes exactly #{expected_args_number} arguments (#{args.count} given)"
|
669
|
+
end
|
665
670
|
raise RecipeError, msg
|
666
671
|
end
|
667
672
|
aliases_cmd.map do |c|
|
668
673
|
nc = Command.new(c, cmd.microstep_name)
|
669
674
|
args.each_with_index do |arg, i|
|
670
|
-
nc.gsub!("@#{i+1}", arg)
|
675
|
+
nc.gsub!("@#{i + 1}", arg)
|
671
676
|
end
|
672
677
|
resolve_alias(nc)
|
673
|
-
end
|
674
|
-
elsif cmd.value.
|
678
|
+
end
|
679
|
+
elsif cmd.value.is_a?(Array)
|
675
680
|
Kameleon.ui.debug("Search for aliases in the sub-commands of '#{name}'")
|
676
|
-
cmd.value.map!{ |
|
681
|
+
cmd.value.map! { |c| resolve_alias(c) }.flatten!
|
677
682
|
cmd.remaster_string_cmd_from_value!
|
678
683
|
else
|
679
684
|
Kameleon.ui.debug("Leaf command '#{name}' is not an alias")
|
data/lib/kameleon/step.rb
CHANGED
@@ -23,7 +23,7 @@ module Kameleon
|
|
23
23
|
|
24
24
|
def key
|
25
25
|
if @key.nil?
|
26
|
-
object = YAML.
|
26
|
+
object = YAML.unsafe_load(@string_cmd)
|
27
27
|
if object.kind_of? String
|
28
28
|
@key = object
|
29
29
|
else
|
@@ -40,7 +40,7 @@ module Kameleon
|
|
40
40
|
def value
|
41
41
|
if @value.nil?
|
42
42
|
Kameleon.ui.debug("Parsed string = #{@string_cmd}")
|
43
|
-
object = YAML.
|
43
|
+
object = YAML.unsafe_load(@string_cmd)
|
44
44
|
if object.kind_of? Command
|
45
45
|
@value = object
|
46
46
|
elsif object.kind_of? String
|
@@ -192,7 +192,7 @@ module Kameleon
|
|
192
192
|
@path,
|
193
193
|
tmp_resolved_vars.merge(global),
|
194
194
|
recipe)
|
195
|
-
tmp_resolved_vars.merge! YAML.
|
195
|
+
tmp_resolved_vars.merge! YAML.unsafe_load(yaml_resolved.chomp)
|
196
196
|
end
|
197
197
|
@variables.merge! tmp_resolved_vars
|
198
198
|
@microsteps.each do |m|
|
data/lib/kameleon/ui.rb
CHANGED
@@ -139,7 +139,7 @@ module Kameleon
|
|
139
139
|
spaces ? text.gsub(/#{spaces}/, '') : text
|
140
140
|
end
|
141
141
|
|
142
|
-
def word_wrap(text, line_width =
|
142
|
+
def word_wrap(text, line_width = Thor::Shell::Terminal.terminal_width)
|
143
143
|
strip_leading_spaces(text).split("\n").collect do |line|
|
144
144
|
line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\s+|$)/, "\\1\n").strip : line
|
145
145
|
end * "\n"
|
data/lib/kameleon/utils.rb
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
# The progressbar and ruby-progressbar gems are the same code from
|
2
|
+
# https://github.com/jfelchner/ruby-progressbar/tree/master
|
3
|
+
# Only the lib head file is named progressbar.rb vs. ruby-progressbar.rb.
|
4
|
+
# The progressbar gem is the one packaged as ruby-progressbar in Debian.
|
5
|
+
# Using that one (see gemspec) and require "progressbar" not "ruby-progessbar".
|
1
6
|
require 'progressbar'
|
2
7
|
|
3
8
|
module Kameleon
|
@@ -158,7 +163,7 @@ module Kameleon
|
|
158
163
|
end
|
159
164
|
unless recipes_hash.empty?
|
160
165
|
name_width = recipes_hash.map { |k| k['name'].size }.max
|
161
|
-
desc_width =
|
166
|
+
desc_width = Thor::Shell::Terminal.terminal_width - name_width - 3
|
162
167
|
desc_width = (80 - name_width - 3) if desc_width < 0
|
163
168
|
end
|
164
169
|
repo_str_old = nil
|
@@ -180,7 +185,7 @@ module Kameleon
|
|
180
185
|
if r["description"].to_s.length > desc_width - 4
|
181
186
|
r["description"] = r["description"][0..(desc_width - 4)] + "..."
|
182
187
|
end
|
183
|
-
Kameleon.ui.shell.say
|
188
|
+
Kameleon.ui.shell.say r["description"], :blue
|
184
189
|
end
|
185
190
|
end
|
186
191
|
|
data/lib/kameleon/version.rb
CHANGED
data/lib/kameleon.rb
CHANGED
@@ -61,7 +61,7 @@ module Kameleon
|
|
61
61
|
|
62
62
|
def load_userconf
|
63
63
|
if File.exist?(Kameleon.userconf_path) and not File.zero?(Kameleon.userconf_path)
|
64
|
-
yaml_conf = YAML.
|
64
|
+
yaml_conf = YAML.unsafe_load_file Kameleon.userconf_path
|
65
65
|
unless yaml_conf.kind_of? Hash
|
66
66
|
yaml_conf = {}
|
67
67
|
end
|