Bug 194578 - sysutils/vagrant: Error setting certificate verify locations
Summary: sysutils/vagrant: Error setting certificate verify locations
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: John Marino
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2014-10-24 14:25 UTC by Fabian M. Borschel
Modified: 2014-11-28 09:55 UTC (History)
2 users (show)

See Also:
fmb: maintainer-feedback? (joe)


Attachments
Vagrant 1.6.5 update patch (246.07 KB, patch)
2014-10-25 15:52 UTC, joe
no flags Details | Diff
Vagrant 1.6.5 update patch (243.37 KB, patch)
2014-10-26 22:25 UTC, joe
no flags Details | Diff
Poudriere Log (27.84 KB, text/x-log)
2014-10-26 22:25 UTC, joe
no flags Details
Poudriere Log (28.05 KB, text/x-log)
2014-11-08 17:38 UTC, joe
no flags Details
Vagrant 1.6.5 update patch (243.64 KB, patch)
2014-11-08 17:39 UTC, joe
no flags Details | Diff
Vagrant 1.6.5 update (243.54 KB, patch)
2014-11-09 14:11 UTC, joe
no flags Details | Diff
Poudriere Log (28.45 KB, text/x-log)
2014-11-09 14:12 UTC, joe
no flags Details
Vagrant 1.6.5 update patch (243.53 KB, patch)
2014-11-09 18:31 UTC, joe
no flags Details | Diff
Vagrant 1.6.5 update patch (243.41 KB, patch)
2014-11-10 14:06 UTC, joe
no flags Details | Diff
Vagrant 1.6.5 update patch (243.56 KB, patch)
2014-11-10 16:02 UTC, joe
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian M. Borschel 2014-10-24 14:25:56 UTC
After installing virtualbox-ose and vagrant the following failed:

fmb@~/tmp/vagrant> vagrant init hashicorp/precise32
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
fmb@~/tmp/vagrant> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
The box 'hashicorp/precise32' could not be found or
could not be accessed in the remote catalog. If this is a private
box on Vagrant Cloud, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:

URL: ["https://vagrantcloud.com/hashicorp/precise32"]
Error: error setting certificate verify locations:
  CAfile: /tmp/vagrant/cacert.pem
  CApath: none
fmb@~/tmp/vagrant>
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-24 14:25:56 UTC
Maintainer CC'd
Comment 2 joe 2014-10-25 15:52:39 UTC
Created attachment 148641 [details]
Vagrant 1.6.5 update patch

Can the reporter please try patching their installation with the following patch and report back if it works? Thanks.
Comment 3 Fabian M. Borschel 2014-10-26 10:32:54 UTC
Hi,

thanks for the patch. It works if i remove the following lines from your patch:

%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.darwin.bundle
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.freebsd.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.freebsd.x86_64.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.linux.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.linux.x86_64.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.mingw.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.mingw.x64.so
%%DATADIR%%/embedded/rgloader/rgloader%%RUBY_DEFAULT_SUFFIX%%.mswin.so
Comment 4 joe 2014-10-26 22:25:02 UTC
Created attachment 148681 [details]
Vagrant 1.6.5 update patch
Comment 5 joe 2014-10-26 22:25:40 UTC
Created attachment 148682 [details]
Poudriere Log
Comment 6 joe 2014-10-26 22:26:11 UTC
Please test this new patch. If all is well then someone may commit it to the repository.
Comment 7 John Marino freebsd_committer freebsd_triage 2014-11-01 12:53:48 UTC
I think this needs some tweaking.

1) the PORTREVISION jumps from undefined (0) to 3, it should jump to 1
2) You are creating a new, non-standard directory in the port for only one file.  I recommend that you put cacert.pem in the files directory
3) You are using COPYTREE_SHARE to copy a single file.  Just use INSTALL_DATA macro to put it in ${STAGEDIR}${DATADIR}/embedded

everything else looks ok I think
Comment 8 John Marino freebsd_committer freebsd_triage 2014-11-05 15:41:04 UTC
removed wrong person!
Comment 9 joe 2014-11-08 17:38:53 UTC
Created attachment 149197 [details]
Poudriere Log
Comment 10 joe 2014-11-08 17:39:39 UTC
Created attachment 149198 [details]
Vagrant 1.6.5 update patch
Comment 11 John Marino freebsd_committer freebsd_triage 2014-11-09 08:19:52 UTC
You created one directory twice (two methods) and created another with a different method.  

replace:
68		${MKDIR} ${STAGEDIR}${DATADIR}/embedded
69		${INSTALL} -d -m 0755 ${STAGEDIR}${DATADIR}/embedded
70		${INSTALL} -d -m 0755 ${STAGEDIR}${DATADIR}/embedded/rgloader

with

		${MKDIR} ${STAGEDIR}${DATADIR}/embedded/rgloader


You don't need to create embedded, then embedded/rgloader.
MKDIR is "mkdir -p" which creates all necessary directories in between
Comment 12 joe 2014-11-09 14:11:13 UTC
Created attachment 149220 [details]
Vagrant 1.6.5 update
Comment 13 joe 2014-11-09 14:12:05 UTC
Created attachment 149221 [details]
Poudriere Log
Comment 14 John Marino freebsd_committer freebsd_triage 2014-11-09 15:32:57 UTC
(In reply to joe from comment #12)
> Created attachment 149220 [details]
> Vagrant 1.6.5 update

I don't understand, you left "${INSTALL} -d -m 0755".  We want ${MKDIR}, not hardcoded modes (which is meaningless for stage anyway)

oversight?  it doesn't match my "replace/with" instructions above.

(new Poudriere logs aren't necessary for these changes btw)
Comment 15 joe 2014-11-09 18:31:43 UTC
Created attachment 149228 [details]
Vagrant 1.6.5 update patch
Comment 16 John Marino freebsd_committer freebsd_triage 2014-11-10 13:30:42 UTC
(In reply to John Marino from comment #7)
> I think this needs some tweaking.
> 
> 2) You are creating a new, non-standard directory in the port for only one
> file.  I recommend that you put cacert.pem in the files directory

You didn't address this! ^^ 

also, 
There is no reason to use ${PORTSDIR}.... in the makefile.  Just still this in files/ and use ${FILESDIR} instead.

Also, you don't need (cd ..... && ${INSTALL_DATA}) with only one file, just use ${INSTALL_DATA} command with full paths.


If it's still unclear, just say so and I'll try to post a full changeset that I expect later.
Comment 17 joe 2014-11-10 14:06:17 UTC
Created attachment 149258 [details]
Vagrant 1.6.5 update patch
Comment 18 John Marino freebsd_committer freebsd_triage 2014-11-10 14:11:01 UTC
This is very, very close.  however, you added this line:

+ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] = '/usr/local/share/vagrant/embedded'

The "/usr/local/" is not guaranteed.

You might try this:
+ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"] = '@PREFIX@/share/vagrant/embedded'

and then use post-patch target like this:
  @${REINPLACE_CMD} -e 's|@PREFIX|${PREFIX}|g' ${WRKSRC}/path/to/file


then your patch will be good for non-standard locations.
Comment 19 joe 2014-11-10 16:02:55 UTC
Created attachment 149265 [details]
Vagrant 1.6.5 update patch
Comment 20 John Marino freebsd_committer freebsd_triage 2014-11-10 18:08:49 UTC
quick question:

the command before is this:
@${RM} ${WRKSRC}/bin/vagrant.orig

but the REINPLACE_CMD will produce vagrant.bak

Is that okay?  If not, maybe you want to move the RM line after the REINPLACE_CMD line and change it to @${RM} ${WRKSRC}/bin/vagrant.* or 
@${RM} ${WRKSRC}/bin/vagrant.orig ${WRKSRC}/bin/vagrant.bak


(I don't know how important the removal of the .orig file is, but I figured if it's really needed, you don't want the .bak file either)
Comment 21 joe 2014-11-10 22:14:58 UTC
Yeah, it's ok. There is always the ideal way, but I'm tired of monkeying with this PR.
Comment 22 John Marino freebsd_committer freebsd_triage 2014-11-10 22:18:02 UTC
If it's okay to leave .bak files, then it's okay to leave .orig files too, right?

Either way I'll promote the PR, but if the above is true, I'll recommend the RM line be removed if it's not doing anything in practical terms.
Comment 23 joe 2014-11-10 22:34:12 UTC
Yes, chuck the RM line. Thanks!
Comment 24 John Marino freebsd_committer freebsd_triage 2014-11-10 22:37:38 UTC
I am promoting this PR.  It should work as-is, I am recommending the following for the committer that picks up the PR:

1) remove this line "@${RM} ${WRKSRC}/bin/vagrant.orig"
2) verify via poudriere or "make check-plist" that there are no new orphans showing since the last poudriere test.

Thanks!
Comment 25 commit-hook freebsd_committer freebsd_triage 2014-11-28 09:51:20 UTC
A commit references this bug:

Author: marino
Date: Fri Nov 28 09:50:36 UTC 2014
New revision: 373538
URL: https://svnweb.freebsd.org/changeset/ports/373538

Log:
  sysutils/vagrant: Fix error setting certificate verify locations

  While here, remove @dirrm and make port pass stage-qa checks.  Also wrap
  lines to respect 80 columns.

  PR:		194578
  Reported by:	Fabian Borschel
  Fixed by:	maintainer (Joe Benden)

Changes:
  head/sysutils/vagrant/Makefile
  head/sysutils/vagrant/files/cacert.pem
  head/sysutils/vagrant/files/loader.rb
  head/sysutils/vagrant/files/patch-vagrant-is-vagrant-installer.patch
  head/sysutils/vagrant/pkg-plist
Comment 26 John Marino freebsd_committer freebsd_triage 2014-11-28 09:55:12 UTC
of note, the @dir lines were part of the pkg-plist, a carry-over from a mistake in the previous PR.  I removed ALL of them.

@dir is not an alias for @dirrm.

At the time, "make makepatch" was spitting this out, so maybe it was just the result of that resubmitted, but *you cannot trust make makepatch* !!

It builds cleanly in poudriere now, I had to remove an empty doc directory in post-install to do that though.