aboutsummaryrefslogtreecommitdiffstats
path: root/iurt2
diff options
context:
space:
mode:
authorFlorent Villard <warly@mandriva.com>2006-12-11 14:09:36 +0000
committerFlorent Villard <warly@mandriva.com>2006-12-11 14:09:36 +0000
commit076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d (patch)
tree46bc84b7a027a367efb60dd35b1ad8a26a81fe55 /iurt2
parent8bb37046328cf4bfab6221472219162321002f87 (diff)
downloadiurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar
iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.gz
iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.bz2
iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.tar.xz
iurt-076a39f0dd81891bcdfdf8a9dbe93fb7682cfa0d.zip
fix chroot shell PS1
Diffstat (limited to 'iurt2')
-rwxr-xr-xiurt28
1 files changed, 6 insertions, 2 deletions
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}");