Skip to content

Commit

Permalink
Only use python3
Browse files Browse the repository at this point in the history
  • Loading branch information
tangzz98 authored and mysterywolf committed Dec 4, 2022
1 parent d38568b commit 131e33a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
```
wget https://raw.githubusercontent.com/RT-Thread/env/master/install_ubuntu.sh
chmod 777 install_ubuntu.sh
source ./install_ubuntu.sh
./install_ubuntu.sh
```

对于中国大陆用户,请使用以下命令
```
wget https://gitee.com/RT-Thread-Mirror/env/raw/master/install_ubuntu.sh
chmod 777 install_ubuntu.sh
source ./install_ubuntu.sh --gitee
./install_ubuntu.sh --gitee
```

### Prepare Env
Expand Down
6 changes: 5 additions & 1 deletion install_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ if ! [ -x "$(command -v scons)" ]; then
$RTT_PYTHON -m pip install scons
fi

if ! [[ `$RTT_PYTHON -m pip list | grep requests` ]]; then
echo "Installing requests."
$RTT_PYTHON -m pip install requests
fi

if ! [ -x "$(command -v arm-none-eabi-gcc)" ]; then
echo "Installing GNU Arm Embedded Toolchain."
brew install gnu-arm-embedded
fi

export RTT_EXEC_PATH=/usr/bin # set the default tool chain path
url=https://raw.githubusercontent.com/RT-Thread/env/master/touch_env.sh
if [ $1 ] && [ $1 = --gitee ]; then
url=https://gitee.com/RT-Thread-Mirror/env/raw/master/touch_env.sh
Expand Down
20 changes: 6 additions & 14 deletions install_ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
#!/usr/bin/env bash

RTT_PYTHON=python

for p_cmd in python3 python; do
$p_cmd --version >/dev/null 2>&1 || continue
RTT_PYTHON=$p_cmd
break
done

$RTT_PYTHON --version 2 > /dev/null || {
echo "Python not installed. Please install Python before running the installation script."
python3 --version 2 > /dev/null || {
echo "Python3 not installed. Please install Python before running the installation script."
exit 1
}

$RTT_PYTHON -m pip list > /dev/null || {
python3 -m pip list > /dev/null || {
echo "Installing pip."
sudo apt install $RTT_PYTHON-pip -y
sudo apt install python3-pip -y
}

sudo apt update
sudo apt upgrade -y

sudo apt install gcc git libncurses5-dev scons gcc-arm-none-eabi binutils-arm-none-eabi gdb-multiarch qemu qemu-system-arm -y
sudo apt install gcc git libncurses5-dev gcc-arm-none-eabi binutils-arm-none-eabi gdb-multiarch qemu qemu-system-arm -y
python3 -m pip install scons requests

export RTT_EXEC_PATH=/usr/bin # set the default tool chain path
url=https://raw.githubusercontent.com/RT-Thread/env/master/touch_env.sh
if [ $1 ] && [ $1 = --gitee ]; then
url=https://gitee.com/RT-Thread-Mirror/env/raw/master/touch_env.sh
Expand Down
2 changes: 1 addition & 1 deletion menuconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python ~/.env/tools/scripts/env.py menuconfig $*
python3 ~/.env/tools/scripts/env.py menuconfig $*
2 changes: 1 addition & 1 deletion pkgs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python ~/.env/tools/scripts/env.py package $*
python3 ~/.env/tools/scripts/env.py package $*
2 changes: 1 addition & 1 deletion touch_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if ! [ -d $env_dir ]; then
git clone $package_url $env_dir/packages/packages
echo 'source "$PKGS_DIR/packages/Kconfig"' > $env_dir/packages/Kconfig
git clone $ENV_URL $env_dir/tools/scripts
echo 'export PATH=$HOME/.env/tools/scripts:$PATH' > $env_dir/env.sh
echo -e 'export PATH=`python3 -m site --user-base`/bin:$HOME/.env/tools/scripts:$PATH\nexport RTT_EXEC_PATH=/usr/bin' > $env_dir/env.sh
fi

RTT_ROOT=$HOME/rt-thread
Expand Down

0 comments on commit 131e33a

Please sign in to comment.