├── .gitattributes ├── .github └── workflows │ ├── Recovery Build (Legacy).yml │ └── Recovery Build.yml ├── README.md └── scripts └── convert.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/Recovery Build (Legacy).yml: -------------------------------------------------------------------------------- 1 | name: Recovery Build (Legacy) 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | MANIFEST_URL: 7 | description: 'MANIFEST_URL (if want to use SSH keys, use git@github.com:XXXXX)' 8 | required: true 9 | default: 'https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni' 10 | MANIFEST_BRANCH: 11 | description: 'MANIFEST_BRANCH' 12 | required: true 13 | default: 'twrp-7.1' 14 | DEVICE_TREE_URL: 15 | description: 'DEVICE_TREE_URL' 16 | required: true 17 | default: 'https://github.com/ycly2333/android_device_EEBBK_H3000S-twrp' 18 | DEVICE_TREE_BRANCH: 19 | description: 'DEVICE_TREE_BRANCH' 20 | required: true 21 | default: 'twrp-7.1' 22 | DEVICE_PATH: 23 | description: 'DEVICE_PATH' 24 | required: true 25 | default: 'device/EEBBK/H3000S' 26 | COMMON_TREE_URL: 27 | description: 'COMMON_TREE_URL (if no common tree, leave blank)' 28 | required: false 29 | COMMON_PATH: 30 | description: 'COMMON_PATH (if no common tree, leave blank)' 31 | required: false 32 | DEVICE_NAME: 33 | description: 'DEVICE_NAME' 34 | required: true 35 | default: 'H3000S' 36 | MAKEFILE_NAME: 37 | description: 'MAKEFILE_NAME' 38 | required: true 39 | default: 'omni_H3000S' 40 | BUILD_TARGET: 41 | description: 'BUILD_TARGET' 42 | required: true 43 | default: 'recovery' 44 | 45 | jobs: 46 | build: 47 | if: github.event.repository.owner.id == github.event.sender.id 48 | runs-on: ubuntu-20.04 49 | permissions: 50 | contents: write 51 | steps: 52 | - name: Display Run Parameters 53 | run: | 54 | echo "::group::User Environment Variables" 55 | echo "Manifest URL: ${{ github.event.inputs.MANIFEST_URL }}" 56 | echo "Manifest Branch: ${{ github.event.inputs.MANIFEST_BRANCH }}" 57 | echo "Device Tree URL: ${{ github.event.inputs.DEVICE_TREE_URL }}" 58 | echo "Device Tree Branch: ${{ github.event.inputs.DEVICE_TREE_BRANCH }}" 59 | echo "Device Path: ${{ github.event.inputs.DEVICE_PATH }}" 60 | echo "Device Name: ${{ github.event.inputs.DEVICE_NAME }}" 61 | echo "Makefile Name: ${{ github.event.inputs.MAKEFILE_NAME }}" 62 | echo "Build Target: ${{ github.event.inputs.BUILD_TARGET }}.img" 63 | echo "::endgroup::" 64 | 65 | # You might want to Checkout your repo first, but not mandatory 66 | - name: Check Out 67 | uses: actions/checkout@v4 68 | 69 | # Cleanup The Actions Workspace Using Custom Composite Run Actions 70 | - name: Cleanup 71 | uses: rokibhasansagar/slimhub_actions@main 72 | # That's it! Now use your normal steps 73 | 74 | - name: Prepare the environment 75 | run: | 76 | sudo apt update && sudo apt upgrade -y 77 | DEBIAN_FRONTEND=noninteractive sudo apt install -yq \ 78 | linux-modules-extra-$(uname -r) \ 79 | gperf gcc-multilib gcc-10-multilib g++-multilib g++-10-multilib \ 80 | libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils \ 81 | xsltproc bc ccache lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev \ 82 | libwxgtk3.0-gtk3-dev libxml2 lzop pngcrush schedtool squashfs-tools \ 83 | imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libncurses5 python3 tar 84 | 85 | - name: Install OpenJDK 86 | uses: actions/setup-java@v4 87 | with: 88 | distribution: 'zulu' 89 | java-version: '11' 90 | 91 | - name: Setup SSH Keys 92 | if: ${{ startsWith(github.event.inputs.MANIFEST_URL, 'git@github.com') || 93 | startsWith(github.event.inputs.DEVICE_TREE_URL, 'git@github.com') || 94 | startsWith(github.event.inputs.COMMON_TREE_URL, 'git@github.com') }} 95 | uses: webfactory/ssh-agent@v0.9.0 96 | with: 97 | ssh-private-key: | 98 | ${{ secrets.SSH_PRIVATE_KEY }} 99 | 100 | - name: Install repo 101 | run: | 102 | mkdir ~/bin 103 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 104 | chmod a+x ~/bin/repo 105 | sudo ln -sf ~/bin/repo /usr/bin/repo 106 | 107 | - name: Initialize repo 108 | run: | 109 | mkdir workspace 110 | cd workspace 111 | echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT 112 | git config --global user.name "azwhikaru" 113 | git config --global user.email "azwhikaru+37921907@github.com" 114 | repo init --depth=1 -u ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} 115 | id: pwd 116 | 117 | - name: Repo Sync 118 | run: | 119 | repo sync -j$(nproc --all) --force-sync 120 | working-directory: workspace 121 | 122 | - name: Clone device tree 123 | run: | 124 | git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }} 125 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 126 | 127 | - name: Clone common tree 128 | if: | 129 | github.event.inputs.COMMON_TREE_URL != null 130 | && github.event.inputs.COMMON_PATH != null 131 | run: | 132 | git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }} 133 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 134 | 135 | - name: Sync Device Dependencies 136 | run: | 137 | bash ${GITHUB_WORKSPACE}/scripts/convert.sh ${{ github.event.inputs.DEVICE_PATH }}/${{ steps.buildtree.outputs.value }}.dependencies 138 | repo sync -j$(nproc --all) 139 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 140 | continue-on-error: true 141 | 142 | - name: Set Swap Space 143 | uses: pierotofy/set-swap-space@master 144 | with: 145 | swap-size-gb: 12 146 | 147 | - name: Switch to Python2 148 | run: | 149 | sudo apt -y install python 150 | sudo rm -rf /usr/bin/python 151 | sudo ln -s /usr/bin/python2 /usr/bin/python 152 | # sudo ln -s /usr/bin/python3 /usr/bin/python3 153 | continue-on-error: true 154 | 155 | - name: Building recovery 156 | run: | 157 | source build/envsetup.sh 158 | export ALLOW_MISSING_DEPENDENCIES=true 159 | lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && make ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all) 160 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 161 | 162 | - name: Upload to Release 163 | uses: softprops/action-gh-release@v2 164 | with: 165 | files: | 166 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}.img 167 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip 168 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*vendor*.img 169 | name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }} 170 | tag_name: ${{ github.run_id }} 171 | body: | 172 | Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }} 173 | Device: ${{ github.event.inputs.DEVICE_NAME }} 174 | Target: ${{ github.event.inputs.BUILD_TARGET }}.img 175 | env: 176 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 177 | -------------------------------------------------------------------------------- /.github/workflows/Recovery Build.yml: -------------------------------------------------------------------------------- 1 | name: Recovery Build 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | MANIFEST_URL: 7 | description: 'MANIFEST_URL (if want to use SSH keys, use git@github.com:XXXXX)' 8 | required: true 9 | default: 'https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp' 10 | MANIFEST_BRANCH: 11 | description: 'MANIFEST_BRANCH' 12 | required: true 13 | default: 'twrp-12.1' 14 | DEVICE_TREE_URL: 15 | description: 'DEVICE_TREE_URL' 16 | required: true 17 | default: 'https://github.com/TeamWin/android_device_asus_I003D' 18 | DEVICE_TREE_BRANCH: 19 | description: 'DEVICE_TREE_BRANCH' 20 | required: true 21 | default: 'android-12.1' 22 | DEVICE_PATH: 23 | description: 'DEVICE_PATH' 24 | required: true 25 | default: 'device/asus/I003D' 26 | COMMON_TREE_URL: 27 | description: 'COMMON_TREE_URL (if no common tree, leave blank)' 28 | required: false 29 | COMMON_PATH: 30 | description: 'COMMON_PATH (if no common tree, leave blank)' 31 | required: false 32 | DEVICE_NAME: 33 | description: 'DEVICE_NAME' 34 | required: true 35 | default: 'I003D' 36 | MAKEFILE_NAME: 37 | description: 'MAKEFILE_NAME' 38 | required: true 39 | default: 'twrp_I003D' 40 | BUILD_TARGET: 41 | description: 'BUILD_TARGET' 42 | required: true 43 | default: 'recovery' 44 | 45 | jobs: 46 | build: 47 | if: github.event.repository.owner.id == github.event.sender.id 48 | runs-on: ubuntu-24.04 49 | permissions: 50 | contents: write 51 | steps: 52 | - name: Display Run Parameters 53 | run: | 54 | echo "::group::User Environment Variables" 55 | echo "Manifest URL: ${{ github.event.inputs.MANIFEST_URL }}" 56 | echo "Manifest Branch: ${{ github.event.inputs.MANIFEST_BRANCH }}" 57 | echo "Device Tree URL: ${{ github.event.inputs.DEVICE_TREE_URL }}" 58 | echo "Device Tree Branch: ${{ github.event.inputs.DEVICE_TREE_BRANCH }}" 59 | echo "Device Path: ${{ github.event.inputs.DEVICE_PATH }}" 60 | echo "Device Name: ${{ github.event.inputs.DEVICE_NAME }}" 61 | echo "Makefile Name: ${{ github.event.inputs.MAKEFILE_NAME }}" 62 | echo "Build Target: ${{ github.event.inputs.BUILD_TARGET }}.img" 63 | echo "::endgroup::" 64 | 65 | # You might want to Checkout your repo first, but not mandatory 66 | - name: Check Out 67 | uses: actions/checkout@v4 68 | 69 | # Cleanup The Actions Workspace Using Custom Composite Run Actions 70 | - name: Cleanup 71 | uses: rokibhasansagar/slimhub_actions@main 72 | # That's it! Now use your normal steps 73 | 74 | - name: Prepare the environment 75 | run: | 76 | sudo apt update && sudo apt upgrade -y 77 | DEBIAN_FRONTEND=noninteractive sudo apt install -yq \ 78 | linux-modules-extra-$(uname -r) \ 79 | gperf gcc-multilib gcc-10-multilib g++-multilib g++-10-multilib \ 80 | libc6-dev lib32ncurses-dev x11proto-core-dev libx11-dev tree lib32z-dev libgl1-mesa-dev libxml2-utils \ 81 | xsltproc bc ccache lib32readline-dev lib32z1-dev liblz4-tool libncurses-dev libsdl1.2-dev \ 82 | build-essential libgtk-3-dev libglu1-mesa-dev freeglut3-dev git libxml2 lzop pngcrush schedtool squashfs-tools \ 83 | imagemagick libbz2-dev lzma ncftp qemu-user-static libstdc++-10-dev libncurses6 python3 tar 84 | 85 | - name: Install OpenJDK 86 | uses: actions/setup-java@v4 87 | with: 88 | distribution: 'zulu' 89 | java-version: '11' 90 | 91 | - name: Setup SSH Keys 92 | if: ${{ startsWith(github.event.inputs.MANIFEST_URL, 'git@github.com') || 93 | startsWith(github.event.inputs.DEVICE_TREE_URL, 'git@github.com') || 94 | startsWith(github.event.inputs.COMMON_TREE_URL, 'git@github.com') }} 95 | uses: webfactory/ssh-agent@v0.9.0 96 | with: 97 | ssh-private-key: | 98 | ${{ secrets.SSH_PRIVATE_KEY }} 99 | 100 | - name: Install repo 101 | run: | 102 | mkdir ~/bin 103 | curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo 104 | chmod a+x ~/bin/repo 105 | sudo ln -sf ~/bin/repo /usr/bin/repo 106 | 107 | - name: Initialize repo 108 | run: | 109 | mkdir workspace 110 | cd workspace 111 | echo "workspace-folder=$(pwd)" >> $GITHUB_OUTPUT 112 | git config --global user.name "Nico170420" 113 | git config --global user.email "b170420nc@gmail.com" 114 | repo init --depth=1 -u ${{ github.event.inputs.MANIFEST_URL }} -b ${{ github.event.inputs.MANIFEST_BRANCH }} 115 | id: pwd 116 | 117 | - name: Repo Sync 118 | run: | 119 | repo sync -j$(nproc --all) --force-sync 120 | working-directory: workspace 121 | 122 | - name: Clone device tree 123 | run: | 124 | git clone ${{ github.event.inputs.DEVICE_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.DEVICE_PATH }} 125 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 126 | 127 | - name: Clone common tree 128 | if: | 129 | github.event.inputs.COMMON_TREE_URL != null 130 | && github.event.inputs.COMMON_PATH != null 131 | run: | 132 | git clone ${{ github.event.inputs.COMMON_TREE_URL }} -b ${{ github.event.inputs.DEVICE_TREE_BRANCH }} ./${{ github.event.inputs.COMMON_PATH }} 133 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 134 | 135 | - name: Check Build Tree 136 | uses: haya14busa/action-cond@v1 137 | id: buildtree 138 | with: 139 | cond: ${{ github.event.inputs.MANIFEST_BRANCH == 'twrp-11' || github.event.inputs.MANIFEST_BRANCH == 'twrp-12.1' }} 140 | if_true: twrp 141 | if_false: omni 142 | 143 | - name: Sync Device Dependencies 144 | run: | 145 | bash ${GITHUB_WORKSPACE}/scripts/convert.sh ${{ github.event.inputs.DEVICE_PATH }}/${{ steps.buildtree.outputs.value }}.dependencies 146 | repo sync -j$(nproc --all) 147 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 148 | continue-on-error: true 149 | 150 | - name: Set Swap Space 151 | uses: pierotofy/set-swap-space@master 152 | with: 153 | swap-size-gb: 12 154 | 155 | - name: Building recovery 156 | run: | 157 | source build/envsetup.sh 158 | export ALLOW_MISSING_DEPENDENCIES=true 159 | lunch ${{ github.event.inputs.MAKEFILE_NAME }}-eng && make clean && make ${{ github.event.inputs.BUILD_TARGET }}image -j$(nproc --all) 160 | working-directory: ${{ steps.pwd.outputs.workspace-folder }} 161 | 162 | - name: Upload to Release 163 | uses: softprops/action-gh-release@v2 164 | with: 165 | files: | 166 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/${{ github.event.inputs.BUILD_TARGET }}.img 167 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*.zip 168 | workspace/out/target/product/${{ github.event.inputs.DEVICE_NAME }}/*vendor*.img 169 | name: ${{ github.event.inputs.DEVICE_NAME }}-${{ github.run_id }} 170 | tag_name: ${{ github.run_id }} 171 | body: | 172 | Manifest: ${{ github.event.inputs.MANIFEST_BRANCH }} 173 | Device: ${{ github.event.inputs.DEVICE_NAME }} 174 | Target: ${{ github.event.inputs.BUILD_TARGET }}.img 175 | env: 176 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 177 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Automated TWRP compilation based on Github Action 2 | 3 | ## Advertising 4 | 5 | 1. OrangeFox is [here](https://github.com/azwhikaru/Action-OFRP-Builder) 6 | 7 | ## Notice 8 | 9 | 1. Github Actions service is **NOT** unlimited so to avoid waste, don't use unverified source code in this, the best used to automate builds of repositories that are already stabilized 10 | 11 | 2. Before you make any changes, make sure that the repository you are operating in belongs to you. **"Fork" if you want to commit code, otherwise use "Use this template"** 12 | 13 | 3. issues and Pull Requests may **NOT** get a reply. If you think is really necessary, use email on my profile to contact me 14 | 15 | 4. Python 2 in Debian (Ubuntu) has been **removed**. If you are working on Android 8.1 and below, use *Recovery Build (Legacy)* 16 | 17 | 5. Don't ask any questions about your source code, such as 18 | - No rule to make ... 19 | - Image ... out of size 20 | 21 | ## Thanks to 22 | 23 | All contributors 24 | 25 | ## Parameter Description 26 | 27 | | Name | Description | Example | 28 | | -------------------- | ------------------------------------------------- | ------------------------------------------------------------ | 29 | | `MANIFEST_URL` | Source address | https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git | 30 | | `MANIFEST_BRANCH` | Source branch | twrp-12.1 | 31 | | `DEVICE_TREE_URL` | Device address | https://github.com/TeamWin/android_device_asus_I003D | 32 | | `DEVICE_TREE_BRANCH` | Device branch | android-12.1 | 33 | | `DEVICE_PATH` | Device location | device/asus/I003D | 34 | | `COMMON_TREE_URL` | Common tree address | https://github.com/TeamWin/android_device_asus_sm8250-common | 35 | | `COMMON_PATH` | Common tree location | device/asus/sm8250-common | 36 | | `DEVICE_NAME` | Model name | I003D | 37 | | `MAKEFILE_NAME` | Makefile name | twrp_I003D | 38 | | `BUILD_TARGET` | Build Target Partition (boot/recovery/vendorboot) | recovery | 39 | 40 | ----- 41 | 42 | ## How to use 43 | 44 | ``` 45 | For example, your username is: JohnSmith 46 | ``` 47 | 48 | #### 0. If you want to commit code, click 'Fork' in the upper right corner of this repository 49 | 50 | ![image](https://user-images.githubusercontent.com/37921907/177914706-c92476c5-7e14-4fb3-be94-0c8a11dae874.png) 51 | 52 | #### 1. If you just want to use it simply, click 'Use this template' in the upper right corner of this repository 53 | 54 | ![image](https://github.com/azwhikaru/Action-TWRP-Builder/assets/37921907/fae6ce3c-bd4c-4bbe-8050-5dd29dff2522) 55 | 56 | #### 2. After waiting for the automatic redirection, you will see your own username 57 | 58 | ![image](https://user-images.githubusercontent.com/37921907/177915106-5bde6fc9-303c-479e-b290-22b48efd1e4e.png) 59 | 60 | #### 3. Change the [username and email](https://github.com/CaptainThrowback/Action-Recovery-Builder/blob/main/.github/workflows/Recovery%20Build.yml#L100-L101) in the workflow to reflect your Github credentials (optional) 61 | 62 | ## Setting up SSH Keys (optional) 63 | 64 | #### 4. Go to Settings, then select Deploy keys and select "Add deploy key" button. 65 | 66 | #### 5. On your Android device, install [Termux](https://github.com/termux/termux-app/releases) 67 | 68 | #### 6. Install openssh in Termux and generate ssh keys. (Do not use passphrase for keys) 69 | 70 | NOTE: When creating the deploy key for a repository like git@github.com:owner/repo.git or https://github.com/owner/repo, put that URL into the key comment. (Hint: Try ssh-keygen ... -C "git@github.com:owner/repo.git".) 71 | owner = your Github username 72 | 73 | ``` 74 | pkg install openssh 75 | ssh-keygen -t ed25519 -C "git@github.com:owner/Action-Recovery-Builder.git" 76 | ``` 77 | 78 | #### 7. Add the keys to your repo. In Termux, use the following commands: 79 | 80 | ``` 81 | cd /data/data/com.termux/files/usr/etc/ssh 82 | cat ssh_host_ed25519_key.pub 83 | ``` 84 | 85 | Select and copy the key then paste in the box for Key. 86 | You can name it whatever you choose for the title. 87 | 88 | #### 8. Now to add your private ssh key. Back in Termux: 89 | 90 | ``` 91 | cat ssh_host_ed25519_key 92 | ``` 93 | 94 | Copy the output from Termux. 95 | 96 | In your browser, select *Secrets* under the Security tab. 97 | Select Actions 98 | Select New repository secret 99 | For the New secret name, it should be SSH_PRIVATE_KEY 100 | Paste the output from ssh_host_ed25519_key into the Value box. 101 | Then select Add secret. 102 | 103 | ## Building the Recovery 104 | 105 | #### 9. Click 'Actions-Recovery Build' 106 | 107 | ![image](https://user-images.githubusercontent.com/37921907/177915304-8731ed80-1d49-48c9-9848-70d0ac8f2720.png) 108 | 109 | #### 10. Click 'Run workflow' and fill in according to the above 'parameter description' 110 | 111 | ![image](https://user-images.githubusercontent.com/37921907/177915346-71c29149-78fb-4a00-996f-5d84ffc9eb8c.png) 112 | 113 | #### 11. After filling in, click 'Run workflow' to start running 114 | 115 | ----- 116 | 117 | ## Compilation results 118 | 119 | Can be downloaded at [Release](../../releases) 120 | 121 | ----- 122 | -------------------------------------------------------------------------------- /scripts/convert.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$1" ] && [ -e $1 ]; then 4 | file=$1 5 | else 6 | echo " ** Input File : $1 does not exist" 7 | echo " ** Please specify the correct dependencies file" 8 | echo " ** Usage : bash []" 9 | exit 1 10 | fi 11 | 12 | if [ -n "$2" ]; then 13 | manifest_path="$2" 14 | elif [ -e .repo ]; then 15 | mkdir -p .repo/local_manifests 16 | manifest_path=".repo/local_manifests/roomservice.xml" 17 | else 18 | echo " ** Manifest file to create not specified." 19 | echo " ** And .repo folder does not exist in $PWD" 20 | echo " ** Either run the script from root of your source or specify a custom path+filename" 21 | echo " ** Usage : bash []" 22 | exit 1 23 | fi 24 | 25 | 26 | if [ -e $manifest_path ]; then 27 | sed -i 's@@@g' $manifest_path 28 | else 29 | echo "" > $manifest_path 30 | echo "" >> $manifest_path 31 | fi 32 | 33 | vars=( "remote" "repository" "target_path" "branch" "revision") 34 | 35 | for i in ${!vars[@]} ; do 36 | value=$(grep "${vars[$i]}" "$file" | cut -d '"' -f4) 37 | if [ "$value" != "" ]; then 38 | declare -a ${vars[$i]}"_val"="( $value )" 39 | fi 40 | done 41 | 42 | for i in {0..5}; do 43 | if [ "${repository_val[$i]}" != "" ] && [ "${target_path_val[$i]}" != "" ]; then 44 | target_path="path=\"${target_path_val[$i]}\"" 45 | repository=" name=\"${repository_val[$i]}\"" 46 | if [ "${remote_val[$i]}" != "" ]; then 47 | remote_for_repo=" remote=\"${remote_val[$i]}\"" 48 | fi 49 | if [ "${branch_val[$i]}" != "" ]; then 50 | revision=" revision=\"${branch_val[$i]}\"" 51 | elif [ "${revision_val[$i]}" != "" ]; then 52 | revision=" revision=\"${revision_val[$i]}\"" 53 | fi 54 | echo " " >> $manifest_path 55 | fi 56 | done 57 | 58 | echo "" >> $manifest_path 59 | --------------------------------------------------------------------------------