libelektra: Problem with installation with brew on ubuntu 16

Steps to Reproduce the Problem

eduardo@eduardo-Inspiron-7472:~$ date
Ter Jul 30 07:46:33 -03 2019
eduardo@eduardo-Inspiron-7472:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial
$ brew install elektra
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
aws-google-auth     hlint               ncdc                spin
aws-okta            hugo                omniorb             supervisor
cfn-lint            kim-api             openkim-models      tesseract
conan               lean-cli            parallel            unrtf
diamond             libdazzle           pdfcrack            valgrind
duck                liblcf              png++               vitetris
exploitdb           libtrace            pony-stable         wandio
fluxctl             memcached           schismtracker       wxmaxima
gatsby-cli          monkeysphere        serverless          x11vnc
gitg                msitools            solr

==> Downloading https://www.libelektra.org/ftp/elektra/releases/elektra-0.8.26.tar.gz
Already downloaded: /home/eduardo/.cache/Homebrew/downloads/9b3f4a8687a4ca17fbdcf3ad47b5801411ef9597313652cc087f7969622c67fe--elektra-0.8.26.tar.gz
==> cmake .. -DBINDINGS=cpp -DTOOLS=kdb; -DPLUGINS=NODEP -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/home/eduardo/.linuxbrew/Cellar/elektra/0.8.26 -DCMAKE_B
==> make install
Last 15 lines from /home/eduardo/.cache/Homebrew/Logs/elektra/02.make:
-- Installing: /home/eduardo/.linuxbrew/Cellar/elektra/0.8.26/lib/elektra/tool_exec/mountpoint-info
-- Installing: /home/eduardo/.linuxbrew/Cellar/elektra/0.8.26/lib/elektra/tool_exec/mount-list-all-files
-- Installing: /home/eduardo/.linuxbrew/Cellar/elektra/0.8.26/lib/elektra/tool_exec/check-env-dep
-- Installing: /home/eduardo/.linuxbrew/Cellar/elektra/0.8.26/lib/elektra/tool_exec/install-sh-completion
-- Installing: /usr/share/bash-completion/completions/kdb
CMake Error at scripts/cmake_install.cmake:137 (file):
  file INSTALL cannot copy file
  "/tmp/elektra-20190730-9068-1qp1wxo/elektra-0.8.26/scripts/kdb-bash-completion"
  to "/usr/share/bash-completion/completions/kdb".
Call Stack (most recent call first):
  cmake_install.cmake:48 (include)


Makefile:76: recipe for target 'install' failed
make: *** [install] Error 1

READ THIS: https://docs.brew.sh/Troubleshooting

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (16 by maintainers)

Commits related to this issue

Most upvoted comments

$ brew install elektrainitiative/elektra/elektra --with-dep-plugins
==> Installing elektra from elektrainitiative/elektra
==> Downloading https://www.libelektra.org/ftp/elektra/releases/elektra-0.8.26.tar.gz
Already downloaded: /home/eduardo/.cache/Homebrew/downloads/9b3f4a8687a4ca17fbdcf3ad47b5801411ef9597313652cc087f7969622c67fe--elektra-0.8.26.tar.gz
==> cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/eduardo/.linuxbrew/Cellar/elektra/0.8.26_1 -DBINDINGS='cpp' -DTOOLS='kdb;gen' -DPLUGINS='NODEP;augeas;dbus;gitresolver;tcl;yajl;yamlcpp
==> make install
==> Caveats
Bash completion has been installed to:
  /home/eduardo/.linuxbrew/etc/bash_completion.d
==> Summary
🍺  /home/eduardo/.linuxbrew/Cellar/elektra/0.8.26_1: 2,045 files, 43.8MB, built in 2 minutes 23 seconds

Thank you for maintaining homebrew!

Edit the file $HOMEBREW_PREFIX/etc/bash_completion.d/kdb and change this line:

local commands=($(${kdbpath} 2> /dev/null | sed -e '0,/^Known commands are/d' | awk '{print $1}'))

to this:

local commands=($(${kdbpath} 2> /dev/null | sed -e '0,/^Known commands are/d' | awk '{print $1}' | sed -r "s/\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]//g" ))

And it will work.

@markus2330 Would it be okay, if we disable INSTALL_SYSTEM_FILES by default. This way we would not have to change the Homebrew formula, and the issue would be fixed as soon as we release a new version of Elektra.

Yes, it is okay (There is also the kdb install-sh-completion script to install shell completion as user.). Ideally, INSTALL_SYSTEM_FILES would be OFF if a user (non-root) installs Elektra (e.g. to home directory) and ON otherwise.

How to test the bash-completion feature?

The bash completion is rudimentary, currently not maintained and we currently rewrite it. Instructions were given by @sanssecours a second ago.

Sorry about that, $HOME/.linuxbrew/bin wasn’t in the PATH.