|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suggestions by kerframil:
- Fix the original su invocation bug. The original approach is veering very
close to eval territory. Let's just not overload SUDO quite so hard and
keep it coherent.
- Use id -u (posix) instead of whoami (not posix).
- Rather than try to make a scalar behave as if it were an array (it's not)
then unsafely expand it, compose the positional parameter list as needed.
Note that XBPS_BINPKGS and BRANCH are now expanded safely in the course of
doing so.
- Don't include improperly formed repository paths as parameters if git fails
or prints nothing.
- Have su pass sh as the zeroeth arg, not a dash so that, if an error in the
shell context ever happens again, the resulting message will be less
confusing. As an aside, if you want the environment to be as it normally
would be for the root user, there should be a dash (or -l) before -c, not
after --. Could help protect against issues of environmental pollution down
the line.
- Don't squash the exit status of the first call to xbps-install in the case
that it's not zero and also not 16.
- Make the fallback invocation be contingent upon -u xbps succeeding. Note
that the exit status of either will be properly conveyed by the script i.e.
we don't have to capture the exit value there.
|