From 076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d Mon Sep 17 00:00:00 2001 From: Florent Villard Date: Mon, 11 Dec 2006 14:09:36 +0000 Subject: fix chroot shell PS1 --- iurt2 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'iurt2') diff --git a/iurt2 b/iurt2 index 8fccfd7..75443d4 100755 --- a/iurt2 +++ b/iurt2 @@ -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}"); -- cgit v1.2.1