producer-stdlib 0.0.6 → 0.0.7
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/lib/producer/stdlib/freebsd.rb +31 -8
- data/lib/producer/stdlib/version.rb +1 -1
- data/producer-stdlib.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61167336d12da40074cc617c7f73c4068455ea43
|
4
|
+
data.tar.gz: 5124f9aa5afdf16372f77f03e9940c2f084bfdd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4600f297b06e66c9d46c6a1f9c1b94d9b55b195896d280fdc4717279b39926cc96dda7ff98787335d860e6987d3d5ae1754ef11c38fb282367848d207f888bf1
|
7
|
+
data.tar.gz: b6fbe67d4ed9e63108e035231f87f544ea6f97cb3fc526ad09a895c6427567a6dd92848a5f55b46a31469509b00893899225e2b6aa31bd30b889872734364185
|
@@ -20,10 +20,33 @@ module Producer
|
|
20
20
|
|
21
21
|
STDLib.compose_macro :make_conf, :file_write_once, MAKE_CONF_PATH
|
22
22
|
|
23
|
+
STDLib.define_test :rc_conf? do |key, value|
|
24
|
+
file_contains '/etc/rc.conf', "#{key}=#{value}\n"
|
25
|
+
end
|
26
|
+
|
23
27
|
STDLib.define_test :rc_enabled? do |service|
|
24
28
|
sh "service #{service} enabled > /dev/null"
|
25
29
|
end
|
26
30
|
|
31
|
+
STDLib.define_macro :rc_conf_update do |key, value|
|
32
|
+
condition { no_rc_conf? key, value }
|
33
|
+
|
34
|
+
file_replace_content RC_CONF_PATH, /^#{key}=.+$/, "#{key}=#{value}"
|
35
|
+
end
|
36
|
+
|
37
|
+
# FIXME: should update existing values
|
38
|
+
STDLib.define_macro :rc_conf_add do |attributes|
|
39
|
+
attributes.each do |k, v|
|
40
|
+
value = case v
|
41
|
+
when true then '"YES"'
|
42
|
+
when false then '"NO"'
|
43
|
+
else '"%s"' % v
|
44
|
+
end
|
45
|
+
|
46
|
+
file_append_once RC_CONF_PATH, "#{k}=#{value}\n"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
27
50
|
STDLib.define_macro :rc_enable do |service|
|
28
51
|
condition { no_rc_enabled? service }
|
29
52
|
|
@@ -31,14 +54,14 @@ module Producer
|
|
31
54
|
sh "service #{service} start"
|
32
55
|
end
|
33
56
|
|
34
|
-
STDLib.define_macro :
|
35
|
-
|
57
|
+
STDLib.define_macro :rc_disable do |service|
|
58
|
+
condition { rc_enabled? service }
|
36
59
|
|
37
|
-
|
38
|
-
|
39
|
-
file_replace_content RC_CONF_PATH, /^hostname=.+$/, rc_conf_value
|
60
|
+
rc_conf_update "#{service}_enable", '"NO"'
|
40
61
|
end
|
41
62
|
|
63
|
+
STDLib.compose_macro :hostname, :rc_conf_update, 'hostname'
|
64
|
+
|
42
65
|
STDLib.define_macro :chsh do |shell|
|
43
66
|
condition { no_env? :shell, shell }
|
44
67
|
|
@@ -94,14 +117,14 @@ module Producer
|
|
94
117
|
condition { no_sh 'pkg -N' }
|
95
118
|
|
96
119
|
# FIXME: must not disable signature
|
97
|
-
sh "PACKAGESITE=#{repo_uri} SIGNATURE_TYPE=NONE ASSUME_ALWAYS_YES=YES pkg bootstrap"
|
98
|
-
sh "PACKAGESITE=#{repo_uri} pkg update"
|
120
|
+
sh "env PACKAGESITE=#{repo_uri} SIGNATURE_TYPE=NONE ASSUME_ALWAYS_YES=YES pkg bootstrap"
|
121
|
+
sh "env PACKAGESITE=#{repo_uri} pkg update"
|
99
122
|
end
|
100
123
|
|
101
124
|
STDLib.define_macro :pkg_install do |pkg|
|
102
125
|
condition { no_pkg? pkg }
|
103
126
|
|
104
|
-
sh 'ASSUME_ALWAYS_YES=YES pkg install %s' % pkg
|
127
|
+
sh 'env ASSUME_ALWAYS_YES=YES pkg install %s' % pkg
|
105
128
|
end
|
106
129
|
end
|
107
130
|
end
|
data/producer-stdlib.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: producer-core
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.3'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.3.
|
22
|
+
version: 0.3.9
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.3'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.3.
|
32
|
+
version: 0.3.9
|
33
33
|
description: |
|
34
34
|
Standard library for producer (gem: producer-core).
|
35
35
|
email: tj@a13.fr
|