Skip to content

cli installation: better handling of sudo #99

@G4Vi

Description

@G4Vi

Currently the installation invoke sudo if the user is not root and $out_prefix is not in $HOME. This heuristic has a lot of false positives, all of the failures I looked at http://matrix.cpantesters.org/?dist=Alien-libextism%20v0.1.1 appear to be the cli install script attempting sudo in a scenario where it shouldn't.

If we insist on installing with sudo, rather that attempting to detect when it's needed, we should try without, and on permission error retry with sudo.

However, instead I think we should make two changes:

  • Don't use sudo at all in the install script. I will use sudo or run it as root myself if I am going to install somewhere that I don't have write access to.

  • Install the cli to a $HOME directory by default. After installing the file on disk, to get it in $PATH, I prefer when it spits out instructions rather than appends to a dot file, as I know best how to handle my own dot files (I append to .profile on my systems for efficiency reasons, though it requires logging out and back in for it to take effect). This removes the need for root/sudo for the default install case. If we wanted to we could add a flag to get a system install that just sets the prefix to /usr/local/bin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions