diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-12-06 18:27:17 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-12-06 18:27:17 +0100 |
commit | e346e22d8fb15ffd099939c4f8052bcb02f8960d (patch) | |
tree | c6c2f42d671ce10af3c2c0538d3187660105c922 /_xtools | |
parent | 0dd716d6cfb1a32f5fd5dff8ec0047df6a90dca6 (diff) | |
download | xtools-e346e22d8fb15ffd099939c4f8052bcb02f8960d.tar.gz xtools-e346e22d8fb15ffd099939c4f8052bcb02f8960d.tar.xz xtools-e346e22d8fb15ffd099939c4f8052bcb02f8960d.zip |
xi: refactor
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.
Diffstat (limited to '_xtools')
0 files changed, 0 insertions, 0 deletions