Advertisement
Guest User

Untitled

a guest
Dec 17th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. cmversion=13.0
  4. #twrpversion=6.0
  5. tags='+(linaro|twrp)'
  6.  
  7. shopt -s extglob
  8. while [ $# -gt 0 ]; do
  9. case $1 in
  10. careful) careful="true"; set -e;;
  11. $tags) eval $1="true";;
  12. 11.0|cm-11.0) cmversion=11.0;; #twrpversion=4.4;;
  13. 12.0|cm-12.0) cmversion=12.0;; #twrpversion=5.0;;
  14. 12.1|cm-12.1) cmversion=12.1;; #twrpversion=5.1;;
  15. 13.0|cm-13.0) cmversion=13.0;; #twrpversion=6.0;;
  16. *) ;;
  17. esac
  18. shift
  19. done
  20.  
  21. source build/envsetup.sh > /dev/null
  22. rm -f ~/.bin/repopicks-tmp
  23. touch ~/.bin/repopicks-tmp
  24.  
  25. while read line; do
  26. if [[ ${line:0:1} == '#' ]] || [ "$line" == "" ]; then
  27. echo $line >> ~/.bin/repopicks-tmp
  28. continue
  29. fi
  30.  
  31. p=`echo $line | awk '{print $1}'`
  32.  
  33. if [ "$p" != "skip" ]; then
  34. output=`repopick $p`
  35. if [[ "$output" != "${output/'Skipping the cherry pick'}" ]]; then
  36. if [[ "$output" != "${output/'Change status is MERGED. Skipping the cherry pick'}" ]]; then
  37. echo "removing $p from the script"
  38. /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"
  39. continue
  40. else
  41. repopick -f $p
  42. fi
  43. fi
  44. fi
  45. echo $line >> ~/.bin/repopicks-tmp
  46. echo ""
  47. done < ~/.bin/repopicks-$cmversion
  48.  
  49. # sed -i '/^\s*$/d' ~/.bin/repopicks-tmp
  50. cp ~/.bin/repopicks-tmp ~/.bin/repopicks-$cmversion
  51. rm -f ~/.bin/repopicks-tmp
  52.  
  53. while read line; do
  54. [[ ${line:0:1} == '#' ]] && continue;
  55. [ "$line" == "" ] && continue
  56.  
  57. dir=`echo $line | awk '{print $1}'`
  58.  
  59. case $dir in
  60. skip) continue;;
  61. $tags) if [[ $(eval echo \$$dir) == "true" ]]; then
  62. dir=`echo $line | awk '{print $2}'`
  63. commit=`echo $line | awk '{print $3}'`
  64. else
  65. continue;
  66. fi;;
  67. *) commit=`echo $line | awk '{print $2}'`;;
  68. esac
  69.  
  70. cd $dir
  71. [ "$careful" == "true" ] && set +e
  72. git fetch blek
  73. [ "$careful" == "true" ] && set -e
  74. git cherry-pick $commit
  75. cd -
  76. done < ~/.bin/cherrypicks-$cmversion
  77.  
  78. if [ "$twrp" == "true" ]; then
  79. dirs=(
  80. device/hp/tenderloin \
  81. device/htc/dlx \
  82. device/htc/msm8974-common \
  83. device/lge/d850 \
  84. device/lge/d851 \
  85. device/lge/d852 \
  86. device/lge/d855 \
  87. device/lge/g2-common \
  88. device/lge/g3-common \
  89. device/lge/g4-common \
  90. device/lge/ls990 \
  91. device/lge/v4xx-common \
  92. device/lge/vk810 \
  93. device/lge/vs985 \
  94. device/motorola/msm8916-common \
  95. device/motorola/victara \
  96. device/samsung/d2-common \
  97. device/samsung/jf-common \
  98. kernel/lge/v4xx \
  99. vendor/extra \
  100. vendor/cm \
  101. )
  102.  
  103. for i in ${dirs[@]}; do
  104. cd $i
  105. git fetch blek
  106. git cherry-pick `git log blek/cm-"$cmversion"_twrp | head -1 | awk '{print $2}'`
  107. cd -
  108. done
  109. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement