vagrant-solaris10 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acaa4a259cb62bd1806944ccec51abd888d612d7
4
- data.tar.gz: 79359dc8c309ecc7f613e408afff8c83c7e370be
3
+ metadata.gz: a6bb4a7981dd542e30b7121550d1e24f0f008216
4
+ data.tar.gz: 7dc353140a37270bb448800ee6b77f25031ea34b
5
5
  SHA512:
6
- metadata.gz: f4d9059c3df7f71d858a74cc7349bf807a8872b6fb7b6aa36f7c234f4dee7048ed80d61c56007c040e357c78c401ab2d8d9df8f9af45ee99704b59ec52f69752
7
- data.tar.gz: e185e6f52b392d73e8ca30ac63d37a4044eaf0ae44ffc9c442be3c39b67d5d8c29900d2ac72376e778b724317a28bf36dc4cde486d9a7283f13dfbd1df77795a
6
+ metadata.gz: a59512d0bb3150998bb9b50f1e5ca12f0ed62189736053bda7aad64af7805e98720799a9487fbd548297d474d99372a5135c2f6c7cf8c384d568bc25de761b38
7
+ data.tar.gz: c913e18ef822e8259e79524e77086512ad9b7aed820e0a74b15bcae5f85c3f662bc83e5dc9b2dd1888442245ebb095bd62b56ed36ef0316a6db9dcb75e5605f7
data/README.md CHANGED
@@ -21,6 +21,12 @@ Install via Vagrant
21
21
  $ vagrant plugin install vagrant-solaris10
22
22
  ```
23
23
 
24
+ To install from source code, first build via `rake` and then:
25
+
26
+ ```zsh
27
+ $ vagrant plugin install pkg/vagrant-solaris10-x.x.x.gem
28
+ ```
29
+
24
30
  ## Contributing
25
31
 
26
32
  1. Fork it ( https://github.com/tnarik/vagrant-solaris10/fork )
@@ -9,7 +9,7 @@ module Vagrant
9
9
 
10
10
  # Only do this if the hostname is not already set
11
11
  machine.communicate.tap do |comm|
12
- if !comm.test("#{machine.config.solaris.suexec_cmd} hostname | grep '#{name}")
12
+ if !comm.test("hostname | grep '#{name}", sudo: true))
13
13
  ifconfig = nil
14
14
  # Get ifconfig output
15
15
  comm.execute("ifconfig -a") do |type, data|
@@ -21,9 +21,16 @@ module Vagrant
21
21
  expanded_guest_path = machine.guest.capability(
22
22
  :shell_expand_guest_path, opts[:guestpath])
23
23
 
24
- # Create the folder
25
- machine.communicate.sudo("mkdir -p #{expanded_guest_path}")
24
+ # clear prior symlink
25
+ if machine.communicate.test("test -L \"#{expanded_guest_path}\"", sudo: true)
26
+ machine.communicate.sudo("rm -f \"#{expanded_guest_path}\"")
27
+ end
26
28
 
29
+ # Create the folder if doesn't exist
30
+ if !machine.communicate.test("test -d \"#{expanded_guest_path}\"", sudo: true)
31
+ machine.communicate.sudo("mkdir -p #{expanded_guest_path}")
32
+ end
33
+
27
34
  # Figure out any options
28
35
  mount_opts = ["vers=#{opts[:nfs_version]}"]
29
36
  if opts[:mount_options]
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2014 Tnarik Innael - adaptation to Solaris and repackaging
1
+ # Copyright (c) 2014-2015 Tnarik Innael - adaptation to Solaris and repackaging
2
2
  # Copyright (c) 2013-2014 timsutton/kalmanh/lsimons - from plugins/guests/darwin/cap/mount_vmware_shared_folder.rb
3
3
  module Vagrant
4
4
  module Solaris10
@@ -6,7 +6,21 @@ module Vagrant
6
6
  class MountVmwareSharedFolder
7
7
 
8
8
  def self.mount_vmware_shared_folder(machine, name, guestpath, options)
9
+ owner = options[:owner]
10
+ group = options[:group]
9
11
  machine.communicate.tap do |comm|
12
+ if owner.is_a? Integer
13
+ mount_uid = owner
14
+ else
15
+ mount_uid = "$(/usr/xpg4/bin/id -u #{owner})"
16
+ end
17
+
18
+ if group.is_a? Integer
19
+ mount_gid = group
20
+ else
21
+ mount_gid = "$(/bin/getent group #{group} | cut -d: -f3)"
22
+ end
23
+
10
24
  # clear prior symlink
11
25
  if comm.test("test -L \"#{guestpath}\"", sudo: true)
12
26
  comm.sudo("rm -f \"#{guestpath}\"")
@@ -17,8 +31,17 @@ module Vagrant
17
31
  comm.sudo("rm -Rf \"#{guestpath}\"")
18
32
  end
19
33
 
34
+ # create guest parent folder if doesn't exist
35
+ parent_guest_path = File.dirname(guestpath)
36
+ if !comm.test("test -d \"#{parent_guest_path}\"", sudo: true)
37
+ comm.sudo("mkdir -p \"#{parent_guest_path}\"")
38
+ end
39
+
20
40
  # finally make the symlink
21
41
  comm.sudo("ln -s \"/hgfs/#{name}\" \"#{guestpath}\"")
42
+
43
+ # Set permissions correctly on the link
44
+ comm.sudo("chown -h #{mount_uid}:#{mount_gid} \"#{guestpath}\"")
22
45
  end
23
46
  end
24
47
 
@@ -4,8 +4,8 @@ module Vagrant
4
4
  class RSync
5
5
 
6
6
  def self.rsync_post(machine, opts)
7
- machine.communicate.execute(
8
- "#{machine.config.solaris.suexec_cmd} find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -o ! -group #{opts[:group]} ')' " +
7
+ machine.communicate.sudo(
8
+ "find '#{opts[:guestpath]}' '(' ! -user #{opts[:owner]} -o ! -group #{opts[:group]} ')' " +
9
9
  " -exec chown #{opts[:owner]}:#{opts[:group]} {} +")
10
10
  end
11
11
 
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Solaris10
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-solaris10
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tnarik Innael
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-03 00:00:00.000000000 Z
11
+ date: 2015-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler