[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

avoid wrapper scripts when possible

From: Ricardo Wurmus
Subject: avoid wrapper scripts when possible
Date: Thu, 02 Nov 2017 22:31:16 +0100
User-agent: mu4e 0.9.18; emacs 25.3.1

Hi Guix,

the environment activation feature of our “conda” package currently
fails.  This is because the “deactivate” shell script is wrapped in
another shell script.  This leads to the actual shell script to be
called “.deactivate-real”.  The script compares the value of “$0” with
the expected name “deactivate”.  This fails so conda misbehaves.

Since “deactivate” is really just a shell script I think we could avoid
the renaming and the external wrapper by setting the environment
variables in the “deactivate” script itself.

This made me wonder if we could avoid shell wrappers in more cases.  If
the target script is a Python script we could set the environment
variables right after the Python shebang with Python code.  If the
target script is a shell script we can set environment variables right
there after the shebang.

For binaries (like emacs) we’d still create shell wrappers where needed,
because it’s harder to do this natively.

What do you think?


GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC

reply via email to

[Prev in Thread] Current Thread [Next in Thread]