Bug 1020177: Bail out on upgrade in a more shell-friendly way

Manipulating env var might be problematic