madscience 0.0.23 → 0.0.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2af86267f08358e003483cda806437e2d886ca3f
4
- data.tar.gz: 9c24e86c35334f75721f2f89c6d5640a65f31ca4
3
+ metadata.gz: 4df0d9249b04bbfb7808f867235ad6e2263a122c
4
+ data.tar.gz: 75679d7d7916ea23947c5797d95f1fe998581825
5
5
  SHA512:
6
- metadata.gz: d02ca39b5ac6d0037be453593cca37895348e24a7d2b78b16830a791f8c3c4fe704969224421f3e3315af75b570bdd92c4423079d4ba757bb59ba1b47f669416
7
- data.tar.gz: 46e4f4a565c01fa4a72f4b3cbff253c676bac4051ad341d69ea27a74e96b19daa59630e78e55bd4319db2c0c13f033466d56fc00da51dc8636f3c4d6483b0275
6
+ metadata.gz: 5e9828bbbebc878f53215599c4c29a014a4c59f6c3e6caa16d1202bff0931573001ff1b91898a90dc66046e30450f1a44e316ee4f23ced6b8c9fdc61105bb504
7
+ data.tar.gz: 1543bfa1892f9f9e76fc027c357a104b269bc685e95ef9b83a1f9b476765ed0a5dfeb324cc7798fa6c450f00c92020f1ac57c7444c79627748469650e7b9802d
@@ -0,0 +1,246 @@
1
+ #!/bin/bash
2
+ # $Id: VirtualBox_Uninstall.tool 89624 2013-10-07 16:13:23Z bird $
3
+ ## @file
4
+ # VirtualBox Uninstaller Script.
5
+ #
6
+
7
+ #
8
+ # Copyright (C) 2007-2013 Oracle Corporation
9
+ #
10
+ # This file is part of VirtualBox Open Source Edition (OSE), as
11
+ # available from http://www.virtualbox.org. This file is free software;
12
+ # you can redistribute it and/or modify it under the terms of the GNU
13
+ # General Public License (GPL) as published by the Free Software
14
+ # Foundation, in version 2 as it comes in the "COPYING" file of the
15
+ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
+ # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
+ #
18
+
19
+ # Override any funny stuff from the user.
20
+ export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
21
+
22
+ #
23
+ # Display a simple welcome message first.
24
+ #
25
+ echo ""
26
+ echo "Welcome to the VirtualBox uninstaller script."
27
+ echo ""
28
+
29
+ #
30
+ # Check for arguments and display
31
+ #
32
+ my_default_prompt=0
33
+ if test "$#" != "0"; then
34
+ if test "$#" != "1" -o "$1" != "--unattended"; then
35
+ echo "Error: Unknown argument(s): $*"
36
+ echo ""
37
+ echo "Usage: uninstall.sh [--unattended]"
38
+ echo ""
39
+ echo "If the '--unattended' option is not given, you will be prompted"
40
+ echo "for a Yes/No before doing the actual uninstallation."
41
+ echo ""
42
+ exit 4;
43
+ fi
44
+ my_default_prompt="Yes"
45
+ fi
46
+
47
+ #
48
+ # Collect directories and files to remove.
49
+ # Note: Do NOT attempt adding directories or filenames with spaces!
50
+ #
51
+ declare -a my_directories
52
+ declare -a my_files
53
+
54
+ # Users files first
55
+ test -f "${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist" && my_files+=("${HOME}/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist")
56
+
57
+ test -d /Library/StartupItems/VirtualBox/ && my_directories+=("/Library/StartupItems/VirtualBox/")
58
+ test -d /Library/Receipts/VBoxStartupItems.pkg/ && my_directories+=("/Library/Receipts/VBoxStartupItems.pkg/")
59
+
60
+ test -d "/Library/Application Support/VirtualBox/LaunchDaemons/" && my_directories+=("/Library/Application Support/VirtualBox/LaunchDaemons/")
61
+ test -d "/Library/Application Support/VirtualBox/VBoxDrv.kext/" && my_directories+=("/Library/Application Support/VirtualBox/VBoxDrv.kext/")
62
+ test -d "/Library/Application Support/VirtualBox/VBoxUSB.kext/" && my_directories+=("/Library/Application Support/VirtualBox/VBoxUSB.kext/")
63
+ test -d "/Library/Application Support/VirtualBox/VBoxNetFlt.kext/" && my_directories+=("/Library/Application Support/VirtualBox/VBoxNetFlt.kext/")
64
+ test -d "/Library/Application Support/VirtualBox/VBoxNetAdp.kext/" && my_directories+=("/Library/Application Support/VirtualBox/VBoxNetAdp.kext/")
65
+ # Pre 4.3.0rc1 locations:
66
+ test -d /Library/Extensions/VBoxDrv.kext/ && my_directories+=("/Library/Extensions/VBoxDrv.kext/")
67
+ test -d /Library/Extensions/VBoxUSB.kext/ && my_directories+=("/Library/Extensions/VBoxUSB.kext/")
68
+ test -d /Library/Extensions/VBoxNetFlt.kext/ && my_directories+=("/Library/Extensions/VBoxNetFlt.kext/")
69
+ test -d /Library/Extensions/VBoxNetAdp.kext/ && my_directories+=("/Library/Extensions/VBoxNetAdp.kext/")
70
+ # Tiger support is obsolete, but we leave it here for a clean removing of older
71
+ # VirtualBox versions
72
+ test -d /Library/Extensions/VBoxDrvTiger.kext/ && my_directories+=("/Library/Extensions/VBoxDrvTiger.kext/")
73
+ test -d /Library/Extensions/VBoxUSBTiger.kext/ && my_directories+=("/Library/Extensions/VBoxUSBTiger.kext/")
74
+ test -d /Library/Receipts/VBoxKEXTs.pkg/ && my_directories+=("/Library/Receipts/VBoxKEXTs.pkg/")
75
+
76
+ test -f /usr/bin/VirtualBox && my_files+=("/usr/bin/VirtualBox")
77
+ test -f /usr/bin/VBoxManage && my_files+=("/usr/bin/VBoxManage")
78
+ test -f /usr/bin/VBoxVRDP && my_files+=("/usr/bin/VBoxVRDP")
79
+ test -f /usr/bin/VBoxHeadless && my_files+=("/usr/bin/VBoxHeadless")
80
+ test -f /usr/bin/vboxwebsrv && my_files+=("/usr/bin/vboxwebsrv")
81
+ test -f /usr/bin/VBoxBalloonCtrl && my_files+=("/usr/bin/VBoxBalloonCtrl")
82
+ test -f /usr/bin/VBoxAutostart && my_files+=("/usr/bin/VBoxAutostart")
83
+ test -f /usr/bin/vbox-img && my_files+=("/usr/bin/vbox-img")
84
+ test -d /Library/Receipts/VirtualBoxCLI.pkg/ && my_directories+=("/Library/Receipts/VirtualBoxCLI.pkg/")
85
+ test -f /Library/LaunchDaemons/org.virtualbox.startup.plist && my_files+=("/Library/LaunchDaemons/org.virtualbox.startup.plist")
86
+
87
+ test -d /Applications/VirtualBox.app/ && my_directories+=("/Applications/VirtualBox.app/")
88
+ test -d /Library/Receipts/VirtualBox.pkg/ && my_directories+=("/Library/Receipts/VirtualBox.pkg/")
89
+
90
+ # legacy
91
+ test -d /Library/Receipts/VBoxDrv.pkg/ && my_directories+=("/Library/Receipts/VBoxDrv.pkg/")
92
+ test -d /Library/Receipts/VBoxUSB.pkg/ && my_directories+=("/Library/Receipts/VBoxUSB.pkg/")
93
+
94
+ # python stuff
95
+ python_versions="2.3 2.5 2.6 2.7"
96
+ for p in $python_versions; do
97
+ test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py && my_files+=("/Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.py")
98
+ test -f /Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc && my_files+=("/Library/Python/$p/site-packages/vboxapi/VirtualBox_constants.pyc")
99
+ test -f /Library/Python/$p/site-packages/vboxapi/__init__.py && my_files+=("/Library/Python/$p/site-packages/vboxapi/__init__.py")
100
+ test -f /Library/Python/$p/site-packages/vboxapi/__init__.pyc && my_files+=("/Library/Python/$p/site-packages/vboxapi/__init__.pyc")
101
+ test -f /Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info && my_files+=("/Library/Python/$p/site-packages/vboxapi-1.0-py$p.egg-info")
102
+ test -d /Library/Python/$p/site-packages/vboxapi/ && my_directories+=("/Library/Python/$p/site-packages/vboxapi/")
103
+ done
104
+
105
+ #
106
+ # Collect KEXTs to remove.
107
+ # Note that the unload order is significant.
108
+ #
109
+ declare -a my_kexts
110
+ for kext in org.virtualbox.kext.VBoxUSB org.virtualbox.kext.VBoxNetFlt org.virtualbox.kext.VBoxNetAdp org.virtualbox.kext.VBoxDrv; do
111
+ if /usr/sbin/kextstat -b $kext -l | grep -q $kext; then
112
+ my_kexts+=("$kext")
113
+ fi
114
+ done
115
+
116
+ #
117
+ # Collect packages to forget
118
+ #
119
+ my_pb='org\.virtualbox\.pkg\.'
120
+ my_pkgs=`/usr/sbin/pkgutil --pkgs="${my_pb}vboxkexts|${my_pb}vboxstartupitems|${my_pb}virtualbox|${my_pb}virtualboxcli"`
121
+
122
+ #
123
+ # Did we find anything to uninstall?
124
+ #
125
+ if test -z "${my_directories[*]}" -a -z "${my_files[*]}" -a -z "${my_kexts[*]}" -a -z "$my_pkgs"; then
126
+ echo "No VirtualBox files, directories, KEXTs or packages to uninstall."
127
+ echo "Done."
128
+ exit 0;
129
+ fi
130
+
131
+ #
132
+ # Look for running VirtualBox processes and warn the user
133
+ # if something is running. Since deleting the files of
134
+ # running processes isn't fatal as such, we will leave it
135
+ # to the user to choose whether to continue or not.
136
+ #
137
+ # Note! comm isn't supported on Tiger, so we make -c to do the stripping.
138
+ #
139
+ my_processes="`ps -axco 'pid uid command' | grep -wEe '(VirtualBox|VirtualBoxVM|VBoxManage|VBoxHeadless|vboxwebsrv|VBoxXPCOMIPCD|VBoxSVC|VBoxNetDHCP|VBoxNetNAT)' | grep -vw grep | grep -vw VirtualBox_Uninstall.tool | tr '\n' '\a'`";
140
+ if test -n "$my_processes"; then
141
+ echo 'Warning! Found the following active VirtualBox processes:'
142
+ echo "$my_processes" | tr '\a' '\n'
143
+ echo ""
144
+ echo "We recommend that you quit all VirtualBox processes before"
145
+ echo "uninstalling the product."
146
+ echo ""
147
+ if test "$my_default_prompt" != "Yes"; then
148
+ echo "Do you wish to continue none the less (Yes/No)?"
149
+ read my_answer
150
+ if test "$my_answer" != "Yes" -a "$my_answer" != "YES" -a "$my_answer" != "yes"; then
151
+ echo "Aborting uninstall. (answer: '$my_answer')".
152
+ exit 2;
153
+ fi
154
+ echo ""
155
+ my_answer=""
156
+ fi
157
+ fi
158
+
159
+ #
160
+ # Display the files and directories that will be removed
161
+ # and get the user's consent before continuing.
162
+ #
163
+ if test -n "${my_files[*]}" -o -n "${my_directories[*]}"; then
164
+ echo "The following files and directories (bundles) will be removed:"
165
+ for file in "${my_files[@]}"; do echo " $file"; done
166
+ for dir in "${my_directories[@]}"; do echo " $dir"; done
167
+ echo ""
168
+ fi
169
+ if test -n "${my_kexts[*]}"; then
170
+ echo "And the following KEXTs will be unloaded:"
171
+ for kext in "${my_kexts[@]}"; do echo " $kext"; done
172
+ echo ""
173
+ fi
174
+ if test -n "$my_pkgs"; then
175
+ echo "And the traces of following packages will be removed:"
176
+ for kext in $my_pkgs; do echo " $kext"; done
177
+ echo ""
178
+ fi
179
+
180
+ if test "$my_default_prompt" != "Yes"; then
181
+ echo "Do you wish to uninstall VirtualBox (Yes/No)?"
182
+ read my_answer
183
+ if test "$my_answer" != "Yes" -a "$my_answer" != "YES" -a "$my_answer" != "yes"; then
184
+ echo "Aborting uninstall. (answer: '$my_answer')".
185
+ exit 2;
186
+ fi
187
+ echo ""
188
+ fi
189
+
190
+ #
191
+ # Unregister has to be done before the files are removed.
192
+ #
193
+ LSREGISTER=/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
194
+ if [ -e ${LSREGISTER} ]; then
195
+ ${LSREGISTER} -u /Applications/VirtualBox.app > /dev/null
196
+ ${LSREGISTER} -u /Applications/VirtualBox.app/Contents/Resources/vmstarter.app > /dev/null
197
+ fi
198
+
199
+ #
200
+ # Display the sudo usage instructions and execute the command.
201
+ #
202
+ echo "The uninstallation processes requires administrative privileges"
203
+ echo "because some of the installed files cannot be removed by a normal"
204
+ echo "user. You may be prompted for your password now..."
205
+ echo ""
206
+
207
+ if test -n "${my_files[*]}" -o -n "${my_directories[*]}"; then
208
+ /usr/bin/sudo -p "Please enter %u's password:" /bin/rm -Rf "${my_files[@]}" "${my_directories[@]}"
209
+ my_rc=$?
210
+ if test "$my_rc" -ne 0; then
211
+ echo "An error occurred durning 'sudo rm', there should be a message above. (rc=$my_rc)"
212
+ test -x /usr/bin/sudo || echo "warning: Cannot find /usr/bin/sudo or it's not an executable."
213
+ test -x /bin/rm || echo "warning: Cannot find /bin/rm or it's not an executable"
214
+ echo ""
215
+ echo "The uninstall failed. Please retry."
216
+ exit 1;
217
+ fi
218
+ fi
219
+
220
+ my_rc=0
221
+ for kext in "${my_kexts[@]}"; do
222
+ echo unloading $kext
223
+ /usr/bin/sudo -p "Please enter %u's password (unloading $kext):" /sbin/kextunload -m $kext
224
+ my_rc2=$?
225
+ if test "$my_rc2" -ne 0; then
226
+ echo "An error occurred durning 'sudo /sbin/kextunload -m $kext', there should be a message above. (rc=$my_rc2)"
227
+ test -x /usr/bin/sudo || echo "warning: Cannot find /usr/bin/sudo or it's not an executable."
228
+ test -x /sbin/kextunload || echo "warning: Cannot find /sbin/kextunload or it's not an executable"
229
+ my_rc=$my_rc2
230
+ fi
231
+ done
232
+ if test "$my_rc" -eq 0; then
233
+ echo "Successfully unloaded VirtualBox kernel extensions."
234
+ else
235
+ echo "Failed to unload one or more KEXTs, please reboot the machine to complete the uninstall."
236
+ exit 1;
237
+ fi
238
+
239
+ # Cleaning up pkgutil database
240
+ for my_pkg in $my_pkgs; do
241
+ /usr/bin/sudo -p "Please enter %u's password (removing $my_pkg):" /usr/sbin/pkgutil --forget "$my_pkg"
242
+ done
243
+
244
+ echo "Done."
245
+ exit 0;
246
+
data/bin/madscience CHANGED
@@ -12,6 +12,8 @@ if ARGV == [ "--version" ]
12
12
  exit 0
13
13
  end
14
14
 
15
+ puts "Running madscience #{MadScience::VERSION}..."
16
+
15
17
  # TODO: Add Windows runas incantation to replace sudo on Windows
16
18
  USAGE_INFO = <<USAGE
17
19
  Usage:
@@ -89,12 +91,19 @@ def do_clone
89
91
  unless system "git clone #{MADSCIENCE_REPO_URL} madscience"
90
92
  raise "Couldn't successfully clone MadScience repo from #{MADSCIENCE_REPO_URL}!"
91
93
  end
94
+ File.open(File.join("madscience", ".cloned_by"), "w") do |f|
95
+ f.puts <<-CLONED_BY
96
+ MadScience gem version #{MadScience::VERSION}
97
+ bin: #{__FILE__}
98
+ libdir: #{MadScience::VERSION_LIBDIR}
99
+ CLONED_BY
100
+ end
92
101
  end
93
102
 
94
103
  def do_deploy
95
104
  # Deploy from the 'madscience' dir under this directory
96
105
 
97
- cmd = "cd madscience && vagrant up --provision --provider=#{MADSCIENCE_PROVIDER}"
106
+ cmd = "cd madscience && bundle && vagrant up --provision --provider=#{MADSCIENCE_PROVIDER}"
98
107
 
