Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--shell-cmd is ignored #765

Open
pjaitken opened this issue Mar 13, 2020 · 1 comment
Open

--shell-cmd is ignored #765

pjaitken opened this issue Mar 13, 2020 · 1 comment

Comments

@pjaitken
Copy link

The osc shell "--shell-cmd" is ignored.

When I use "osc chroot" I'm put into /home/abuild, whereas I want to run gdb in another dir - so it seems that --shell-cmd could be useful:

$ osc --version
0.168.0

$ osc help shell
...

    osc shell [OPTS] REPOSITORY ARCH

OPTS may be

    --shell-cmd=COMMAND

However --shell-cmd seems to be ignored.

Given

osc shell --root=/var/tmp/osc-buildpackage/build-root/whatever --shell-cmd date

commandline.py parses shell/chroot at lines 6475 - 6495, building opts and args for osc.build.run_build. shell-cmd is contained in opts, while args is:

args=['--root=/var/tmp/osc-buildpackage/build-root/whatever', '--noinit', '--shell']

run_build ignores opts (so shell-cmd is lost), and passes these args to run_external:

filename=sudo, args=/usr/bin/build, kwargs=--root=/var/tmp/osc-buildpackage/build-root/whatever

Ultimately this runs

/usr/bin/build --root=/var/tmp/osc-buildpackage/build-root/whatever --noinit --shell --norootforbuild

Then looking at /usr/bin/build, since --noinit is given it runs "chroot" about line 1139 without reference to RUN_SHELL_CMD. It needs to do something like:

chroot $BUILD_ROOT "${RUN_SHELL_CMD:=/bin/bash}"
@adrianschroeter
Copy link
Member

adrianschroeter commented Mar 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants