diff options
author | James Meyer <James.meyer@operamail.com> | 2008-10-04 05:25:42 (GMT) |
---|---|---|
committer | James Meyer <James.meyer@operamail.com> | 2008-10-04 05:25:42 (GMT) |
commit | ae89cebca11fb20c823263ce2b32ed80d371d27a (patch) | |
tree | e150651ac4a733e534d81649572a66b15b940066 /setup_env.sh | |
parent | d63abecec6eb30923a11db85cf0b08229499f147 (diff) | |
download | linhes_dev-ae89cebca11fb20c823263ce2b32ed80d371d27a.zip |
setup_env.sh now takes an 2nd argument naming the developer template to use.
If the template is not found the script will exit.
If the template is found it will copy loginrun.sh to the chroot, and also execute custom_chroot.sh
Diffstat (limited to 'setup_env.sh')
-rwxr-xr-x | setup_env.sh | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/setup_env.sh b/setup_env.sh index 986b5ca..85a5ad8 100755 --- a/setup_env.sh +++ b/setup_env.sh @@ -1,6 +1,6 @@ #!/bin/bash # Script to setup the LinHES development enviroment -# ./setup_env.sh ( i586|i686|x86_64 ) +# ./setup_env.sh ( i586|i686|x86_64 ) devID # This script assumes that /tmp is usable. MIRROR_DIR=../pkg_repo @@ -17,8 +17,23 @@ case $1 in exit 1 ;; esac + +if [ ! x$2 = x ] +then + #check if developer template is present + if [ -d templates/developers/$2 ] + then + echo "found the template for $2 " + FOUNDTEMPLATE="TRUE" + else + echo "couldn't find templates/developers/$2" + exit 2 + fi +fi + } + function pacman_check { which pacman status=$? @@ -32,7 +47,7 @@ function pacman_check { #----------------------------------------------- -arg_check $1 +arg_check $1 $2 pacman_check @@ -69,6 +84,22 @@ fi #clear out the default resolve.con mv -f ../build_root.$ARCH/etc/resolv.conf ../build_root.$ARCH/etc/resolv.conf.orig +if [ x$FOUNDTEMPLATE = xTRUE ] +then + #check for login run + if [ -f templates/developers/$2/loginrun.sh ] + then + cp -f templates/developers/$2/loginrun.sh ../build_root.$ARCH/root/loginrun.sh + fi + + if [ -f templates/developers/$2/custom_chroot.sh ] + then + cd templates/developers/$2 + ./custom_chroot.sh $ARCH + cd - + fi +fi + #create custom enter_dev_chroot.sh script sed -e "s/REPLACEME/$ARCH/g" templates/enter_dev_chroot.sh > ../enter_dev_chroot.$ARCH.sh chmod 755 ../enter_dev_chroot.$ARCH.sh @@ -78,6 +109,7 @@ echo "** cd .. **" echo "** ./enter_dev_chroot.$ARCH.sh **" echo "********************************************************" + #copy makepkg.conf into the chroot sed -e "s/i686/$ARCH/g" templates/makepkg.conf > ../build_root.$ARCH/etc/makepkg.conf #copy pacman.conf into the chroot |