Closed ricoli closed 9 years ago
I just tested this using a vanilla CentOS base box and found two issues.
First, the installation of bindfs was failing on ./configure && make && make install
because the cd
was being done in a separate call to comm.sudo
. I added some comments here
Second, calls to bindfs
were failing because the binary was installed in /usr/local/bin
and the root $PATH does not include it by default.
While debugging I was able to get everything working by replacing these lines:
comm.sudo('cd bindfs-1.12.6')
comm.sudo('./configure && make && make install')
with these lines:
comm.sudo('cd bindfs-1.12.6 && ./configure && make && make install')
comm.sudo('mv /usr/local/bin/bindfs /usr/bin')
however the mv
feels kind of kludgy. Any ideas how to avoid having to move the bindfs binary?
Thank you very much @the-andrew ! I'll make the changes, and instead of a mv we can simply symlink :)
@ricoli I tested your latest version and everything worked swimmingly. I think this is ready to be merged :+1:
great @the-andrew , thanks a lot for testing it :) ping @gael-ian
Is it working on both, Red Hat and CentOS? @the-andrew?
well if the distro is of redhat type and not centos6 then it will try installing the package via yum. If it doesn't exist then it's a fail. Maybe the title of this PR needs rephrasing :) Then again, feel free to expand the support beyond this PR
@JulianVolodia I've only tested it with CentOS, but like @ricoli said it will still use the yum install as a fallback
according to http://pkgs.org/search/bindfs Redhat distros don't have a package for it apart from centos 5 :(
Thanks all !
Is it possible to add some error checks ? I didn't have much time today but think something like this should work :
comm.sudo('yum -y install fuse fuse-devel')
comm.sudo('[ ! -f ~/bindfs-1.12.6.tar.gz ] && wget http://bindfs.org/downloads/bindfs-1.12.6.tar.gz; true')
comm.sudo('[ -f ~/bindfs-1.12.6.tar.gz ] && tar -zxvf bindfs-1.12.6.tar.gz')
comm.sudo('[ -d ~/bindfs-1.12.6 ] && cd ~/bindfs-1.12.6 && ./configure && make && make install && ln -s /usr/local/bin/bindfs /usr/bin')
A VagrantPlugins::Bindfs::LAST_SUPPORTED_VERSION
constant (declared in version.rb ?) would be great too.
I should have some time tomorrow to merge it and push a new release on rubygems.
@gael-ian I've made some changes, let me know what you think... I went for overwrite instead of testing for presence. @the-andrew if you don't mind testing it too, I'd appreciate :)
@ricoli there were a few bugs in the most recent commits, I've submitted a PR https://github.com/ricoli/vagrant-bindfs/pull/1 with the fixes. The PR code is tested and working.
Your PR is merged and the 0.3.3 version is available on rubygems. Thanks to you!
Thank you @the-andrew for helping me out :)
Aftermath of https://github.com/gael-ian/vagrant-bindfs/pull/23, now branched from original repo's master.