99
108
  # Does this display STDOUT properly?
100
109
  pid = Kernel.spawn cmd
@@ -1,3 +1,4 @@
1
1
  module MadScience
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
+ VERSION_LIBDIR = File.dirname(__FILE__)
3
4
  end
data/uninstall.sh CHANGED
@@ -2,5 +2,6 @@
2
2
  sudo rm -rf /usr/bin/vagrant /opt/vagrant /Applications/Vagrant
3
3
  sudo pkgutil --forget com.vagrant.vagrant
4
4
 
5
- # And this is a reminder to uninstall VirtualBox
6
- echo Also: Download VirtualBox, mount the DMG and there will be a bash script called VirtualBox_Uninstall.tool
5
+ # And this should uninstall VirtualBox. Script copied from
6
+ # VirtualBox DMG uninstaller.
7
+ ./VirtualBox_Uninstall.tool --unattended
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madscience
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Gibbs
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
@@ -140,14 +140,14 @@ dependencies:
140
140
  name: rake
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
145
  version: '10.3'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ~>
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '10.3'
153
153
  description: |
@@ -161,8 +161,8 @@ executables:
161
161
  extensions: []
162
162
  extra_rdoc_files: []
163
163
  files:
164
- - .gitignore
165
- - .madscience_gem_location
164
+ - ".gitignore"
165
+ - ".madscience_gem_location"
166
166
  - Cheffile
167
167
  - Cheffile.lock
168
168
  - Gemfile
@@ -170,6 +170,7 @@ files:
170
170
  - README.md
171
171
  - Rakefile
172
172
  - TODO
173
+ - VirtualBox_Uninstall.tool
173
174
  - bin/madscience
174
175
  - cookbooks/apt/CHANGELOG.md
175
176
  - cookbooks/apt/README.md
@@ -332,17 +333,17 @@ require_paths:
332
333
  - lib
333
334
  required_ruby_version: !ruby/object:Gem::Requirement
334
335
  requirements:
335
- - - '>='
336
+ - - ">="
336
337
  - !ruby/object:Gem::Version
337
338
  version: '0'
338
339
  required_rubygems_version: !ruby/object:Gem::Requirement
339
340
  requirements:
340
- - - '>='
341
+ - - ">="
341
342
  - !ruby/object:Gem::Version
342
343
  version: '0'
343
344
  requirements: []
344
345
  rubyforge_project:
345
- rubygems_version: 2.2.0
346
+ rubygems_version: 2.4.5
346
347
  signing_key:
347
348
  specification_version: 4
348
349
  summary: Install the current versions of the MadScience stack.