depot3 0.0.0a1 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +55 -1
- data/bin/d3 +323 -0
- data/bin/d3admin +1011 -0
- data/bin/d3helper +354 -0
- data/bin/puppytime +334 -0
- data/data/d3/com.pixar.d3.RepoMan.plist +23 -0
- data/data/d3/d3.conf.example +507 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftAppKit.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftCore.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftCoreData.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftCoreGraphics.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftCoreImage.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftDarwin.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftDispatch.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftFoundation.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Frameworks/libswiftObjectiveC.dylib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Info.plist +56 -0
- data/data/d3/d3RepoMan.app/Contents/MacOS/d3RepoMan +0 -0
- data/data/d3/d3RepoMan.app/Contents/PkgInfo +1 -0
- data/data/d3/d3RepoMan.app/Contents/Resources/Base.lproj/MainMenu.nib +0 -0
- data/data/d3/d3RepoMan.app/Contents/Resources/last-foreground-times-template.plist +5 -0
- data/data/d3/d3RepoMan.app/Contents/_CodeSignature/CodeResources +214 -0
- data/data/d3/puppytime/ImageLicenses.txt +165 -0
- data/data/d3/puppytime/notification_image +1 -0
- data/data/d3/puppytime/opt_out_image +1 -0
- data/data/d3/puppytime/slideshow/2008-07-11_White_German_Shepherd_pup_chilling_at_the_Coker_Arboretum.jpg +0 -0
- data/data/d3/puppytime/slideshow/2009-04-21_APBT_pup_on_deck.jpg +0 -0
- data/data/d3/puppytime/slideshow/A_puppy_Yorkie.jpg +0 -0
- data/data/d3/puppytime/slideshow/Alert_Pug_Puppy.jpg +0 -0
- data/data/d3/puppytime/slideshow/Australian_Cattle_Dog_puppies_04.JPG +0 -0
- data/data/d3/puppytime/slideshow/Beagle_puppy_Cadet.jpg +0 -0
- data/data/d3/puppytime/slideshow/Bernese_Mountain_Dog.jpg +0 -0
- data/data/d3/puppytime/slideshow/Bloodhound_Puppy.jpg +0 -0
- data/data/d3/puppytime/slideshow/Boston_terrier_with_toy.jpg +0 -0
- data/data/d3/puppytime/slideshow/Boxer_puppy_fawn_portrai.jpg +0 -0
- data/data/d3/puppytime/slideshow/Caracal_kitten.jpg +0 -0
- data/data/d3/puppytime/slideshow/Chihuahua_&_Doberman_Pup.jpg +0 -0
- data/data/d3/puppytime/slideshow/Cuccioli_di_Margot_a_35_gg_Basenjis.jpg +0 -0
- data/data/d3/puppytime/slideshow/Dalmatian_puppy_03.jpg +0 -0
- data/data/d3/puppytime/slideshow/GoldenRetrieverPuppyDaisyParker.JPG +0 -0
- data/data/d3/puppytime/slideshow/Green_eyed_beige_Chihuahua.jpg +0 -0
- data/data/d3/puppytime/slideshow/Let_Sleeping_Dogs_Lie.jpg +0 -0
- data/data/d3/puppytime/slideshow/Meatball_-_French_Bulldog_Puppy.jpg +0 -0
- data/data/d3/puppytime/slideshow/Oola_-_9_weeks.jpg +0 -0
- data/data/d3/puppytime/slideshow/Pancho0008.JPG +0 -0
- data/data/d3/puppytime/slideshow/Pomeranian_orange-sable_Coco.jpg +0 -0
- data/data/d3/puppytime/slideshow/Pug_puppy_001.jpg +0 -0
- data/data/d3/puppytime/slideshow/Puggle_puppy_6_weeks.JPG +0 -0
- data/data/d3/puppytime/slideshow/Puli_kan.jpg +0 -0
- data/data/d3/puppytime/slideshow/Puppy_French_Bulldog.jpg +0 -0
- data/data/d3/puppytime/slideshow/Rocco_the_Bulldog.jpg +0 -0
- data/data/d3/puppytime/slideshow/Rottweiler_Face.jpg +0 -0
- data/data/d3/puppytime/slideshow/Saint_Bernard_puppy.jpg +0 -0
- data/data/d3/puppytime/slideshow/Scottish_froment.jpg +0 -0
- data/data/d3/puppytime/slideshow/Shar_pei_puppy_(age_2_months).jpg +0 -0
- data/data/d3/puppytime/slideshow/Shiba-Inu_beim_Spielen_im_Schnee.JPG +0 -0
- data/data/d3/puppytime/slideshow/Smooth-coat_Border_Collie_puppy..jpg +0 -0
- data/data/d3/puppytime/slideshow/Smooth_Dachshund_puppies.jpg +0 -0
- data/data/d3/puppytime/slideshow/Snow_dog.jpg +0 -0
- data/data/d3/puppytime/slideshow/Taylor_the_Pembroke_Welsh_Corgi.png +0 -0
- data/data/d3/puppytime/slideshow/Weim_Pups_001.jpg +0 -0
- data/data/d3/puppytime/slideshow/Westie_pups.jpg +0 -0
- data/data/d3/puppytime/slideshow/Yellow_Labrador_puppies_(4165737325).jpg +0 -0
- data/lib/d3/admin/add.rb +451 -0
- data/lib/d3/admin/auth.rb +470 -0
- data/lib/d3/admin/edit.rb +297 -0
- data/lib/d3/admin/help.rb +396 -0
- data/lib/d3/admin/interactive.rb +972 -0
- data/lib/d3/admin/options.rb +454 -0
- data/lib/d3/admin/prefs.rb +204 -0
- data/lib/d3/admin/report.rb +727 -0
- data/lib/d3/admin/state.rb +42 -0
- data/lib/d3/admin/validate.rb +413 -0
- data/lib/d3/admin.rb +42 -0
- data/lib/d3/basename.rb +217 -0
- data/lib/d3/client/auth.rb +108 -0
- data/lib/d3/client/class_methods.rb +766 -0
- data/lib/d3/client/class_variables.rb +47 -0
- data/lib/d3/client/cli.rb +187 -0
- data/lib/d3/client/environment.rb +134 -0
- data/lib/d3/client/help.rb +110 -0
- data/lib/d3/client/lists.rb +314 -0
- data/lib/d3/client/receipt.rb +1173 -0
- data/lib/d3/client.rb +45 -0
- data/lib/d3/configuration.rb +319 -0
- data/lib/d3/constants.rb +60 -0
- data/lib/d3/database.rb +488 -0
- data/lib/d3/exceptions.rb +44 -0
- data/lib/d3/log.rb +271 -0
- data/lib/d3/package/aliases.rb +80 -0
- data/lib/d3/package/attributes.rb +97 -0
- data/lib/d3/package/class_methods.rb +817 -0
- data/lib/d3/package/class_variables.rb +46 -0
- data/lib/d3/package/client_actions.rb +293 -0
- data/lib/d3/package/constants.rb +58 -0
- data/lib/d3/package/constructor.rb +191 -0
- data/lib/d3/package/getters.rb +164 -0
- data/lib/d3/package/mixins.rb +39 -0
- data/lib/d3/package/private_methods.rb +227 -0
- data/lib/d3/package/questions.rb +95 -0
- data/lib/d3/package/server_actions.rb +683 -0
- data/lib/d3/package/setters.rb +326 -0
- data/lib/d3/package/validate.rb +448 -0
- data/lib/d3/package.rb +51 -0
- data/lib/d3/puppytime/pending_puppy.rb +108 -0
- data/lib/d3/puppytime/puppy_queue.rb +274 -0
- data/lib/d3/puppytime.rb +68 -0
- data/lib/d3/state.rb +105 -0
- data/lib/d3/utility.rb +325 -0
- data/lib/d3/version.rb +1 -1
- metadata +162 -9
@@ -0,0 +1,326 @@
|
|
1
|
+
### Copyright 2016 Pixar
|
2
|
+
###
|
3
|
+
### Licensed under the Apache License, Version 2.0 (the "Apache License")
|
4
|
+
### with the following modification; you may not use this file except in
|
5
|
+
### compliance with the Apache License and the following modification to it:
|
6
|
+
### Section 6. Trademarks. is deleted and replaced with:
|
7
|
+
###
|
8
|
+
### 6. Trademarks. This License does not grant permission to use the trade
|
9
|
+
### names, trademarks, service marks, or product names of the Licensor
|
10
|
+
### and its affiliates, except as required to comply with Section 4(c) of
|
11
|
+
### the License and to reproduce the content of the NOTICE file.
|
12
|
+
###
|
13
|
+
### You may obtain a copy of the Apache License at
|
14
|
+
###
|
15
|
+
### http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
###
|
17
|
+
### Unless required by applicable law or agreed to in writing, software
|
18
|
+
### distributed under the Apache License with the above modification is
|
19
|
+
### distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
20
|
+
### KIND, either express or implied. See the Apache License for the specific
|
21
|
+
### language governing permissions and limitations under the Apache License.
|
22
|
+
###
|
23
|
+
###
|
24
|
+
|
25
|
+
|
26
|
+
module D3
|
27
|
+
class Package < JSS::Package
|
28
|
+
|
29
|
+
################# Public Instance Methods #################
|
30
|
+
|
31
|
+
### Set the login name of the admin who's doing something with this pkg
|
32
|
+
###
|
33
|
+
### @param new_val[String] the name of the admin
|
34
|
+
###
|
35
|
+
### @return [void]
|
36
|
+
###
|
37
|
+
def admin= (new_val = @admin)
|
38
|
+
return nil if new_val == @admin
|
39
|
+
raise "admin can't be empty!" if new_val.to_s == ''
|
40
|
+
@admin = new_val
|
41
|
+
end
|
42
|
+
|
43
|
+
### Set the basename of this package
|
44
|
+
###
|
45
|
+
### new_val = string
|
46
|
+
###
|
47
|
+
def basename= (new_val = @basename)
|
48
|
+
return nil if new_val == @basename
|
49
|
+
validate_edition "#{new_val}-#{@version}-#{@revision}"
|
50
|
+
@basename = new_val.to_s
|
51
|
+
@need_to_update_d3 = true unless @initializing
|
52
|
+
end
|
53
|
+
|
54
|
+
### Set the version of this package
|
55
|
+
###
|
56
|
+
### new_val = string
|
57
|
+
###
|
58
|
+
def version= (new_val = @version)
|
59
|
+
return nil if new_val == @version
|
60
|
+
new_val = validate_version new_val
|
61
|
+
validate_edition "#{basename}-#{new_val}-#{@revision}"
|
62
|
+
@version = new_val
|
63
|
+
@need_to_update_d3 = true unless @initializing
|
64
|
+
end
|
65
|
+
|
66
|
+
### Set the basename of this package
|
67
|
+
###
|
68
|
+
### new_val = string
|
69
|
+
###
|
70
|
+
def revision= (new_val = @revision)
|
71
|
+
return nil if new_val == @revision
|
72
|
+
new_val = validate_revision new_val
|
73
|
+
validate_edition "#{basename}-#{@version}-#{new_val}"
|
74
|
+
@revision = new_val
|
75
|
+
@need_to_update_d3 = true unless @initializing
|
76
|
+
end
|
77
|
+
|
78
|
+
### Set whether or not this package should uninstall other
|
79
|
+
### installed versions before installing itself. Otherwise,
|
80
|
+
### it'll just install itself over whatever's already there.
|
81
|
+
###
|
82
|
+
### @param new_val[Boolean] Should d3 uninstall other versions before installing self
|
83
|
+
###
|
84
|
+
### @return [void]
|
85
|
+
###
|
86
|
+
def remove_first= (new_val = @remove_first)
|
87
|
+
new_val ||= false # nil defaults to false
|
88
|
+
return new_val if new_val == @remove_first
|
89
|
+
@remove_first = validate_yes_no new_val
|
90
|
+
@need_to_update_d3 = true unless @initializing
|
91
|
+
end
|
92
|
+
|
93
|
+
### Set the expiration period for all installs of this pkg.
|
94
|
+
### Once installed, if this many days go by without
|
95
|
+
### the @expiration_path being launched, as noted by casper's the pkg
|
96
|
+
### will be silently uninstalled.
|
97
|
+
###
|
98
|
+
### Use nil, false, or 0 (the default) to prevent expiration.
|
99
|
+
###
|
100
|
+
### When expiration happens, a policy can be triggered to notify the user or
|
101
|
+
### take other actions. See {D3::Client#expiration_policy}
|
102
|
+
###
|
103
|
+
### Can be over-ridden on a per-install basis using the
|
104
|
+
### :expiration option with the {#install} method
|
105
|
+
###
|
106
|
+
### @param new_val[Integer] The number of days with no launch before expiring.
|
107
|
+
###
|
108
|
+
### @return [void]
|
109
|
+
###
|
110
|
+
def expiration= (new_val = @expiration)
|
111
|
+
return @expiration if new_val == @expiration
|
112
|
+
new_val ||= 0
|
113
|
+
@expiration = validate_expiration(new_val)
|
114
|
+
@need_to_update_d3 = true unless @initializing
|
115
|
+
end # expiration =
|
116
|
+
|
117
|
+
### Set the expiration path for this pkg.
|
118
|
+
### This is the path to the app that must be launched
|
119
|
+
### at least once every @expiration days to prevent
|
120
|
+
### silent un-installing of this package.
|
121
|
+
###
|
122
|
+
### This is the path as recorded in Casper's application usage logs.
|
123
|
+
### @example "/Applications/FileMaker Pro 11/FileMaker Pro.app"
|
124
|
+
###
|
125
|
+
### @param new_val[String] The path to the application
|
126
|
+
###
|
127
|
+
### @return [void]
|
128
|
+
###
|
129
|
+
def expiration_path= (new_val = @expiration_path)
|
130
|
+
return @expiration_path if new_val == @expiration_path
|
131
|
+
@expiration_path = validate_expiration_path (new_val)
|
132
|
+
@need_to_update_d3 = true unless @initializing
|
133
|
+
end # expiration =
|
134
|
+
|
135
|
+
### Set the prohibiting process for this installer.
|
136
|
+
###
|
137
|
+
### The value of this attribute is compared at install time to the lines output
|
138
|
+
### by the command 'ps -A -c -o comm' (case insensitive)
|
139
|
+
###
|
140
|
+
### If any line matches, an exception will be raised and the package will not be installed.
|
141
|
+
###
|
142
|
+
### @param new_val[String] the process name that will prohibit installation
|
143
|
+
###
|
144
|
+
### @return [void]
|
145
|
+
###
|
146
|
+
def prohibiting_process= (new_val = @prohibiting_process)
|
147
|
+
return @prohibiting_process if new_val == @prohibiting_process
|
148
|
+
@prohibiting_process = validate_prohibiting_process (new_val)
|
149
|
+
@need_to_update_d3 = true unless @initializing
|
150
|
+
end
|
151
|
+
|
152
|
+
### Set the automatic-install groups for this package.
|
153
|
+
### See also {#add_auto_group} and {#remove_auto_group}
|
154
|
+
###
|
155
|
+
### @param new_val [String,Array<String>] The group names as a comma-separated string or an array of strings
|
156
|
+
###
|
157
|
+
### @return [void]
|
158
|
+
###
|
159
|
+
def auto_groups= (new_val = @auto_groups)
|
160
|
+
@auto_groups ||= []
|
161
|
+
new_val ||= []
|
162
|
+
new_groups = validate_auto_groups (new_val)
|
163
|
+
validate_non_overlapping_groups new_groups, @excluded_groups
|
164
|
+
@auto_groups = new_groups
|
165
|
+
@need_to_update_d3 = true unless @initializing
|
166
|
+
end
|
167
|
+
|
168
|
+
### Add one or more groups the to list of auto_groups.
|
169
|
+
### The arg is a comma-separated string or an array of
|
170
|
+
### group names.
|
171
|
+
###
|
172
|
+
### @param groupnames[String, Array] the names of the groups to add
|
173
|
+
###
|
174
|
+
### @return [void]
|
175
|
+
###
|
176
|
+
def add_auto_groups (groupnames)
|
177
|
+
# are they real groups?
|
178
|
+
new_groups = validate_groups(groupnames)
|
179
|
+
# if they're already there, just return
|
180
|
+
return @auto_groups if (@auto_groups & new_groups) == new_groups
|
181
|
+
validate_non_overlapping_groups new_groups, @excluded_groups
|
182
|
+
@auto_groups += new_groups
|
183
|
+
@need_to_update_d3 = true unless @initializing
|
184
|
+
end
|
185
|
+
|
186
|
+
### Remove one or more groups the to list of auto_groups.
|
187
|
+
### The arg is a comma-separated string or an array of
|
188
|
+
### group names.
|
189
|
+
###
|
190
|
+
### @param groupnames[String, Array] the names of the groups to remove
|
191
|
+
###
|
192
|
+
### @return [void]
|
193
|
+
###
|
194
|
+
def remove_auto_groups (groupnames)
|
195
|
+
remove_groups = JSS.to_s_and_a(groupnames)[:arrayform]
|
196
|
+
@auto_groups -= remove_groups
|
197
|
+
@need_to_update_d3 = true unless @initializing
|
198
|
+
end
|
199
|
+
|
200
|
+
### Set the excluded groups for this package.
|
201
|
+
### See also {#add_excluded_group} and {#remove_excluded_group}
|
202
|
+
###
|
203
|
+
### @param new_val [String,Array<String>] The group names as a comma-separated string or an array of strings
|
204
|
+
###
|
205
|
+
### @return [void]
|
206
|
+
###
|
207
|
+
def excluded_groups= (new_val = @excluded_groups)
|
208
|
+
@excluded_groups ||= []
|
209
|
+
new_val ||= []
|
210
|
+
new_groups = validate_auto_groups (new_val)
|
211
|
+
validate_non_overlapping_groups @auto_groups, new_groups
|
212
|
+
@excluded_groups = new_groups
|
213
|
+
@need_to_update_d3 = true unless @initializing
|
214
|
+
end
|
215
|
+
|
216
|
+
### Add one or more groups the to list of excluded_groups.
|
217
|
+
### The arg is a comma-separated string or an array of
|
218
|
+
### group names.
|
219
|
+
###
|
220
|
+
### @param groupnames[String, Array] the names of the groups to add
|
221
|
+
###
|
222
|
+
### @return [void]
|
223
|
+
###
|
224
|
+
def add_excluded_groups (groupnames)
|
225
|
+
# are they real groups?
|
226
|
+
new_groups = validate_groups(groupnames)
|
227
|
+
# if they're already there, just return
|
228
|
+
return @excluded_groups if (@excluded_groups & new_groups) == new_groups
|
229
|
+
validate_non_overlapping_groups new_groups, @auto_groups
|
230
|
+
@excluded_groups += new_groups
|
231
|
+
@need_to_update_d3 = true unless @initializing
|
232
|
+
end
|
233
|
+
|
234
|
+
### Remove one or more groups the to list of excluded_groups.
|
235
|
+
### The arg is a comma-separated string or an array of
|
236
|
+
### group names.
|
237
|
+
###
|
238
|
+
### @param groupnames[String, Array] the names of the groups to remove
|
239
|
+
###
|
240
|
+
### @return [void]
|
241
|
+
###
|
242
|
+
def remove_excluded_groups (groupnames)
|
243
|
+
remove_groups = JSS.to_s_and_a(groupnames)[:arrayform]
|
244
|
+
@excluded_groups -= remove_groups
|
245
|
+
@need_to_update_d3 = true unless @initializing
|
246
|
+
end
|
247
|
+
|
248
|
+
### Set the pre_install_script for this package, either by name or JSS id,
|
249
|
+
### or a Path (String or Pathname) to a local file.
|
250
|
+
###
|
251
|
+
### The script must exist in the JSS or the local file must exist
|
252
|
+
###
|
253
|
+
### @param new_val[String,Integer] the path, name or id of the JSS::Script to use
|
254
|
+
###
|
255
|
+
### @return [void]
|
256
|
+
###
|
257
|
+
def pre_install= (new_val = @pre_install_script_id)
|
258
|
+
name_or_path = validate_pre_install_script(new_val)
|
259
|
+
if name_or_path.is_a?(Pathname)
|
260
|
+
@pre_install_script_id = new_script script_type: :pre_install, source: name_or_path
|
261
|
+
else
|
262
|
+
@pre_install_script_id = JSS::Script.map_all_ids_to(:name).invert[name_or_path]
|
263
|
+
end
|
264
|
+
@need_to_update_d3 = true unless @initializing
|
265
|
+
end
|
266
|
+
|
267
|
+
### Set the post_install_script for this package, either by name or JSS id,
|
268
|
+
### or a Path (String or Pathname) to a local file.
|
269
|
+
###
|
270
|
+
### The script must exist in the JSS or the local file must exist
|
271
|
+
###
|
272
|
+
### @param new_val[String,Integer] the name or id of the JSS::Script to use
|
273
|
+
###
|
274
|
+
### @return [void]
|
275
|
+
###
|
276
|
+
def post_install= (new_val = @post_install_script_id)
|
277
|
+
name_or_path = validate_post_install_script(new_val)
|
278
|
+
if name_or_path.is_a?(Pathname)
|
279
|
+
@post_install_script_id = new_script script_type: :post_install, source: name_or_path
|
280
|
+
else
|
281
|
+
@post_install_script_id = JSS::Script.map_all_ids_to(:name).invert[name_or_path]
|
282
|
+
end
|
283
|
+
@need_to_update_d3 = true unless @initializing
|
284
|
+
end
|
285
|
+
|
286
|
+
### Set the pre_remove_script for this package, either by name or JSS id,
|
287
|
+
### or a Path (String or Pathname) to a local file.
|
288
|
+
###
|
289
|
+
### The script must exist in the JSS or the local file must exist
|
290
|
+
###
|
291
|
+
### @param new_val[String,Integer] the name or id of the JSS::Script to use
|
292
|
+
###
|
293
|
+
### @return [void]
|
294
|
+
###
|
295
|
+
def pre_remove= (new_val = @pre_remove_script_id)
|
296
|
+
name_or_path = validate_pre_remove_script(new_val)
|
297
|
+
if name_or_path.is_a?(Pathname)
|
298
|
+
@pre_remove_script_id = new_script script_type: :pre_remove, source: name_or_path
|
299
|
+
else
|
300
|
+
@pre_remove_script_id = JSS::Script.map_all_ids_to(:name).invert[name_or_path]
|
301
|
+
end
|
302
|
+
@need_to_update_d3 = true unless @initializing
|
303
|
+
end
|
304
|
+
|
305
|
+
### Set the post_remove_script for this package, either by name or JSS id,
|
306
|
+
### or a Path (String or Pathname) to a local file.
|
307
|
+
###
|
308
|
+
### The script must exist in the JSS or the local file must exist
|
309
|
+
###
|
310
|
+
### @param new_val[String,Integer] the name or id of the JSS::Script to use
|
311
|
+
###
|
312
|
+
### @return [void]
|
313
|
+
###
|
314
|
+
def post_remove= (new_val = @post_remove_script_id)
|
315
|
+
name_or_path = validate_post_remove_script(new_val)
|
316
|
+
if name_or_path.is_a?(Pathname)
|
317
|
+
@post_remove_script_id = new_script script_type: :post_remove, source: name_or_path
|
318
|
+
else
|
319
|
+
@post_remove_script_id = JSS::Script.map_all_ids_to(:name).invert[name_or_path]
|
320
|
+
end
|
321
|
+
@need_to_update_d3 = true unless @initializing
|
322
|
+
end
|
323
|
+
|
324
|
+
|
325
|
+
end # class Package
|
326
|
+
end # module D3
|