diff options
author | Florent Villard <warly@mandriva.com> | 2006-12-11 14:09:36 +0000 |
---|---|---|
committer | Florent Villard <warly@mandriva.com> | 2006-12-11 14:09:36 +0000 |
commit | 076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d (patch) | |
tree | 46bc84b7a027a367efb60dd35b1ad8a26a81fe55 | |
parent | 8bb37046328cf4bfab6221472219162321002f87 (diff) | |
download | iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.gz iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.bz2 iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.xz iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.zip |
fix chroot shell PS1
-rwxr-xr-x | iurt2 | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -418,6 +418,10 @@ my %config_usage = ( desc => 'Name of the build bot', default => 'Iurt' }, + prompt => { + desc => 'Default prompt in the chroot', + default => qq{PS1='[\\033[00;33m\\]iurt $run{distro}\\[\\033[00m\\]] \\[\\033[00;31m\\]\\u\\[\\033[00;32m\\]\\h\\[\\033[00m\\]\\w\$ '}, + }, repository => { desc => 'Prefix of the repositories', default => '' @@ -653,7 +657,7 @@ if ($run{shell}) { add_sudoers(\%run, $chroot_tmp, $luser); if ($run{shell}) { plog('NOTIFY', "dumping to a chrooted shell into $chroot_tmp"); - exec $sudo, 'chroot', $chroot_tmp, '/bin/su', $luser, '-c', "PS1='[\[\033[01;33m\]iurt $run{distro} \[\033[00m\]\u@\h \W]\$ ' bash"; + exec $sudo, 'chroot', $chroot_tmp, '/bin/su', $luser, '-c', "$config->{prompt} bash"; die "FATAL $program_name: could not exec chroot to $chroot_tmp ($!)"; } } @@ -824,7 +828,7 @@ retry: if ($run{stop}) { plog("dumping to a chrooted shell into $chroot_tmp (pid $$)"); # exec does not work because it seems stdin and out are shared between children - system($sudo, 'chroot', $chroot_tmp, '/bin/su', $luser, '-c', "PS1='[\[\033[01;33m\]iurt $run{distro} \[\033[00m\]\u@\h \W]\$ ' bash"); + system($sudo, 'chroot', $chroot_tmp, '/bin/su', $luser, '-c', "$config->{prompt} bash"); exit(); } plog('DEBUG', "calling callback for $opt->{hash}"); |