Przeglądaj źródła

setup.sh: Check for dash as default shell and change it to bash if possible

could fix #26

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Khem Raj 5 lat temu
rodzic
commit
c439bc57b5
1 zmienionych plików z 13 dodań i 3 usunięć
  1. 13 3
      setup.sh

+ 13 - 3
setup.sh

@@ -15,10 +15,20 @@ rm -rf $DIR
 #mkdir -p ~/sstate/$MACHINE
 
 # fix permissions set by buildbot
-echo "Fixing permissions for buildbot"
-umask -S u=rwx,g=rx,o=rx
-chmod -R 755 .
+#echo "Fixing permissions for buildbot"
+#umask -S u=rwx,g=rx,o=rx
+#chmod -R 755 .
 
+# Reconfigure dash on debian-like systems
+which aptitude > /dev/null 2>&1
+ret=$?
+if [ "$(readlink /bin/sh)" = "dash" -a "$ret" = "0" ]; then
+  sudo aptitude install expect -y
+  expect -c 'spawn sudo dpkg-reconfigure -freadline dash; send "n\n"; interact;'
+elif [ "${0##*/}" = "dash" ]; then
+  echo "dash as default shell is not supported"
+  return
+fi
 # bootstrap OE
 echo "Init OE"
 export BASH_SOURCE="openembedded-core/oe-init-build-env"