当前位置:网站首页>Openharmony get the source code

Openharmony get the source code

2022-04-23 22:02:00 Know what you know and slowly understand what you don't know

Established before Remote-SSH after , We can do it in windows Command operation under the terminal

The source code is obtained through repo Add some https By

1. install repo

curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo

After copying, say that the permission is not enough

Take other ways Download the file to the current path

Prompt not installed curl , We need to install curl

sudo apt-get install curl 

After the installation is completed, enter the previous command

 

Once the download is complete , adopt cat View the pulled repo Content

cat repo 

If it is empty after input , Let's copy the address of the web page , Open it in a browser  

I found that this is a script file  

2. install vim

sudo apt-get install vim

adopt vim Get into repo

vim repo 

When you come in, you will find a blank There is INSERT

Put all the script content in the browser just now Ctrl+A Copy all   Paste the vim in

After editing Press the top left corner esc Exit edit status

Press down shigt+ The colon Input wq Save and exit  

Next, continue take repo File copy to /usr/local Under the table of contents

sudo mv repo /usr/local/bin/

After copying , Need to give repo File add executable rights

sudo chmod a+x /usr/local/bin/repo 

Add after completion You can use the following command to detect

pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

  In this way, it is finished  

【 If you are like this 】

 

 

Yes, the current system environment does not pip perhaps pip3

You can install it pip3

sudo apt install python3-pip 

You can query through instructions  

pip3 --version 

Upgrade through instructions

python3 -m pip install --upgrade pip 

Then try the above command again

 pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests

  This is the finished

【 Some people can skip this one   ...】

3. install git 

 sudo apt-get install git

  I'm here git It's installed

install git-lfs 

 sudo apt-get install git-lfs

Set it up git Used to pull the following codes  

openharmony    Use this link to register gitee Account and email

Enter the user name at the terminal mailbox Configuration save verification

git config --global user.name"yourname"

git config --global user.email"your-email-address"

git config --global credential.helper store

Create a openharmony The catalog of

mkdir OpenHarmony_master 

adopt cd Enter the directory

 

4. Download the source code

repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify

repo sync -c

repo forall -c 'git lfs pull' 

repo forall -c 'git lfs pull' 

After the first step, the information will report an error Say no python3 Environment

We need a soft link

which python3        In the query system python3 The path of  

Through soft links python3 Set to python 

sudo ln -s /usr/bin/python3 /usr/bin/python

( The front is the source file path , Followed by the target file path )

After setting, query through the command python Version of

python --version

python3 --version 

 

Then execute the file installation

 repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify

There may be an error , According to the following situation

Question 1

sudo vim /usr/local/bin/repo

find import sys  Add the following code

import ssl

ssl._create_default_https_context = ssl._create_unverified_context

shigt+ The colon Input wq preservation sign out  

 

Again using repo The order of

repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify

 

 

  The color that appears is to let us confirm repo The default functions , such as diff、repo stadus

The displayed file displays different states of the file through different colors

Synchronization code

repo sync -c

next step

repo forall -c 'git lfs pull' 

版权声明
本文为[Know what you know and slowly understand what you don't know]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204200609332325.html