Bug 218010 - www/grafana4 grafana-cli installs plugins on /var/db/grafana/plugins
Summary: www/grafana4 grafana-cli installs plugins on /var/db/grafana/plugins
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Steve Wills
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-22 16:35 UTC by Borja Marcos
Modified: 2017-05-31 17:05 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (swills)


Attachments
Fix. Corrects the plugins path (350 bytes, patch)
2017-03-23 12:44 UTC, Borja Marcos
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Borja Marcos 2017-03-22 16:35:49 UTC
After installing www/grafana4 I have noticed that grafana-cli installs plugins on the wrong directory. It should be /var/db/grafana4/plugins. Instead, it creates /var/db/grafana/plugins.

Might be that grafana-4.1.2/src/github.com/grafana/grafana/pkg/cmd/grafana-cli/utils/grafana_path.go should be patched? 

A function calles returnOsDefault returns /var/db/grafana/plugins as the
default directory for FreeBSD

----
func returnOsDefault(currentOs string) string {
        switch currentOs {
        case "windows":
                return "../data/plugins"
        case "darwin":
                return "/usr/local/var/lib/grafana/plugins"
        case "freebsd":
                return "/var/db/grafana/plugins"
        default: //"linux"
                return "/var/lib/grafana/plugins"
        }
}
-----

The problem seems to be in the patch-7410 file, which adds support for FreeBSD but sets /var/db/grafana instead of /var/db/grafana4 as default directory for FreeBSD.
Comment 1 Borja Marcos 2017-03-23 12:44:05 UTC
Created attachment 181097 [details]
Fix. Corrects the plugins path

Replaces the plugins path on grafana-cli/utils/grafana_path.go.
Comment 2 Steve Wills freebsd_committer freebsd_triage 2017-04-18 04:11:52 UTC
You're right, the paths don't match, but I think it will make more sense to fix the path in the port than to patch grafana. The older grafana ports can't be installed at the same time and since they aren't supported upstream any more should probably go and www/grafana4 should be renamed www/grafana and all the paths and names changed to just "grafana" instead of "grafana4"
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-05-31 16:53:17 UTC
A commit references this bug:

Author: swills
Date: Wed May 31 16:53:04 UTC 2017
New revision: 442223
URL: https://svnweb.freebsd.org/changeset/ports/442223

Log:
  www/grafana4: update and fix bugs

  * Update to 4.3.2 [1]
  * Fix paths not to include the major version to fix plugin install and keep things uniform [2]
  * Correct boot.js seems to be used now [3]

  PR:		219639 [1]
  PR:		218010 [2]
  PR:		219131 [3]
  Submitted by:	farrokhi [1]
  Reported by:	Borja Marcos <borjam@sarenet.es> [2]
  Reported by:	Ari Suutari <ari@stonepile.fi> [3]

Changes:
  head/www/grafana4/Makefile
  head/www/grafana4/distinfo
  head/www/grafana4/files/grafana.conf.in
  head/www/grafana4/files/grafana.in
  head/www/grafana4/files/grafana4.conf.in
  head/www/grafana4/files/grafana4.in
  head/www/grafana4/pkg-plist
Comment 4 Steve Wills freebsd_committer freebsd_triage 2017-05-31 17:05:33 UTC
Committed, thanks!