vagrant-clone 0.0.1 → 0.0.3

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.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/.rakeTasks +7 -0
  3. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. data/.idea/misc.xml +4 -0
  5. data/.idea/modules.xml +8 -0
  6. data/.idea/runConfigurations/clone.xml +21 -0
  7. data/.idea/runConfigurations/libvirt.xml +21 -0
  8. data/.idea/vagrant-clone.iml +114 -0
  9. data/.idea/vcs.xml +6 -0
  10. data/.idea/workspace.xml +948 -0
  11. data/Gemfile +9 -3
  12. data/Gemfile.lock +123 -37
  13. data/Rakefile +2 -1
  14. data/Vagrantfile +9 -0
  15. data/cookbooks/apt/CHANGELOG.md +321 -0
  16. data/cookbooks/apt/CONTRIBUTING.md +2 -0
  17. data/cookbooks/apt/MAINTAINERS.md +15 -0
  18. data/cookbooks/apt/README.md +250 -0
  19. data/cookbooks/apt/attributes/default.rb +57 -0
  20. data/cookbooks/apt/files/15update-stamp +1 -0
  21. data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
  22. data/cookbooks/apt/libraries/helpers.rb +49 -0
  23. data/cookbooks/apt/libraries/matchers.rb +16 -0
  24. data/cookbooks/apt/metadata.json +1 -0
  25. data/cookbooks/apt/recipes/cacher-client.rb +52 -0
  26. data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
  27. data/cookbooks/apt/recipes/default.rb +93 -0
  28. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  29. data/cookbooks/apt/resources/preference.rb +90 -0
  30. data/cookbooks/apt/templates/01proxy.erb +11 -0
  31. data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
  32. data/cookbooks/apt/templates/10recommends.erb +3 -0
  33. data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
  34. data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
  35. data/cookbooks/apt/templates/acng.conf.erb +275 -0
  36. data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
  37. data/cookbooks/build-essential/.foodcritic +1 -0
  38. data/cookbooks/build-essential/CHANGELOG.md +257 -0
  39. data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
  40. data/cookbooks/build-essential/MAINTAINERS.md +15 -0
  41. data/cookbooks/build-essential/README.md +134 -0
  42. data/cookbooks/build-essential/attributes/default.rb +21 -0
  43. data/cookbooks/build-essential/libraries/matchers.rb +9 -0
  44. data/cookbooks/build-essential/metadata.json +1 -0
  45. data/cookbooks/build-essential/recipes/_windows.rb +53 -0
  46. data/cookbooks/build-essential/recipes/default.rb +24 -0
  47. data/cookbooks/build-essential/resources/build_essential.rb +106 -0
  48. data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
  49. data/cookbooks/compat_resource/CHANGELOG.md +53 -0
  50. data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
  51. data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
  52. data/cookbooks/compat_resource/README.md +60 -0
  53. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
  54. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
  55. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
  56. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
  57. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
  58. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
  59. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
  60. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
  61. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
  62. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
  63. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
  64. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
  65. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
  66. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
  67. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
  68. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
  69. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
  70. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
  71. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
  72. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
  73. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
  74. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
  75. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
  76. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
  77. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
  78. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
  79. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
  80. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
  81. data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
  82. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
  83. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
  84. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
  85. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
  86. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
  87. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
  88. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
  89. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
  90. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
  91. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
  92. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
  93. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
  94. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
  95. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
  96. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
  97. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
  98. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
  99. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
  100. data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
  101. data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
  102. data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
  103. data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
  104. data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
  105. data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
  106. data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
  107. data/cookbooks/compat_resource/metadata.json +1 -0
  108. data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
  109. data/cookbooks/inifile_chef_gem/README.md +46 -0
  110. data/cookbooks/inifile_chef_gem/metadata.json +51 -0
  111. data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
  112. data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
  113. data/cookbooks/mariadb/CHANGELOG.md +332 -0
  114. data/cookbooks/mariadb/README.md +225 -0
  115. data/cookbooks/mariadb/attributes/default.rb +199 -0
  116. data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
  117. data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
  118. data/cookbooks/mariadb/libraries/matchers.rb +21 -0
  119. data/cookbooks/mariadb/metadata.json +1 -0
  120. data/cookbooks/mariadb/providers/configuration.rb +39 -0
  121. data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
  122. data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
  123. data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
  124. data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
  125. data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
  126. data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
  127. data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
  128. data/cookbooks/mariadb/recipes/client.rb +47 -0
  129. data/cookbooks/mariadb/recipes/config.rb +115 -0
  130. data/cookbooks/mariadb/recipes/default.rb +46 -0
  131. data/cookbooks/mariadb/recipes/devel.rb +41 -0
  132. data/cookbooks/mariadb/recipes/galera.rb +324 -0
  133. data/cookbooks/mariadb/recipes/plugins.rb +3 -0
  134. data/cookbooks/mariadb/recipes/repository.rb +45 -0
  135. data/cookbooks/mariadb/recipes/server.rb +157 -0
  136. data/cookbooks/mariadb/resources/configuration.rb +13 -0
  137. data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
  138. data/cookbooks/mariadb/resources/replication.rb +192 -0
  139. data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
  140. data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
  141. data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
  142. data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
  143. data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
  144. data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
  145. data/cookbooks/mingw/.foodcritic +1 -0
  146. data/cookbooks/mingw/CHANGELOG.md +50 -0
  147. data/cookbooks/mingw/CONTRIBUTING.md +2 -0
  148. data/cookbooks/mingw/MAINTAINERS.md +14 -0
  149. data/cookbooks/mingw/README.md +133 -0
  150. data/cookbooks/mingw/files/default/bash.bat +17 -0
  151. data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
  152. data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
  153. data/cookbooks/mingw/files/default/pthread.h +719 -0
  154. data/cookbooks/mingw/files/default/time.h +297 -0
  155. data/cookbooks/mingw/libraries/_helper.rb +38 -0
  156. data/cookbooks/mingw/metadata.json +1 -0
  157. data/cookbooks/mingw/recipes/default.rb +19 -0
  158. data/cookbooks/mingw/resources/get.rb +56 -0
  159. data/cookbooks/mingw/resources/msys2_package.rb +139 -0
  160. data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
  161. data/cookbooks/ohai/.foodcritic +2 -0
  162. data/cookbooks/ohai/CHANGELOG.md +166 -0
  163. data/cookbooks/ohai/CONTRIBUTING.md +2 -0
  164. data/cookbooks/ohai/MAINTAINERS.md +15 -0
  165. data/cookbooks/ohai/README.md +134 -0
  166. data/cookbooks/ohai/libraries/matchers.rb +41 -0
  167. data/cookbooks/ohai/metadata.json +1 -0
  168. data/cookbooks/ohai/recipes/default.rb +20 -0
  169. data/cookbooks/ohai/resources/hint.rb +55 -0
  170. data/cookbooks/ohai/resources/plugin.rb +117 -0
  171. data/cookbooks/selinux_policy/.gitignore +51 -0
  172. data/cookbooks/selinux_policy/.kitchen.yml +25 -0
  173. data/cookbooks/selinux_policy/.rubocop.yml +2 -0
  174. data/cookbooks/selinux_policy/.travis.yml +26 -0
  175. data/cookbooks/selinux_policy/Berksfile +8 -0
  176. data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
  177. data/cookbooks/selinux_policy/LICENSE +13 -0
  178. data/cookbooks/selinux_policy/README.md +217 -0
  179. data/cookbooks/selinux_policy/Rakefile +68 -0
  180. data/cookbooks/selinux_policy/TESTING.md +2 -0
  181. data/cookbooks/selinux_policy/Thorfile +12 -0
  182. data/cookbooks/selinux_policy/attributes/default.rb +5 -0
  183. data/cookbooks/selinux_policy/chefignore +102 -0
  184. data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
  185. data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
  186. data/cookbooks/selinux_policy/metadata.json +58 -0
  187. data/cookbooks/selinux_policy/metadata.rb +20 -0
  188. data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
  189. data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
  190. data/cookbooks/selinux_policy/providers/module.rb +81 -0
  191. data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
  192. data/cookbooks/selinux_policy/providers/port.rb +58 -0
  193. data/cookbooks/selinux_policy/recipes/default.rb +9 -0
  194. data/cookbooks/selinux_policy/recipes/install.rb +32 -0
  195. data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
  196. data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
  197. data/cookbooks/selinux_policy/resources/module.rb +21 -0
  198. data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
  199. data/cookbooks/selinux_policy/resources/port.rb +9 -0
  200. data/cookbooks/seven_zip/CHANGELOG.md +30 -0
  201. data/cookbooks/seven_zip/README.md +108 -0
  202. data/cookbooks/seven_zip/attributes/default.rb +31 -0
  203. data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
  204. data/cookbooks/seven_zip/metadata.json +1 -0
  205. data/cookbooks/seven_zip/providers/archive.rb +68 -0
  206. data/cookbooks/seven_zip/recipes/default.rb +41 -0
  207. data/cookbooks/seven_zip/resources/archive.rb +29 -0
  208. data/cookbooks/windows/.foodcritic +2 -0
  209. data/cookbooks/windows/CHANGELOG.md +528 -0
  210. data/cookbooks/windows/CONTRIBUTING.md +2 -0
  211. data/cookbooks/windows/MAINTAINERS.md +21 -0
  212. data/cookbooks/windows/README.md +803 -0
  213. data/cookbooks/windows/attributes/default.rb +21 -0
  214. data/cookbooks/windows/files/dism_features.rb +45 -0
  215. data/cookbooks/windows/libraries/matchers.rb +586 -0
  216. data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
  217. data/cookbooks/windows/libraries/registry_helper.rb +356 -0
  218. data/cookbooks/windows/libraries/version.rb +207 -0
  219. data/cookbooks/windows/libraries/version_helper.rb +79 -0
  220. data/cookbooks/windows/libraries/windows_helper.rb +174 -0
  221. data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
  222. data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
  223. data/cookbooks/windows/metadata.json +1 -0
  224. data/cookbooks/windows/recipes/default.rb +21 -0
  225. data/cookbooks/windows/resources/auto_run.rb +46 -0
  226. data/cookbooks/windows/resources/certificate.rb +166 -0
  227. data/cookbooks/windows/resources/certificate_binding.rb +128 -0
  228. data/cookbooks/windows/resources/feature.rb +82 -0
  229. data/cookbooks/windows/resources/feature_dism.rb +108 -0
  230. data/cookbooks/windows/resources/feature_powershell.rb +70 -0
  231. data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
  232. data/cookbooks/windows/resources/font.rb +80 -0
  233. data/cookbooks/windows/resources/http_acl.rb +110 -0
  234. data/cookbooks/windows/resources/pagefile.rb +152 -0
  235. data/cookbooks/windows/resources/path.rb +54 -0
  236. data/cookbooks/windows/resources/printer.rb +103 -0
  237. data/cookbooks/windows/resources/printer_port.rb +101 -0
  238. data/cookbooks/windows/resources/share.rb +291 -0
  239. data/cookbooks/windows/resources/shortcut.rb +53 -0
  240. data/cookbooks/windows/resources/task.rb +384 -0
  241. data/cookbooks/windows/resources/zipfile.rb +125 -0
  242. data/cookbooks/yum/.foodcritic +1 -0
  243. data/cookbooks/yum/CHANGELOG.md +351 -0
  244. data/cookbooks/yum/CONTRIBUTING.md +2 -0
  245. data/cookbooks/yum/MAINTAINERS.md +16 -0
  246. data/cookbooks/yum/README.md +125 -0
  247. data/cookbooks/yum/attributes/main.rb +103 -0
  248. data/cookbooks/yum/libraries/matchers.rb +9 -0
  249. data/cookbooks/yum/metadata.json +1 -0
  250. data/cookbooks/yum/recipes/default.rb +26 -0
  251. data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
  252. data/cookbooks/yum/resources/globalconfig.rb +119 -0
  253. data/cookbooks/yum/templates/.DS_Store +0 -0
  254. data/cookbooks/yum/templates/main.erb +276 -0
  255. data/cookbooks/yum-epel/CHANGELOG.md +138 -0
  256. data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
  257. data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
  258. data/cookbooks/yum-epel/README.md +172 -0
  259. data/cookbooks/yum-epel/attributes/default.rb +8 -0
  260. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
  261. data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
  262. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
  263. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
  264. data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
  265. data/cookbooks/yum-epel/attributes/epel.rb +21 -0
  266. data/cookbooks/yum-epel/metadata.json +1 -0
  267. data/cookbooks/yum-epel/recipes/default.rb +27 -0
  268. data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
  269. data/cookbooks/yum-scl/.kitchen.yml +24 -0
  270. data/cookbooks/yum-scl/.rubocop.yml +6 -0
  271. data/cookbooks/yum-scl/.travis.yml +28 -0
  272. data/cookbooks/yum-scl/Berksfile +3 -0
  273. data/cookbooks/yum-scl/Berksfile.lock +25 -0
  274. data/cookbooks/yum-scl/CHANGELOG.md +11 -0
  275. data/cookbooks/yum-scl/Gemfile +46 -0
  276. data/cookbooks/yum-scl/README.md +76 -0
  277. data/cookbooks/yum-scl/attributes/centos.rb +83 -0
  278. data/cookbooks/yum-scl/attributes/default.rb +15 -0
  279. data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
  280. data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
  281. data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
  282. data/cookbooks/yum-scl/metadata.json +42 -0
  283. data/cookbooks/yum-scl/metadata.rb +12 -0
  284. data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
  285. data/cookbooks/yum-scl/recipes/default.rb +17 -0
  286. data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
  287. data/lib/vagrant-clone/command/clone.rb +66 -61
  288. data/lib/vagrant-clone/errors.rb +61 -0
  289. data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
  290. data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
  291. data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
  292. data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
  293. data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
  294. data/lib/vagrant-clone/version.rb +2 -2
  295. data/lib/vagrant-clone.rb +6 -6
  296. data/libvirt.txt +7 -0
  297. data/performance_testing.rb +165 -0
  298. data/results.txt +45 -0
  299. data/scripts/create_box.sh +134 -0
  300. data/test.rb +92 -0
  301. data/tools/create_box.sh +130 -0
  302. data/vagrant-clone.gemspec +7 -7
  303. metadata +296 -5
  304. data/lib/vagrant-clone/command/errors.rb +0 -16
  305. data/lib/vagrant-clone/command/provider/docker.rb +0 -13
  306. data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,297 @@
