Commit f27f82a
committed
installer + Dockerfile: keep set -u out of user's .bashrc
The previous fix wrapped the installer's 'source /opt/ros/noetic/setup.bash'
call with 'set +u; ...; set -u' via a Dockerfile sed. But the same sed
also caught the literal 'source /opt/ros/noetic/setup.bash' string
inside the installer's `echo "source ..." >> ~/.bashrc` line. The
wrapped string then got echoed into the user's .bashrc, leaving every
interactive shell with `set -u` active. Any ROS bash helper that
references positional args without defaults (roscd $1, rosls $1, ...)
errored out with 'bash: $1: unbound variable'.
Fix in the installer itself: wrap the actual source calls inline with
explicit `set +u` / `set -u` lines (two places — install_ros_noetic
and build_workspace). The literal `echo ... >> .bashrc` lines stay
plain, so the bashrc gets a clean source command that doesn't toggle
nounset.
Dockerfile: drop the two sed lines that wrapped the bashrc echoes;
they're no longer needed.
Verified: .bashrc now ends with
source /opt/ros/noetic/setup.bash
source /home/uniros/uniros_ws/devel/setup.bash
Interactive shells have nounset off, roscd / rosls / etc. work.1 parent 94b25fa commit f27f82a
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
197 | 200 | | |
| 201 | + | |
198 | 202 | | |
| 203 | + | |
199 | 204 | | |
200 | 205 | | |
201 | 206 | | |
| |||
416 | 421 | | |
417 | 422 | | |
418 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
419 | 427 | | |
| 428 | + | |
420 | 429 | | |
| 430 | + | |
421 | 431 | | |
422 | 432 | | |
423 | 433 | | |
| |||
0 commit comments