Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f24a18f7 authored by Koushik Dutta's avatar Koushik Dutta
Browse files

makerecipe: WIP to generate manifest branches for releases

Change-Id: I1804c180844043692f788275c8998307e348001b
parent 94ca1965
Loading
Loading
Loading
Loading
+29 −2
Original line number Diff line number Diff line
@@ -1168,10 +1168,14 @@ function cmremote()
    fi
    GERRIT_REMOTE=$(cat .git/config  | grep git://github.com | awk '{ print $NF }' | sed s#git://github.com/##g)
    if [ -z "$GERRIT_REMOTE" ]
    then
        GERRIT_REMOTE=$(cat .git/config  | grep http://github.com | awk '{ print $NF }' | sed s#http://github.com/##g)
        if [ -z "$GERRIT_REMOTE" ]
        then
          echo Unable to set up the git remote, are you in the root of the repo?
          return 0
        fi
    fi
    CMUSER=`git config --get review.review.cyanogenmod.com.username`
    if [ -z "$CMUSER" ]
    then
@@ -1181,6 +1185,29 @@ function cmremote()
    fi
    echo You can now push to "cmremote".
}
export -f cmremote

function makerecipe() {
  if [ -z "$1" ]
  then
    echo "No branch name provided."
    return 1
  fi
  cd android
  sed -i s/'default revision=.*'/'default revision="refs\/heads\/'$1'"'/ default.xml
  git commit -a -m "$1"
  cd ..

  repo forall -c '

  if [ "$REPO_REMOTE" == "github" ]
  then
    pwd
    cmremote
    git push cmremote HEAD:refs/heads/'$1'
  fi
  '
}

function cmgerrit() {
    if [ $# -eq 0 ]; then