Bug 206277 - local make is not really local
Summary: local make is not really local
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Steven Rostedt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-22 06:38 UTC by Julia Lawall
Modified: 2020-01-30 19:46 UTC (History)
1 user (show)

See Also:
Kernel Version: trace-cmd-v2.8.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
trace-cmd: Have /etc paths honor $(prefix) if not the default (892 bytes, patch)
2020-01-29 15:37 UTC, Steven Rostedt
Details | Diff

Description Julia Lawall 2020-01-22 06:38:18 UTC
README.install says:

Note: The default install is relative to /usr/local
    The default install directory is /usr/local/bin
    The default plugin directory is /usr/local/lib/trace-cmd/plugins

To change the default, you can set 'prefix', eg
mkdir $HOME/test-trace
make prefix=$HOME/test-trace
make prefix=$HOME/test-trace install

But this doesn't work due to:

  INSTALL         /home/julia/trace-cmd/tracecmd/trace-cmd.bash	to	/etc/bash_completion.d
install: cannot create regular file '/etc/bash_completion.d/trace-cmd.bash': Permission denied
Makefile:333: recipe for target 'install_bash_completion' failed
make: *** [install_bash_completion] Error 1

The obvious solution would be to add sudo, but the install is ona server and I don't want to overwrite a global version that someone else may be relying on.
Comment 1 Steven Rostedt 2020-01-29 15:23:44 UTC
Thanks Julia for the report! I'll look into this. Agreed that there's issues with the "local" verses "normal" install.

The issue is that some installations need to be put into the root directories (like /etc and not /usr/local) otherwise they do not work at all. But for these cases we need to check if "prefix" has been changed, because then we need to change the installation of the "root" files. It appears that the bash completion installation is one of those that need to be handled and was missed.
Comment 2 Steven Rostedt 2020-01-29 15:37:00 UTC
Created attachment 287025 [details]
trace-cmd: Have /etc paths honor $(prefix) if not the default

This patch should fix the issue (at least it does for me). It checks if "prefix" has been set, and if it has then it will have the /etc directory honor it.
Comment 3 Steven Rostedt 2020-01-30 19:46:34 UTC
Fixed by: e8fb01140eb2 ("trace-cmd: Have /etc paths honor $(prefix) if not the default")

Note You need to log in before you can comment on or make changes to this bug.