Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- cmversion=13.0
- #twrpversion=6.0
- tags='+(linaro|twrp)'
- shopt -s extglob
- while [ $# -gt 0 ]; do
- case $1 in
- careful) careful="true"; set -e;;
- $tags) eval $1="true";;
- 11.0|cm-11.0) cmversion=11.0;; #twrpversion=4.4;;
- 12.0|cm-12.0) cmversion=12.0;; #twrpversion=5.0;;
- 12.1|cm-12.1) cmversion=12.1;; #twrpversion=5.1;;
- 13.0|cm-13.0) cmversion=13.0;; #twrpversion=6.0;;
- *) ;;
- esac
- shift
- done
- source build/envsetup.sh > /dev/null
- rm -f ~/.bin/repopicks-tmp
- touch ~/.bin/repopicks-tmp
- while read line; do
- if [[ ${line:0:1} == '#' ]] || [ "$line" == "" ]; then
- echo $line >> ~/.bin/repopicks-tmp
- continue
- fi
- p=`echo $line | awk '{print $1}'`
- if [ "$p" != "skip" ]; then
- output=`repopick $p`
- if [[ "$output" != "${output/'Skipping the cherry pick'}" ]]; then
- if [[ "$output" != "${output/'Change status is MERGED. Skipping the cherry pick'}" ]]; then
- echo "removing $p from the script"
- /home/dp/.bin/email "build@invisiblek.org" "dan.pasanen@gmail.com" "Merged cherry pick removed from auto pick script" "\n\n$line" "invisiblek.org" "build@invisiblek.org"
- continue
- else
- repopick -f $p
- fi
- fi
- fi
- echo $line >> ~/.bin/repopicks-tmp
- echo ""
- done < ~/.bin/repopicks-$cmversion
- # sed -i '/^\s*$/d' ~/.bin/repopicks-tmp
- cp ~/.bin/repopicks-tmp ~/.bin/repopicks-$cmversion
- rm -f ~/.bin/repopicks-tmp
- while read line; do
- [[ ${line:0:1} == '#' ]] && continue;
- [ "$line" == "" ] && continue
- dir=`echo $line | awk '{print $1}'`
- case $dir in
- skip) continue;;
- $tags) if [[ $(eval echo \$$dir) == "true" ]]; then
- dir=`echo $line | awk '{print $2}'`
- commit=`echo $line | awk '{print $3}'`
- else
- continue;
- fi;;
- *) commit=`echo $line | awk '{print $2}'`;;
- esac
- cd $dir
- [ "$careful" == "true" ] && set +e
- git fetch blek
- [ "$careful" == "true" ] && set -e
- git cherry-pick $commit
- cd -
- done < ~/.bin/cherrypicks-$cmversion
- if [ "$twrp" == "true" ]; then
- dirs=(
- device/hp/tenderloin \
- device/htc/dlx \
- device/htc/msm8974-common \
- device/lge/d850 \
- device/lge/d851 \
- device/lge/d852 \
- device/lge/d855 \
- device/lge/g2-common \
- device/lge/g3-common \
- device/lge/g4-common \
- device/lge/ls990 \
- device/lge/v4xx-common \
- device/lge/vk810 \
- device/lge/vs985 \
- device/motorola/msm8916-common \
- device/motorola/victara \
- device/samsung/d2-common \
- device/samsung/jf-common \
- kernel/lge/v4xx \
- vendor/extra \
- vendor/cm \
- )
- for i in ${dirs[@]}; do
- cd $i
- git fetch blek
- git cherry-pick `git log blek/cm-"$cmversion"_twrp | head -1 | awk '{print $2}'`
- cd -
- done
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement