Compare commits

..

6 Commits

Author SHA1 Message Date
Kienan Stewart bac396a52a
Fix lintian warnings for description 2018-12-02 14:23:46 -05:00
Kienan Stewart 7fec9cdd3f
Merge tag 'v1.8.9' 2018-12-02 14:17:27 -05:00
Kienan Stewart 42ce51d6d8
Bump version number for new release 2018-12-02 14:14:15 -05:00
Seth Reeser 93b672d829 Releasing v1.8.9 2018-05-18 10:23:04 -04:00
Seth Reeser 7281daec1b
Merge pull request #264 from jalandis/feature/fix-duplication-of-windows-records
Prevents duplicate host file records in Windows
2018-05-18 10:21:49 -04:00
John Landis 7e434ecbb4
Move newlines out of quoted header and footer. Match carriage return along with newline in hosts file pattern. 2018-05-17 16:35:39 -04:00
4 changed files with 10 additions and 7 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
vagrant-hostmanager (1.8.8-1) unstable; urgency=medium
vagrant-hostmanager (1.8.9-1) unstable; urgency=medium
* Initial release (Closes: #898996)

5
debian/control vendored
View File

@ -19,4 +19,7 @@ Depends: ruby | ruby-interpreter,
${shlibs:Depends},
${misc:Depends}
Description: Vagrant plugin for managing /etc/hosts on guests and host
vagrant-hostmanager is a Vagrant plugin that manages the hosts file on guest machines (and optionally the host). Its goal is to enable resolution of multi-machine environments deployed with a cloud provider where IP addresses are not known in advance.
vagrant-hostmanager is a Vagrant plugin that manages the hosts file on guest
machines (and optionally the host). Its goal is to enable resolution of
multi-machine environments deployed with a cloud provider where IP addresses
are not known in advance.

View File

@ -88,8 +88,8 @@ module VagrantPlugins
def update_content(file_content, resolving_machine, include_id, line_endings)
id = include_id ? " id: #{read_or_create_id}" : ""
header = "## vagrant-hostmanager-start#{id}\n"
footer = "## vagrant-hostmanager-end\n"
header = "## vagrant-hostmanager-start#{id}"
footer = "## vagrant-hostmanager-end"
body = get_machines
.map { |machine| get_hosts_file_entry(machine, resolving_machine) }
.join
@ -146,12 +146,12 @@ module VagrantPlugins
if body.empty?
block = "\n"
else
block = "\n\n" + header + body + footer + "\n"
block = "\n\n" + header + "\n" + body + footer + "\n\n"
end
# Pattern for finding existing block
header_pattern = Regexp.quote(header)
footer_pattern = Regexp.quote(footer)
pattern = Regexp.new("\n*#{header_pattern}.*?#{footer_pattern}\n*", Regexp::MULTILINE)
pattern = Regexp.new("[\r\n]*#{header_pattern}.*?#{footer_pattern}[\r\n]*", Regexp::MULTILINE)
# Replace existing block or append
content = old_content.match(pattern) ? old_content.sub(pattern, block) : old_content.rstrip + block
if line_endings == "crlf"

View File

@ -1,5 +1,5 @@
module VagrantPlugins
module HostManager
VERSION = '1.8.8'
VERSION = '1.8.9'
end
end