9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/beaker/host/windows/pkg.rb', line 9
def install_package name
cygwin = ""
rootdir = ""
result = exec(Beaker::Command.new("wmic os get osarchitecture | grep 32"), :acceptable_exit_codes => (0...127))
if result.exit_code == 0 rootdir = "c:\\\\cygwin"
cygwin = "setup-x86.exe"
else rootdir = "c:\\\\cygwin64"
cygwin = "setup-x86_64.exe"
end
if not check_for_package(cygwin)
execute("curl --retry 5 http://cygwin.com/#{cygwin} -o /cygdrive/c/Windows/System32/#{cygwin}")
end
execute("#{cygwin} -q -n -N -d -R #{rootdir} -s http://cygwin.osuosl.org -P #{name}")
end
|