Opened 4 years ago

Closed 4 years ago

#12066 closed bug (fixed)

setarch utility does not rescan ~/.config file

Reported by: haiqu Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Applications/Command Line Tools Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

When swapping to the GCC4 compiler using 'setarch x86' all environment changes in ~/.profile are lost. This could be fixed by rescanning the file at each swap.

Change History (9)

comment:1 Changed 4 years ago by haiqu

*bangs head on keyboard* deos?

comment:2 Changed 4 years ago by bonefish

Component: Build SystemApplications/Command Line Tools
Owner: changed from bonefish to nobody
Summary: setarch utility deos not rescan ~/.config filesetarch utility does not rescan ~/.config file

comment:3 Changed 4 years ago by pulkomandy

setarch starts a new shell session, which is apparently not a login shell, so the .profile is not read. But, the .bashrc will, I think?

comment:4 Changed 4 years ago by haiqu

Put the following code in ~/.bashrc :

# Shortcut for building alias hp="haikuporter -S -j8 --no-dependencies --no-source-packages"

and can now use the 'hp' shortcut even when GCC4 is selected.

Solved, thank.

comment:5 Changed 4 years ago by bonefish

setarch should still be changed to start an interactive shell by default.

comment:6 Changed 4 years ago by jessicah

Testing here, setarch does read my bash_rc file, so it appears it is being invoked as an interactive shell. However, not as a login shell, which is required for it to source /etc/profile, etc.

Should we change it to be a login shell when invoked with no arguments? One would get the banner printed again... not sure if that would be considered an issue. Perhaps we could detect we're not the primary arch, and change the banner to indicate that?

comment:7 Changed 4 years ago by jessicah

comment:8 Changed 4 years ago by waddlesplash

Looks good to me.

comment:9 Changed 4 years ago by jessicah

Resolution: fixed
Status: newclosed

Applied in hrev49276.

Note: See TracTickets for help on using tickets.