I tested this with my package in http://bazaar.launchpad.net/~jdstrand/+junk/test-click-env/files (on desktop):
$ sudo click install --user=$USER com.ubuntu.developer.jdstrand.click-env_0.1_all.click
Test with path unset: $ initctl unset-env -g LD_LIBRARY_PATH $ initctl list-env|grep LD_LIBRARY_PATH $ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1 application stop/waiting LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib (good)
Test with path set: $ initctl set-env -g LD_LIBRARY_PATH=/foo:/ $ initctl list-env|grep LD_LIBRARY_PATH LD_LIBRARY_PATH=/foo:/ $ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1 application stop/waiting LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib:/foo:/ (good)
Test with path set, but empty: $ initctl set-env -g LD_LIBRARY_PATH= $ initctl list-env|grep LD_LIBRARY_PATHLD_LIBRARY_PATH= $ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1 application stop/waiting LD_LIBRARY_PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib:
When LD_LIBRARY_PATH is set but empty, upstart-app-launch leaves a trailing ':'. I think we should treat empty the same as unset.
Note, the same thing affects QML2_IMPORT_PATH and PATH: $ initctl set-env -g QML2_IMPORT_PATH= $ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep QML2_IMPORT_PATH ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1 application stop/waiting QML2_IMPORT_PATH=:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu (notice ':' is prepended)
$ initctl set-env -g PATH= $ start application APP_ID=com.ubuntu.developer.jdstrand.click-env_click-env_0.1 && sleep 5 && grep '^PATH=' ~/.cache/upstart/application-click-com.ubuntu.developer.jdstrand.click-env_click-env_0.1.log | tail -1 application stop/waiting PATH=/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env/lib/x86_64-linux-gnu/bin:/opt/click.ubuntu.com/.click/users/jamie/com.ubuntu.developer.jdstrand.click-env: (notice ':' is appended)
« Back to merge proposal
I tested this with my package in http:// bazaar. launchpad. net/~jdstrand/ +junk/test- click-env/ files (on desktop):
$ sudo click install --user=$USER com.ubuntu. developer. jdstrand. click-env_ 0.1_all. click
Test with path unset: com.ubuntu. developer. jdstrand. click-env_ click-env_ 0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/ upstart/ application- click-com. ubuntu. developer. jdstrand. click-env_ click-env_ 0.1.log | tail -1 PATH=/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib/x86_ 64-linux- gnu:/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib
$ initctl unset-env -g LD_LIBRARY_PATH
$ initctl list-env|grep LD_LIBRARY_PATH
$ start application APP_ID=
application stop/waiting
LD_LIBRARY_
(good)
Test with path set: PATH=/foo: / PATH=/foo: / com.ubuntu. developer. jdstrand. click-env_ click-env_ 0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/ upstart/ application- click-com. ubuntu. developer. jdstrand. click-env_ click-env_ 0.1.log | tail -1 PATH=/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib/x86_ 64-linux- gnu:/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib:/foo: /
$ initctl set-env -g LD_LIBRARY_
$ initctl list-env|grep LD_LIBRARY_PATH
LD_LIBRARY_
$ start application APP_ID=
application stop/waiting
LD_LIBRARY_
(good)
Test with path set, but empty: PATHLD_ LIBRARY_ PATH= com.ubuntu. developer. jdstrand. click-env_ click-env_ 0.1 && sleep 5 && grep LD_LIBRARY_PATH ~/.cache/ upstart/ application- click-com. ubuntu. developer. jdstrand. click-env_ click-env_ 0.1.log | tail -1 PATH=/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib/x86_ 64-linux- gnu:/opt/ click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib:
$ initctl set-env -g LD_LIBRARY_PATH=
$ initctl list-env|grep LD_LIBRARY_
$ start application APP_ID=
application stop/waiting
LD_LIBRARY_
When LD_LIBRARY_PATH is set but empty, upstart-app-launch leaves a trailing ':'. I think we should treat empty the same as unset.
Note, the same thing affects QML2_IMPORT_PATH and PATH: com.ubuntu. developer. jdstrand. click-env_ click-env_ 0.1 && sleep 5 && grep QML2_IMPORT_PATH ~/.cache/ upstart/ application- click-com. ubuntu. developer. jdstrand. click-env_ click-env_ 0.1.log | tail -1 PATH=:/ opt/click. ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib/x86_ 64-linux- gnu
$ initctl set-env -g QML2_IMPORT_PATH=
$ start application APP_ID=
application stop/waiting
QML2_IMPORT_
(notice ':' is prepended)
$ initctl set-env -g PATH= com.ubuntu. developer. jdstrand. click-env_ click-env_ 0.1 && sleep 5 && grep '^PATH=' ~/.cache/ upstart/ application- click-com. ubuntu. developer. jdstrand. click-env_ click-env_ 0.1.log | tail -1 click.ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env/ lib/x86_ 64-linux- gnu/bin: /opt/click. ubuntu. com/.click/ users/jamie/ com.ubuntu. developer. jdstrand. click-env:
$ start application APP_ID=
application stop/waiting
PATH=/opt/
(notice ':' is appended)