Bug 1544801 - Impossible to (un)set $PROMPT_COMMAND environment variable without --old-chroot
Summary: Impossible to (un)set $PROMPT_COMMAND environment variable without --old-chroot
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mock
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Suchý
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-13 14:30 UTC by Tim Landscheidt
Modified: 2018-05-26 22:40 UTC (History)
7 users (show)

Fixed In Version: mock-1.4.10-1.fc28 mock-1.4.10-1.fc27 mock-1.4.10-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-13 20:00:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tim Landscheidt 2018-02-13 14:30:36 UTC
To integrate mock (mock-1.4.8-1.fc26.noarch) with Emacs TRAMP (https://www.gnu.org/software/tramp/), the first part of the mock prompt ("\033]0;<mock-chroot>\007") is very inconvenient as it causes the prompt to not match standard shell prompt patterns.  Therefore I would like to unset $PROMPT_COMMAND (or set it to '').  This is only possible when using --old-chroot:

| [tim@passepartout ~]$ cat .config/mock.cfg
| config_opts['environment']['PROMPT_COMMAND'] = ''
| [tim@passepartout ~]$ mock --shell 
| INFO: mock.py version 1.4.8 starting (python version = 3.6.4)...
| Start: init plugins
| INFO: selinux disabled
| Finish: init plugins
| Start: run
| Start: chroot init
| INFO: calling preinit hooks
| INFO: enabled root cache
| INFO: enabled dnf cache
| Start: cleaning dnf metadata
| Finish: cleaning dnf metadata
| INFO: enabled HW Info plugin
| Finish: chroot init
| Start: shell
| <mock-chroot> sh-4.4# echo $PROMPT_COMMAND 
| printf "\033]0;<mock-chroot>\007"
| <mock-chroot> sh-4.4# Abgemeldet
| Finish: shell
| [tim@passepartout ~]$ mock --shell --old-chroot
| INFO: mock.py version 1.4.8 starting (python version = 3.6.4)...
| Start: init plugins
| INFO: selinux enabled
| Finish: init plugins
| Start: run
| Start: chroot init
| INFO: calling preinit hooks
| INFO: enabled root cache
| INFO: enabled dnf cache
| Start: cleaning dnf metadata
| Finish: cleaning dnf metadata
| INFO: enabled HW Info plugin
| Finish: chroot init
| Start: shell
| <mock-chroot> sh-4.4# echo $PROMPT_COMMAND 

| <mock-chroot> sh-4.4# Abgemeldet
| Finish: shell
| [tim@passepartout ~]$

The environment seems to be set by py/mockbuild/util.py's _prepare_nspawn_command()'s:

|     if env:
|         # BZ 1312384 workaround
|         env['PROMPT_COMMAND'] = r'printf "\033]0;<mock-chroot>\007"'
|         env['PS1'] = r'<mock-chroot> \s-\v\$ '
|         for k, v in env.items():
|             nspawn_argv.append('--setenv={0}={1}'.format(k, v))

but I don't understand why bug #1312384 requires $PROMPT_COMMAND and $PS1 to be unconditionally set to some constants.

(I have not tested 1.4.9, but looking at the code diff, this issue should also affect it.)

Comment 1 Miroslav Suchý 2018-02-14 19:15:40 UTC
This was needed in 2016. And according to my last comment in bug #1312384 this is not needed anymore. So deleting.

Commit:
* 15a7714 (HEAD -> devel, origin/devel) revert workaround introduced in 057c51d6 [RHBZ#1544801]

Comment 2 Fedora End Of Life 2018-05-03 08:20:37 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Fedora Update System 2018-05-10 12:14:47 UTC
mock-1.4.10-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-28fdd00a4b

Comment 4 Fedora Update System 2018-05-10 12:15:03 UTC
mock-1.4.10-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-8c3673366b

Comment 5 Fedora Update System 2018-05-10 12:15:15 UTC
mock-1.4.10-1.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-1a033ecee8

Comment 6 Fedora Update System 2018-05-10 20:01:35 UTC
mock-1.4.10-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-8c3673366b

Comment 7 Fedora Update System 2018-05-11 01:34:44 UTC
mock-1.4.10-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-28fdd00a4b

Comment 8 Fedora Update System 2018-05-11 02:00:14 UTC
mock-1.4.10-1.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-1a033ecee8

Comment 9 Fedora Update System 2018-05-13 20:00:01 UTC
mock-1.4.10-1.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2018-05-19 21:34:36 UTC
mock-1.4.10-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2018-05-26 22:40:46 UTC
mock-1.4.10-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.