1
+ /*
2
+ * time.h
3
+ *
4
+ * Type definitions and function declarations relating to date and time.
5
+ *
6
+ * $Id: time.h,v ffe8d63c87e3 2015/05/18 12:49:39 keithmarshall $
7
+ *
8
+ * Written by Rob Savoye <rob@cygnus.com>
9
+ * Copyright (C) 1997-2007, 2011, 2015, MinGW.org Project.
10
+ *
11
+ *
12
+ * Permission is hereby granted, free of charge, to any person obtaining a
13
+ * copy of this software and associated documentation files (the "Software"),
14
+ * to deal in the Software without restriction, including without limitation
15
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
+ * and/or sell copies of the Software, and to permit persons to whom the
17
+ * Software is furnished to do so, subject to the following conditions:
18
+ *
19
+ * The above copyright notice, this permission notice, and the following
20
+ * disclaimer shall be included in all copies or substantial portions of
21
+ * the Software.
22
+ *
23
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
29
+ * DEALINGS IN THE SOFTWARE.
30
+ *
31
+ */
32
+ #ifndef _TIME_H
33
+ #define _TIME_H
34
+
35
+ /* All the headers include this file. */
36
+ #include <_mingw.h>
37
+
38
+ /* Number of clock ticks per second. A clock tick is the unit by which
39
+ * processor time is measured and is returned by 'clock'.
40
+ */
41
+ #define CLOCKS_PER_SEC ((clock_t)(1000))
42
+ #define CLK_TCK CLOCKS_PER_SEC
43
+
44
+ #ifndef RC_INVOKED
45
+ /*
46
+ * Some elements declared in time.h may also be required by other
47
+ * header files, without necessarily including time.h itself; such
48
+ * elements are declared in the local parts/time.h system header file.
49
+ * Declarations for such elements must be selected prior to inclusion:
50
+ */
51
+ #define __need_time_t
52
+ #define __need_struct_timespec
53
+ #include <parts/time.h>
54
+
55
+ /* time.h is also required to duplicate the following type definitions,
56
+ * which are nominally defined in stddef.h
57
+ */
58
+ #define __need_NULL
59
+ #define __need_wchar_t
60
+ #define __need_size_t
61
+ #include <stddef.h>
62
+
63
+ /* A type for measuring processor time in clock ticks; (no need to
64
+ * guard this, since it isn't defined elsewhere).
65
+ */
66
+ typedef long clock_t;
67
+
68
+ #ifndef _TM_DEFINED
69
+ /*
70
+ * A structure for storing all kinds of useful information about the
71
+ * current (or another) time.
72
+ */
73
+ struct tm
74
+ {
75
+ int tm_sec; /* Seconds: 0-59 (K&R says 0-61?) */
76
+ int tm_min; /* Minutes: 0-59 */
77
+ int tm_hour; /* Hours since midnight: 0-23 */
78
+ int tm_mday; /* Day of the month: 1-31 */
79
+ int tm_mon; /* Months *since* january: 0-11 */
80
+ int tm_year; /* Years since 1900 */
81
+ int tm_wday; /* Days since Sunday (0-6) */
82
+ int tm_yday; /* Days since Jan. 1: 0-365 */
83
+ int tm_isdst; /* +1 Daylight Savings Time, 0 No DST,
84
+ * -1 don't know */
85
+ };
86
+ #define _TM_DEFINED
87
+ #endif
88
+
89
+ _BEGIN_C_DECLS
90
+
91
+ _CRTIMP clock_t __cdecl __MINGW_NOTHROW clock (void);
92
+ #if __MSVCRT_VERSION__ < 0x0800
93
+ _CRTIMP time_t __cdecl __MINGW_NOTHROW time (time_t*);
94
+ _CRTIMP double __cdecl __MINGW_NOTHROW difftime (time_t, time_t);
95
+ _CRTIMP time_t __cdecl __MINGW_NOTHROW mktime (struct tm*);
96
+ #endif
97
+
98
+ /*
99
+ * These functions write to and return pointers to static buffers that may
100
+ * be overwritten by other function calls. Yikes!
101
+ *
102
+ * NOTE: localtime, and perhaps the others of the four functions grouped
103
+ * below may return NULL if their argument is not 'acceptable'. Also note
104
+ * that calling asctime with a NULL pointer will produce an Invalid Page
105
+ * Fault and crap out your program. Guess how I know. Hint: stat called on
106
+ * a directory gives 'invalid' times in st_atime etc...
107
+ */
108
+ _CRTIMP char* __cdecl __MINGW_NOTHROW asctime (const struct tm*);
109
+ #if __MSVCRT_VERSION__ < 0x0800
110
+ _CRTIMP char* __cdecl __MINGW_NOTHROW ctime (const time_t*);
111
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t*);
112
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t*);
113
+ #endif
114
+
115
+ _CRTIMP size_t __cdecl __MINGW_NOTHROW strftime (char*, size_t, const char*, const struct tm*);
116
+
117
+ #ifndef __STRICT_ANSI__
118
+
119
+ extern _CRTIMP void __cdecl __MINGW_NOTHROW _tzset (void);
120
+
121
+ #ifndef _NO_OLDNAMES
122
+ extern _CRTIMP void __cdecl __MINGW_NOTHROW tzset (void);
123
+ #endif
124
+
125
+ _CRTIMP char* __cdecl __MINGW_NOTHROW _strdate(char*);
126
+ _CRTIMP char* __cdecl __MINGW_NOTHROW _strtime(char*);
127
+
128
+ /* These require newer versions of msvcrt.dll (6.10 or higher). */
129
+ #if __MSVCRT_VERSION__ >= 0x0601
130
+ _CRTIMP __time64_t __cdecl __MINGW_NOTHROW _time64( __time64_t*);
131
+ _CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mktime64 (struct tm*);
132
+ _CRTIMP char* __cdecl __MINGW_NOTHROW _ctime64 (const __time64_t*);
133
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime64 (const __time64_t*);
134
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime64 (const __time64_t*);
135
+ #endif /* __MSVCRT_VERSION__ >= 0x0601 */
136
+
137
+ /* These require newer versions of msvcrt.dll (8.00 or higher). */
138
+ #if __MSVCRT_VERSION__ >= 0x0800
139
+ _CRTIMP __time32_t __cdecl __MINGW_NOTHROW _time32 (__time32_t*);
140
+ _CRTIMP double __cdecl __MINGW_NOTHROW _difftime32 (__time32_t, __time32_t);
141
+ _CRTIMP double __cdecl __MINGW_NOTHROW _difftime64 (__time64_t, __time64_t);
142
+ _CRTIMP __time32_t __cdecl __MINGW_NOTHROW _mktime32 (struct tm*);
143
+ _CRTIMP __time32_t __cdecl __MINGW_NOTHROW _mkgmtime32 (struct tm*);
144
+ _CRTIMP __time64_t __cdecl __MINGW_NOTHROW _mkgmtime64 (struct tm*);
145
+ _CRTIMP char* __cdecl __MINGW_NOTHROW _ctime32 (const __time32_t*);
146
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW _gmtime32 (const __time32_t*);
147
+ _CRTIMP struct tm* __cdecl __MINGW_NOTHROW _localtime32 (const __time32_t*);
148
+ #ifndef _USE_32BIT_TIME_T
149
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time64 (_v)); }
150
+ _CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime64 (_v1,_v2)); }
151
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime64 (_v)); }
152
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime64 (_v)); }
153
+ _CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime64 (_v)); }
154
+ _CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime64 (_v)); }
155
+ _CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime64 (_v)); }
156
+ #else
157
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW time (time_t* _v) { return(_time32 (_v)); }
158
+ _CRTALIAS double __cdecl __MINGW_NOTHROW difftime (time_t _v1, time_t _v2) { return(_difftime32 (_v1,_v2)); }
159
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW mktime (struct tm* _v) { return(_mktime32 (_v)); }
160
+ _CRTALIAS time_t __cdecl __MINGW_NOTHROW _mkgmtime (struct tm* _v) { return(_mkgmtime32 (_v)); }
161
+ _CRTALIAS char* __cdecl __MINGW_NOTHROW ctime (const time_t* _v) { return(_ctime32 (_v)); }
162
+ _CRTALIAS struct tm* __cdecl __MINGW_NOTHROW gmtime (const time_t* _v) { return(_gmtime32 (_v)); }
163
+ _CRTALIAS struct tm* __cdecl __MINGW_NOTHROW localtime (const time_t* _v) { return(_localtime32 (_v)); }
164
+ #endif /* !_USE_32BIT_TIME_T */
165
+ #endif /* __MSVCRT_VERSION__ >= 0x0800 */
166
+
167
+ /* _daylight: non zero if daylight savings time is used.
168
+ * _timezone: difference in seconds between GMT and local time.
169
+ * _tzname: standard/daylight savings time zone names (an array with two
170
+ * elements).
171
+ */
172
+ #ifdef __MSVCRT__
173
+
174
+ /* These are for compatibility with pre-VC 5.0 suppied MSVCRT. */
175
+ extern _CRTIMP int* __cdecl __MINGW_NOTHROW __p__daylight (void);
176
+ extern _CRTIMP long* __cdecl __MINGW_NOTHROW __p__timezone (void);
177
+ extern _CRTIMP char** __cdecl __MINGW_NOTHROW __p__tzname (void);
178
+
179
+ __MINGW_IMPORT int _daylight;
180
+ __MINGW_IMPORT long _timezone;
181
+ __MINGW_IMPORT char *_tzname[2];
182
+
183
+ #else /* not __MSVCRT (ie. crtdll) */
184
+
185
+ #ifndef __DECLSPEC_SUPPORTED
186
+
187
+ extern int* _imp___daylight_dll;
188
+ extern long* _imp___timezone_dll;
189
+ extern char** _imp___tzname;
190
+
191
+ #define _daylight (*_imp___daylight_dll)
192
+ #define _timezone (*_imp___timezone_dll)
193
+ #define _tzname (*_imp___tzname)
194
+
195
+ #else /* __DECLSPEC_SUPPORTED */
196
+
197
+ __MINGW_IMPORT int _daylight_dll;
198
+ __MINGW_IMPORT long _timezone_dll;
199
+ __MINGW_IMPORT char* _tzname[2];
200
+
201
+ #define _daylight _daylight_dll
202
+ #define _timezone _timezone_dll
203
+
204
+ #endif /* __DECLSPEC_SUPPORTED */
205
+ #endif /* ! __MSVCRT__ */
206
+ #endif /* ! __STRICT_ANSI__ */
207
+
208
+ #ifndef _NO_OLDNAMES
209
+ #ifdef __MSVCRT__
210
+
211
+ /* These go in the oldnames import library for MSVCRT.
212
+ */
213
+ __MINGW_IMPORT int daylight;
214
+ __MINGW_IMPORT long timezone;
215
+ __MINGW_IMPORT char *tzname[2];
216
+
217
+ #else /* ! __MSVCRT__ */
218
+ /*
219
+ * CRTDLL is royally messed up when it comes to these macros.
220
+ * TODO: import and alias these via oldnames import library instead
221
+ * of macros.
222
+ */
223
+ #define daylight _daylight
224
+ /*
225
+ * NOTE: timezone not defined as a macro because it would conflict with
226
+ * struct timezone in sys/time.h. Also, tzname used to a be macro, but
227
+ * now it's in moldname.
228
+ */
229
+ __MINGW_IMPORT char *tzname[2];
230
+
231
+ #endif /* ! __MSVCRT__ */
232
+ #endif /* ! _NO_OLDNAMES */
233
+
234
+ #ifndef _WTIME_DEFINED
235
+ /* wide function prototypes, also declared in wchar.h */
236
+ #ifndef __STRICT_ANSI__
237
+ #ifdef __MSVCRT__
238
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wasctime(const struct tm*);
239
+ #if __MSVCRT_VERSION__ < 0x0800
240
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime(const time_t*);
241
+ #endif
242
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrdate(wchar_t*);
243
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wstrtime(wchar_t*);
244
+ #if __MSVCRT_VERSION__ >= 0x0601
245
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime64 (const __time64_t*);
246
+ #endif
247
+ #if __MSVCRT_VERSION__ >= 0x0800
248
+ _CRTIMP wchar_t* __cdecl __MINGW_NOTHROW _wctime32 (const __time32_t*);
249
+ #ifndef _USE_32BIT_TIME_T
250
+ _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime64 (_v)); }
251
+ #else
252
+ _CRTALIAS wchar_t* __cdecl __MINGW_NOTHROW _wctime (const time_t* _v) { return(_wctime32 (_v)); }
253
+ #endif
254
+ #endif /* __MSVCRT_VERSION__ >= 0x0800 */
255
+ #endif /* __MSVCRT__ */
256
+ #endif /* __STRICT_ANSI__ */
257
+ _CRTIMP size_t __cdecl __MINGW_NOTHROW wcsftime (wchar_t*, size_t, const wchar_t*, const struct tm*);
258
+ #define _WTIME_DEFINED
259
+ #endif /* _WTIME_DEFINED */
260
+
261
+ _END_C_DECLS
262
+
263
+ /* -------------------------------------------------------------------
264
+ * CHEF PATCHES
265
+ *
266
+ * PROVIDE clock_gettime ETC. IN time.h FOR POSIX COMPLIANCE.
267
+ *
268
+ * This code was copied from the 64-bit TDM gcc compiler headers. It
269
+ * is here to allow certain libraries (like libxslt) to compile
270
+ * because they assume that they are only going to be built on a POSIX
271
+ * system. The C99 standards do not require that these functions be
272
+ * available but most POSIX systems provide them unless strict x-play
273
+ * compatibility is requested.
274
+ *
275
+ * On windows, configure could possibly identify that these functions
276
+ * are unavailable but since it tests for function availability to
277
+ * attempting to link a binary with said functions, these tests
278
+ * succeed with our TDM mingw runtime (because we indeed support these
279
+ * posix compatibility methods). Hence we pretend like we are a POSIX
280
+ * compliant system and export these methods.
281
+ */
282
+
283
+ /* POSIX 2008 says clock_gettime and timespec are defined in time.h header,
284
+ but other systems - like Linux, Solaris, etc - tend to declare such
285
+ recent extensions only if the following guards are met. */
286
+ #if !defined(IN_WINPTHREAD) && \
287
+ ((!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
288
+ (_POSIX_C_SOURCE > 2) || defined(__EXTENSIONS__))
289
+ #include <pthread_time.h>
290
+ #endif
291
+
292
+ /* END OF CHEF PATCHES
293
+ * -------------------------------------------------------------------
294
+ */
295
+
296
+ #endif /* ! RC_INVOKED */
297
+ #endif /* ! _TIME_H: $RCSfile: time.h,v $: end of file */
@@ -0,0 +1,38 @@
1
+ #
2
+ # Cookbook:: mingw
3
+ # Library:: _helper
4
+ #
5
+ # Copyright:: 2016, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ module Mingw
21
+ module Helper
22
+ def win_friendly_path(path)
23
+ path.gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR || '\\') if path
24
+ end
25
+
26
+ def archive_name(source)
27
+ url = ::URI.parse(source)
28
+ ::File.basename(::URI.unescape(url.path))
29
+ end
30
+
31
+ def tar_name(source)
32
+ aname = archive_name(source)
33
+ ::File.basename(aname, ::File.extname(aname))
34
+ end
35
+ end
36
+ end
37
+
38
+ Chef::Resource.send(:include, Mingw::Helper)
@@ -0,0 +1 @@
1
+ {"name":"mingw","version":"2.0.1","description":"Installs a mingw/msys based toolchain on windows","long_description":"# mingw Cookbook\n\n[![Cookbook Version](http://img.shields.io/cookbook/v/mingw.svg)][cookbook] [![Build Status](http://img.shields.io/travis/chef-cookbooks/mingw.svg?branch=master)][travis]\n\nInstalls a mingw/msys based compiler tools chain on windows. This is required for compiling C software from source.\n\n## Requirements\n\n### Platforms\n\n- Windows\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- seven_zip\n\n## Usage\n\nAdd this cookbook as a dependency to your cookbook in its `metadata.rb` and include the default recipe in one of your recipes.\n\n```ruby\n# metadata.rb\ndepends 'mingw'\n```\n\n```ruby\n# your recipe.rb\ninclude_recipe 'mingw::default'\n```\n\nUse the `msys2_package` resource in any recipe to fetch msys2 based packages. Use the `mingw_get` resource in any recipe to fetch mingw packages. Use the `mingw_tdm_gcc` resource to fetch a version of the TDM GCC compiler.\n\nBy default, you should prefer the msys2 packages as they are newer and better supported. C/C++ compilers on windows use various different exception formats and you need to pick the right one for your task. In the 32-bit world, you have SJLJ (set-jump/long-jump) based exception handling and DWARF-2 (shortened to DW2) based exception handling. SJLJ produces code that can happily throw exceptions across stack frames of code compiled by MSVC. DW2 involves more extensive metadata but produces code that cannot unwind MSVC generated stack-frames - hence you need to ensure that you don't have any code that throws across a \"system call\". Certain languages and runtimes have specific requirements as to the exception format supported. As an example, if you are building code for Rust, you will probably need a modern gcc from msys2 with DW2 support as that's what the panic/exception formatter in Rust depends on. In a 64-bit world, you may still use SJLJ but compilers all commonly support SEH (structured exception handling).\n\nOf course, to further complicate matters, different versions of different compilers support different exception handling. The default compilers that come with mingw_get are 32-bit only compilers and support DW2\\. The TDM compilers come in 3 flavors: a 32-bit only version with SJLJ support, a 32-bit only version with DW2 support and a \"multilib\" compiler which supports only SJLJ in 32-bit mode but can produce 64-bit SEH code. The standard library support varies drastically between these various compiler flavors (even within the same version). In msys2, you can install a mingw-w64 based compilers for either 32-bit DW2 support or 64-bit SEH support. If all this hurts your brain, I can only apologize.\n\n## Resources\n\n### msys2_package\n\n- ':install' - Installs an msys2 package using pacman.\n- ':remove' - Uninstalls any existing msys2 package.\n- ':upgrade' - Upgrades the specified package using pacman.\n\nAll options also automatically attempt to install a 64-bit based msys2 base file system at the root path specified. Note that you probably won't need a \"32-bit\" msys2 unless you are actually on a 32-bit only platform. You can still install both 32 and 64-bit compilers and libraries in a 64-bit msys2 base file system.\n\n#### Parameters\n\n- `package` - An msys2 pacman package (or meta-package) to fetch and install. You may use a legal package wild-card pattern here if you are installing. This is the name attribute.\n- `root` - The root directory where msys2 tools will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.\n\n#### Examples\n\nTo get the core msys2 developer tools in `C:\\msys2`\n\n```ruby\nmsys2_package 'base-devel' do\n root 'C:\\msys2'\nend\n```\n\n### mingw_get\n\n#### Actions\n\n- `:install` - Installs a mingw package from sourceforge using mingw-get.exe.\n- `:remove` - Uninstalls a mingw package.\n- `:upgrade` - Upgrades a mingw package (even to a lower version).\n\n#### Parameters\n\n- `package` - A mingw-get package (or meta-package) to fetch and install. You may use a legal package wild-card pattern here if you are installing. This is the name attribute.\n- `root` - The root directory where msys and mingw tools will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.\n\n#### Examples\n\nTo get the core msys developer tools in `C:\\mingw32`\n\n```ruby\nmingw_get 'msys-base=2013072300-msys-bin.meta' do\n root 'C:\\mingw32'\nend\n```\n\n### mingw_tdm_gcc\n\n#### Actions\n\n- `:install` - Installs the TDM compiler toolchain at the given path. This only gives you a compiler. If you need any support tooling such as make/grep/awk/bash etc., see `mingw_get`.\n\n#### Parameters\n\n- `flavor` - Either `:sjlj_32` or `:seh_sjlj_64`. TDM-64 is a 32/64-bit multi-lib \"cross-compiler\" toolchain that builds 64-bit by default. It uses structured exception handling (SEH) in 64-bit code and setjump-longjump exception handling (SJLJ) in 32-bit code. TDM-32 only builds 32-bit binaries and uses SJLJ.\n- `root` - The root directory where compiler tools and runtime will be installed. This directory must not contain any spaces in order to pacify old posix tools and most Makefiles.\n- `version` - The version of the compiler to fetch and install. This is the name attribute. Currently, '5.1.0' is supported.\n\n#### Examples\n\nTo get the 32-bit TDM GCC compiler in `C:\\mingw32`\n\n```ruby\nmingw_tdm_gcc '5.1.0' do\n flavor :sjlj_32\n root 'C:\\mingw32'\nend\n```\n\n## License & Authors\n\n**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))\n\n**Copyright:** 2009-2016, Chef Software, Inc.\n\n```\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n[cookbook]: https://supermarket.chef.io/cookbooks/mingw\n[travis]: http://travis-ci.org/chef-cookbooks/mingw\n","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{"seven_zip":">= 0.0.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/mingw","issues_url":"https://github.com/chef-cookbooks/mingw/issues","chef_version":[[">= 12.5"]],"ohai_version":[]}
@@ -0,0 +1,19 @@
1
+ #
2
+ # Cookbook:: mingw
3
+ # Recipe:: default
4
+ #
5
+ # Copyright:: 2016, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ include_recipe 'seven_zip::default'
@@ -0,0 +1,56 @@
1
+ #
2
+ # Cookbook:: mingw
3
+ # Resource:: get
4
+ #
5
+ # Copyright:: 2016, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ # Installs the core msys utilities needed for mingw/git/any other posix
21
+ # based toolchain at a desired location using mingw-get.exe.
22
+
23
+ property :package, kind_of: String, name_property: true
24
+ property :root, kind_of: String, required: true
25
+
26
+ resource_name :mingw_get
27
+
28
+ action_class do
29
+ def mingw_do_action(action_cmd)
30
+ seven_zip_archive "fetching mingw-get to #{win_friendly_path(root)}" do
31
+ source 'http://iweb.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip'
32
+ path root
33
+ checksum '2e0e9688d42adc68c5611759947e064156e169ff871816cae52d33ee0655826d'
34
+ not_if do
35
+ ::File.exist?(::File.join(root, 'bin/mingw-get.exe'))
36
+ end
37
+ end
38
+
39
+ execute "performing #{action_cmd} for #{package}" do
40
+ command ".\\bin\\mingw-get.exe -v #{action_cmd} #{package}"
41
+ cwd root
42
+ end
43
+ end
44
+ end
45
+
46
+ action :install do
47
+ mingw_do_action('install')
48
+ end
49
+
50
+ action :upgrade do
51
+ mingw_do_action('upgrade')
52
+ end
53
+
54
+ action :remove do
55
+ mingw_do_action('remove')
56
+ end
@@ -0,0 +1,139 @@
1
+ #
2
+ # Cookbook:: mingw
3
+ # Resource:: msys2_package
4
+ #
5
+ # Copyright:: 2016, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ # Installs msys2 base system and installs/upgrades packages within in.
21
+ #
22
+ # Where's the version flag? Where's idempotence you say? Well f*** you
23
+ # for trying to version your product. This is arch. They live on the edge.
24
+ # You never get anything but the latest version. And if that's broken...
25
+ # well that's your problem isn't it? And they don't believe in preserving
26
+ # older versions. Good luck!
27
+
28
+ property :package, kind_of: String, name_property: true
29
+ property :root, kind_of: String, required: true
30
+
31
+ resource_name :msys2_package
32
+
33
+ action_class do
34
+ #
35
+ # Runs a command through a bash login shell made by our shim .bat file.
36
+ # The bash.bat file defaults %HOME% to #{root}/home/%USERNAME% and requests
37
+ # that the command be run in the current working directory.
38
+ #
39
+ def msys2_exec(comment, cmd)
40
+ f_root = win_friendly_path(root)
41
+ execute comment do
42
+ command ".\\bin\\bash.bat -c '#{cmd}'"
43
+ cwd f_root
44
+ live_stream true
45
+ environment('MSYSTEM' => 'MSYS')
46
+ end
47
+ end
48
+
49
+ def msys2_init
50
+ cache_dir = ::File.join(root, '.cache')
51
+ f_cache_dir = win_friendly_path(cache_dir)
52
+ base_url = 'http://downloads.sourceforge.net/project/msys2/Base/x86_64/msys2-base-x86_64-20160205.tar.xz'
53
+ base_checksum = '7e97e2af042e1b6f62cf0298fe84839014ef3d4a3e7825cffc6931c66cc0fc20'
54
+
55
+ unless ::File.exist?(::File.join(root, 'msys2.exe'))
56
+ seven_zip_archive "cache msys2 base to #{f_cache_dir}" do
57
+ source base_url
58
+ path f_cache_dir
59
+ checksum base_checksum
60
+ overwrite true
61
+ end
62
+
63
+ seven_zip_archive "extract msys2 base archive to #{f_cache_dir}" do
64
+ source "#{f_cache_dir}\\#{tar_name(base_url)}"
65
+ path f_cache_dir
66
+ overwrite true
67
+ end
68
+
69
+ ruby_block 'copy msys2 base files to root' do
70
+ block do
71
+ # Oh my god msys2 and pacman are picky as hell when it comes to
72
+ # updating core files. They use the mtime on certain files to
73
+ # determine if they need to updated or not and simply skip various
74
+ # steps otherwise.
75
+ ::FileUtils.cp_r(::Dir.glob("#{cache_dir}/msys64/*"), root, preserve: true)
76
+ end
77
+ end
78
+ end
79
+
80
+ pacman_key_dir = ::File.join(root, 'etc/pacman.d/gnupg')
81
+ bin_dir = ::File.join(root, 'bin')
82
+
83
+ directory win_friendly_path(bin_dir)
84
+
85
+ cookbook_file win_friendly_path("#{bin_dir}/bash.bat") do
86
+ source 'bash.bat'
87
+ cookbook 'mingw'
88
+ end
89
+
90
+ cookbook_file win_friendly_path(::File.join(root, 'custom-upgrade.sh')) do
91
+ source 'custom-upgrade.sh'
92
+ cookbook 'mingw'
93
+ end
94
+
95
+ cookbook_file win_friendly_path(::File.join(root, 'etc/profile.d/custom_prefix.sh')) do
96
+ source 'custom_prefix.sh'
97
+ cookbook 'mingw'
98
+ end
99
+
100
+ # $HOME is using files from /etc/skel. The home-directory creation step
101
+ # will automatically be performed if other users log in - so if you wish
102
+ # to globally modify user first time setup, edit /etc/skel or add
103
+ # "post-setup" steps to /etc/post-install/
104
+ # The first-time init shell must be restarted and cannot be reused.
105
+ msys2_exec('msys2 first time init', 'exit') unless ::File.exist?(pacman_key_dir)
106
+
107
+ # Update pacman and msys base packages.
108
+ if ::File.exist?(::File.join(root, 'usr/bin/update-core')) || !::File.exist?(::File.join(root, 'custom-upgrade.sh'))
109
+ msys2_exec('upgrade msys2 core', '/custom-upgrade.sh')
110
+ msys2_exec('upgrade msys2 core: part 2', 'pacman -Suu --noconfirm')
111
+ # Now we can actually upgrade everything ever.
112
+ msys2_exec('upgrade entire msys2 system: 1', 'pacman -Syuu --noconfirm')
113
+ # Might need to do it once more to pick up a few stragglers.
114
+ msys2_exec('upgrade entire msys2 system: 2', 'pacman -Syuu --noconfirm')
115
+ end
116
+ end
117
+
118
+ def msys2_do_action(comment, action_cmd)
119
+ msys2_init
120
+ msys2_exec(comment, action_cmd)
121
+ end
122
+ end
123
+
124
+ action :install do
125
+ msys2_do_action("installing #{package}", "pacman -S --needed --noconfirm #{package}")
126
+ end
127
+
128
+ # Package name is ignored. This is arch. Why would you ever upgrade a single
129
+ # package and its deps? That'll just break everything else that ever depended
130
+ # on a different version of that dep. Because arch is wonderful like that.
131
+ # So you only get the choice to move everything to latest or not... it's the
132
+ # most agile development possible!
133
+ action :upgrade do
134
+ msys2_do_action("upgrading #{package}", "pacman -Syu --noconfirm #{package}")
135
+ end
136
+
137
+ action :remove do
138
+ msys2_do_action("removing #{package}", "pacman -R --noconfirm #{package}")
139
+ end
@@ -0,0 +1,114 @@
1
+ #
2
+ # Cookbook:: mingw
3
+ # Resource:: tdm_gcc
4
+ #
5
+ # Copyright:: 2016, Chef Software, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+
20
+ # Installs a gcc based C/C++ compiler and runtime from TDM GCC.
21
+
22
+ property :flavor, kind_of: Symbol, is: [:sjlj_32, :seh_sjlj_64], default: :seh_sjlj_64
23
+ property :root, kind_of: String, required: true
24
+ property :version, kind_of: String, is: ['5.1.0'], name_property: true
25
+
26
+ resource_name :mingw_tdm_gcc
27
+
28
+ tdm_gcc_64 = {
29
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm64-1/gcc-5.1.0-tdm64-1-core.tar.lzma' =>
30
+ '29393aac890847089ad1e93f81a28f6744b1609c00b25afca818f3903e42e4bd',
31
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/MinGW-w64%20runtime/GCC%205%20series/mingw64runtime-v4-git20150618-gcc5-tdm64-1.tar.lzma' =>
32
+ '29186e0bb36824b10026d78bdcf238d631d8fc1d90718d2ebbd9ec239b6f94dd',
33
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/GNU%20binutils/binutils-2.25-tdm64-1.tar.lzma' =>
34
+ '4722bb7b4d46cef714234109e25e5d1cfd29f4e53365b6d615c8a00735f60e40',
35
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm64-1/gcc-5.1.0-tdm64-1-c%2B%2B.tar.lzma' =>
36
+ '17fd497318d1ac187a113e8665330d746ad9607a0406ab2374db0d8e6f4094d1',
37
+ }
38
+
39
+ tdm_gcc_32 = {
40
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm-1%20SJLJ/gcc-5.1.0-tdm-1-core.tar.lzma' =>
41
+ '9199e6ecbce956ff4704b52098beb38e313176ace610285fb93758a08752870e',
42
+ 'http://iweb.dl.sourceforge.net/project/tdm-gcc/TDM-GCC%205%20series/5.1.0-tdm-1%20SJLJ/gcc-5.1.0-tdm-1-c%2B%2B.tar.lzma' =>
43
+ '19fe46819ce43531d066b438479300027bbf06da57e8a10be5100466f80c28fc',
44
+ }
45
+
46
+ action :install do
47
+ cache_dir = ::File.join(root, '.cache')
48
+ f_root = win_friendly_path(root)
49
+
50
+ if flavor == :sjlj_32
51
+ [
52
+ 'binutils-bin=2.25.1',
53
+ 'libintl-dll=0.18.3.2',
54
+ 'mingwrt-dll=3.21.1',
55
+ 'mingwrt-dev=3.21.1',
56
+ 'w32api-dev=3.17',
57
+ ].each do |package_fragment|
58
+ mingw_get "install #{package_fragment} at #{f_root}" do
59
+ package "mingw32-#{package_fragment}-*"
60
+ root new_resource.root
61
+ end
62
+ end
63
+ end
64
+
65
+ to_fetch =
66
+ case flavor
67
+ when :sjlj_32
68
+ tdm_gcc_32
69
+ when :seh_sjlj_64
70
+ tdm_gcc_64
71
+ else
72
+ raise "Unknown flavor: #{flavor}"
73
+ end
74
+
75
+ to_fetch.each do |url, hash|
76
+ seven_zip_archive "cache #{archive_name(url)} to #{win_friendly_path(cache_dir)}" do
77
+ source url
78
+ path cache_dir
79
+ checksum hash
80
+ overwrite true
81
+ end
82
+
83
+ seven_zip_archive "extract #{tar_name(url)} to #{f_root}" do
84
+ source ::File.join(cache_dir, tar_name(url))
85
+ path root
86
+ overwrite true
87
+ end
88
+ end
89
+
90
+ # Patch time.h headers for compatibility with winpthreads.
91
+ # These patches were made for binutils 2.25.1 for 32-bit TDM GCC only.
92
+ if flavor == :sjlj_32
93
+ include_dir = win_friendly_path(::File.join(root, 'include'))
94
+ cookbook_file "#{include_dir}\\pthread.h" do
95
+ cookbook 'mingw'
96
+ source 'pthread.h'
97
+ end
98
+
99
+ cookbook_file "#{include_dir}\\time.h" do
100
+ cookbook 'mingw'
101
+ source 'time.h'
102
+ end
103
+ end
104
+ end
105
+
106
+ def archive_name(source)
107
+ url = ::URI.parse(source)
108
+ ::File.basename(::URI.unescape(url.path))
109
+ end
110
+
111
+ def tar_name(source)
112
+ aname = archive_name(source)
113
+ ::File.basename(aname, ::File.extname(aname))
114
+ end
@@ -0,0 +1,2 @@
1
+ ~FC016
2
+ ~FC009