FS#53646 - pacman's output breaks bash, causes posix mode
Attached to Project:
Pacman
Opened by MechaLynx (MechaLynx) - Wednesday, 12 April 2017, 04:57 GMT
Last edited by Andrew Gregory (andrewgregory) - Wednesday, 12 April 2017, 13:09 GMT
Opened by MechaLynx (MechaLynx) - Wednesday, 12 April 2017, 04:57 GMT
Last edited by Andrew Gregory (andrewgregory) - Wednesday, 12 April 2017, 13:09 GMT
|
Details
Summary and Info:
Allowing pacman to produce output can change bash's behavior, specifically breaking behavior when sourcing files. Redirecting output prevents this. Steps to Reproduce: - start a bash script that sets extglob - source a file that requires extglob to work - call pacman after sourcing the file - sourcing breaks Test code: https://gist.github.com/MechaLynx/12b6f8898c80004e0052c57bffc2c824 Output: http://imgur.com/zXP656h Tested on the live archiso distribution, booted from the latest iso (april 2017) |
This task depends upon
Closed by Andrew Gregory (andrewgregory)
Wednesday, 12 April 2017, 13:09 GMT
Reason for closing: Upstream
Wednesday, 12 April 2017, 13:09 GMT
Reason for closing: Upstream
edit - Some discussion on #bash on freenode has revealed that it is the environment exported to pacman due to `set -a' that's causing the issue, since pacman tries to import the environment twice and because `extglob' isn't exported, it fails the import. Making sure `set +a' is used before calling pacman should be a practical workaround. Thanks to twkm and geirha on #bash. Not sure if this counts as a pacman bug anymore, however, it does show that pacman spawns at least 2 new bash environments to do its printing, while it doesn't spawn any if printing is redirected. I guess it counts as a bug if this forking can be avoided, but I guess that's asking too much.