Skip to content

Commit

Permalink
Fix sfdisk version match pattern to not require two dots (.) -
Browse files Browse the repository at this point in the history
 - the version does not always contain a patch level.
 - Make it work on Fedora 23 -
  - # sfdisk --version
  - sfdisk from util-linux 2.28
  • Loading branch information
lhupfeldt committed May 20, 2016
1 parent 84f838d commit 04533e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/vagrant-persistent-storage/manage_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def populate_template(m)
disk_operations_template = ERB.new <<-EOF
#!/bin/bash
# fdisk the disk if it's not a block device already:
[[ $("sfdisk" --version) =~ ([0-9][.][0-9.]*[.][0-9.]*) ]] && version="${BASH_REMATCH[1]}"
[[ $("sfdisk" --version) =~ ([0-9][.][0-9.]*[0-9.]*) ]] && version="${BASH_REMATCH[1]}"
if ! awk -v ver="$version" 'BEGIN { if (ver < 2.26 ) exit 1; }'; then
[ -b #{disk_dev}1 ] || echo 0,,8e | sfdisk #{disk_dev}
else
Expand Down

0 comments on commit 04533e1

Please sign in to comment.