diff options
author | R. Dale Thomas <rdt@rdt1.org> | 2008-10-16 08:12:19 (GMT) |
---|---|---|
committer | R. Dale Thomas <rdt@rdt1.org> | 2008-10-16 08:12:19 (GMT) |
commit | 86200220d0f67d160e62e99c4079f2197426c4b9 (patch) | |
tree | 3875b0f0e2efc0895a723e77fc730c1ef6159917 | |
parent | ef7e29326b258de2dbe14d95b7029d3d9c9c2740 (diff) | |
download | linhes_dev-86200220d0f67d160e62e99c4079f2197426c4b9.zip |
Make sure the printout lines up as desired.
-rwxr-xr-x | setup_env.sh | 26 | ||||
-rwxr-xr-x | templates/enter_dev_chroot.sh | 12 |
2 files changed, 20 insertions, 18 deletions
diff --git a/setup_env.sh b/setup_env.sh index 1a1972a..ace578d 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -75,10 +75,10 @@ sed -e "s/REPLACEME/$ARCH/g" templates/pacman.conf.chroot > /tmp/pacman.conf.chr status=$? if [ ! $status = 0 ] then - echo - echo "********************************************************" - echo "*** An error occured creating the chroot ***" - echo "********************************************************" + printf "\n" + printf "%s\n" "********************************************************" + printf "*** %-48s ***\n" " An error occured creating the chroot" + printf "%s\n" "********************************************************" exit 1 fi #clear out the default resolve.con @@ -102,16 +102,14 @@ fi #create custom enter_dev_chroot.sh script #sed -e "s/REPLACEME/$ARCH/g" templates/enter_dev_chroot.sh > ../enter_dev_chroot.$ARCH.sh -DIR=$(pwd) ; DIR=${DIR##*/} -ln -s $DIR/templates/enter_dev_chroot.sh ../enter_dev_chroot.$ARCH - -chmod 755 ../enter_dev_chroot.$ARCH.sh -echo "********************************************************" -echo "** To enter the chroot (build_root.$ARCH) run: **" -echo "** cd .. **" -echo "** ./enter_dev_chroot.$ARCH **" -echo "********************************************************" - +cp templates/enter_dev_chroot.sh ../enter_dev_chroot.$ARCH +chmod 755 ../enter_dev_chroot.$ARCH + +printf "%s\n" "********************************************************" +printf "** %-50s **\n" " To enter the chroot (build_root.$ARCH) run:" +printf "** %-50s **\n" " cd .." +printf "** %-50s **\n" " ./enter_dev_chroot.$ARCH" +printf "%s\n" "********************************************************" #copy makepkg.conf into the chroot sed -e "s/i686/$ARCH/g" templates/makepkg.conf > ../build_root.$ARCH/etc/makepkg.conf diff --git a/templates/enter_dev_chroot.sh b/templates/enter_dev_chroot.sh index 1e3160c..a2a6d85 100755 --- a/templates/enter_dev_chroot.sh +++ b/templates/enter_dev_chroot.sh @@ -30,6 +30,12 @@ Modify() { # $1 is + for up and - for down. ) 200>$LOCKFILE } #-----------------------------------------------------------------------# +# set the title bar for an xterm or Konsole. +title() { # args are the title + echo -en "\e]0;$@\a" # for xterm, + echo -en "\e]30;$@\a" # for Konsole. +} +#-----------------------------------------------------------------------# # check if a filesystem/directory is already mounted & if not, mount it. # ckMount -t <fstype> <mntDir> # ckMount --bind <srcDir> <dstDir> @@ -47,8 +53,7 @@ ckMount() { # $1= -t|--bind, $2= fstype|srcDir $3= mntDir|dstDir # if this is the last incident, unmount all. cleanUp() { # no arguments # mark the exit to normal operation: - echo -en "\e]0;Normal\a" # for xterm, - echo -en "\e]30;Normal\a" # for Konsole. + title Normal V=$(Modify -) [ "$V" -ne "0" ] && exit 0 @@ -131,8 +136,7 @@ ckMount --bind $repoBaseDir data/$repoBaseDir copyIn # change the titlebar to indicate chroot: -echo -e "\e]0;CHROOT : $ARCH\a" # for xterm, -echo -e "\e]30;CHROOT : $ARCH\a" # for Konsole. +title "CHROOT : $ARCH" # The actual chroot: env -i TERM="$TERM" DISPLAY="$DISPLAY" /usr/sbin/chroot . /bin/bash --login |