123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #!/bin/bash
- # Arguments = -r qtbase,qtdeclarative,...,qtxmlpatterns -f
- set -e
- usage()
- {
- cat << EOF
- usage: $0 options
- This script will download and sync tizen repos with upstream
- OPTIONS:
- -h Show this message
- -q QT_REPO_URL url qt rpm repository
- -p PROFILE_NAME Profile name
- -r GBS_BUILDROOT_PATH Path for GBS-ROOT
- -b BASE_REPO_URL Url of base rpm repository
- -m MAIN_REPO_URL Url of main rpm repository
- -f TEMPLATE_FILE Template filename
- -o OUTPUT_FILE output filename
-
- example:
- $0 -q http://download.qt-project.org/community_releases/tizen/1.0-alpha4/tizen2.2/emulator \
- -p mobile_2.2_emulator \
- -r /home/user/tizenbuildtools/emulator/GBS-ROOT \
- -b http://download.tizen.org/releases/2.2-emul/tizen-2.2-emul_20130719.2/repos/tizen-base/ia32/packages \
- -m http://download.tizen.org/releases/2.2-emul/tizen-2.2-emul_20130719.2/repos/tizen-main/ia32/packages \
- -f /home/user/tizenbuildtools/common/gbs.conf.template \
- -o /home/user/tizenbuildtools/emulator/mobile_2.2_emulator.conf
-
- EOF
- exit
- }
- QT_REPO_URL=""
- PROFILE_NAME=""
- GBS_BUILDROOT_PATH=""
- BASE_REPO_URL=""
- MAIN_REPO_URL=""
- TEMPLATE_FILE=""
- OUTPUT_FILE=""
- while getopts ":hq:p:r:m:b:f:o:" opt; do
- case $opt in
- h)
- usage
- ;;
- q)
- QT_REPO_URL="$OPTARG"
- ;;
- p)
- PROFILE_NAME="$OPTARG"
- ;;
- r)
- GBS_BUILDROOT_PATH="$OPTARG"
- ;;
- b)
- BASE_REPO_URL="$OPTARG"
- ;;
- m)
- MAIN_REPO_URL="$OPTARG"
- ;;
- f)
- TEMPLATE_FILE="$OPTARG"
- ;;
- o)
- OUTPUT_FILE="$OPTARG"
- ;;
- ?)
- echo "Invalid option: -$OPTARG"
- usage
- ;;
- esac
- done
- if [ "$PROFILE_NAME" == "" ]; then
- echo PROFILE_NAME can not be empty
- usage
- fi
- if [ "$GBS_BUILDROOT_PATH" == "" ]; then
- echo GBS_BUILDROOT_PATH can not be empty
- usage
- fi
- if [ "$BASE_REPO_URL" == "" ]; then
- echo BASE_REPO_URL can not be empty
- usage
- fi
- #if [ "$MAIN_REPO_URL" == "" ]; then
- # echo MAIN_REPO_URL can not be empty
- # usage
- #fi
- if [ "$TEMPLATE_FILE" == "" ]; then
- echo TEMPLATE_FILE can not be empty
- usage
- fi
- if [ "$OUTPUT_FILE" == "" ]; then
- echo OUTPUT_FILE can not be empty
- usage
- fi
- cp $TEMPLATE_FILE $OUTPUT_FILE
- sed -i "s!PROFILE_NAME_FOR_REPLACE!$PROFILE_NAME!gi" $OUTPUT_FILE
- if [ "$QT_REPO_URL" == "" ]; then
- sed -i "s!QT_REPOS_URL_FOR_REPLACE!$BASE_REPO_URL!gi" $OUTPUT_FILE
- else
- sed -i "s!QT_REPOS_URL_FOR_REPLACE!$QT_REPO_URL!gi" $OUTPUT_FILE
- fi
- if [ "$MAIN_REPO_URL" == "" ]; then
- sed -i "s!MAIN_REPO_FOR_REPLACE!$BASE_REPO_URL!gi" $OUTPUT_FILE
- else
- sed -i "s!MAIN_REPO_FOR_REPLACE!$MAIN_REPO_URL!gi" $OUTPUT_FILE
- fi
- sed -i "s!BASE_REPO_FOR_REPLACE!$BASE_REPO_URL!gi" $OUTPUT_FILE
- sed -i "s!GBS_BUILDROOT_FOR_REPLACE!$GBS_BUILDROOT_PATH!gi" $OUTPUT_FILE
|