diff options
author | V3n3RiX <venerix@rogentos.ro> | 2015-06-30 22:31:37 +0100 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2015-06-30 22:31:37 +0100 |
commit | c92e66d74c049eadafaa3d855aeb1be241de92d7 (patch) | |
tree | 44ec5e278b243c923b88a0f0d50e9a84024105e3 | |
parent | 2c2f3dffff3de642b5c22466cbc54dbf33138139 (diff) |
use for loop for similar repetitive commands
-rwxr-xr-x | vasile | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -161,11 +161,9 @@ envkogaionbuildsystem() { echo "Adding Kogaion Linux X86_64 Buildsystem && Setting up Portage && Setting up make.conf" echo "" sleep 1 - chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionbuildgit" - chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionportageconfig" - chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionmakeconf" - chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionprofile" - chroot "$overlaydir" su - "$engkogaionuser" -c "$envkogaionenvupdate" + for cmd in "$envkogaionbuildgit" "$envkogaionportageconfig" "$envkogaionmakeconf" "$envkogaionprofile" "$envkogaionenvupdate" ; do + chroot "$overlaydir" su - "$envkogaionuser" -c "$cmd" + done elif [[ "$(uname -m)" = "i686" ]] ; then export local envkogaionmakeconf="ln -sf /opt/build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf" export local envkogaionprofile="eselect profile set 1" @@ -178,11 +176,9 @@ envkogaionbuildsystem() { echo "Adding Kogaion Linux i686 Buildsystem && Setting up Portage && Setting up make.conf" echo "" sleep 1 - linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionbuildgit" - linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionportageconfig" - linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionmakeconf" - linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionprofile" - linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$envkogaionenvupdate" + for cmd in "$envkogaionbuildgit" "$envkogaionportageconfig" "$envkogaionmakeconf" "$envkogaionprofile" "$envkogaionenvupdate" ; do + linux32 chroot "$overlaydir" su - "$envkogaionuser" -c "$cmd" + done fi } |