Commit e0627a7b authored by DerTeufel's avatar DerTeufel Committed by fire855
Browse files

add merge and push scripts, based off omnirom ones

parent 104e34a3
Loading
Loading
Loading
Loading

utils/aosp-forked-list

0 → 100644
+22 −0
Original line number Diff line number Diff line
build/make
build/soong
bionic
frameworks/av
frameworks/base
frameworks/native
frameworks/opt/datetimepicker
frameworks/opt/telephony
frameworks/support
hardware/interfaces
hardware/libhardware
packages/apps/DeskClock
packages/apps/Dialer
packages/apps/ExactCalculator
packages/apps/Messaging
packages/apps/Settings
packages/inputmethods/LatinIME
packages/services/Telecomm
system/bt
system/core
system/sepolicy
system/vold

utils/aosp-merge.sh

0 → 100644
+76 −0
Original line number Diff line number Diff line
#!/bin/bash
#
# Copyright (C) 2016 OmniROM Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
echo -e "Enter the AOSP ref to merge"
read ref

mad_branch="o-8.1.0"
branch_name=${ref}"-merge"
# echo $branch_name

cd ../../../

while read path;
    do

    project=`echo android_${path} | sed -e 's/\//\_/g'`
    aosp_project=${path}
    if [ "${project}" == "android_build_make" ] ; then
        project="android_build"
        aosp_project="build"
    fi

    if [ "${project}" == "android_frameworks_base" ] ; then
        remote="gitlab"
    else
        remote="bitbucket"
    fi

    echo ""
    echo "====================================================================="
    echo " PROJECT: ${project} -> [ ${path}/ ]"
    echo ""

    echo "Syncing local ..."
    #rm -fr $path;
    ret=$(repo sync -d -f --force-sync ${path} 2>&1);
    cd $path;

    # make sure that environment is clean
    ret=$(git merge --abort 2>&1);

    if git branch | grep ${branch_name} > /dev/null; then
        ret=$(git branch -D ${branch_name} > /dev/null 2>&1)
    fi

    echo "Merge with remote: https://android.googlesource.com/platform/${aosp_project} ${ref} ..."
    repo start ${branch_name} .
    ret=$(git pull https://android.googlesource.com/platform/$aosp_project ${ref} 2>&1)

    if echo $ret | grep "CONFLICT" > /dev/null ; then
        echo "------@@@@@@@@@@@@@@@@@@@@";
        echo $ret;
        echo "------@@@@@@@@@@@@@@@@@@@@";
    else
	ret=$(git branch -D ${mad_branch} > /dev/null 2>&1)
        ret=$(git checkout -t ${remote}/${mad_branch} > /dev/null 2>&1)
	ret=$(git merge ${branch_name} > /dev/null 2>&1)
        echo "* ${ref} merged!"
    fi

    cd - > /dev/null

done < vendor/mad/utils/aosp-forked-list

utils/push.sh

0 → 100644
+50 −0
Original line number Diff line number Diff line
#!/bin/bash
#
# Copyright (C) 2016 OmniROM Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

mad_branch="o-8.1.0"

cd ../../../

while read path;
    do

    project=`echo android_${path} | sed -e 's/\//\_/g'`
    if [ "${project}" == "android_build_make" ] ; then
        project="android_build"
    fi

    if [ "${project}" == "android_frameworks_base" ] ; then
        remote="gitlab"
    else
        remote="bitbucket"
    fi

    echo ""
    echo "====================================================================="
    echo " PROJECT: ${project} -> [ ${path}/ ]"
    echo ""

    cd $path;

    echo " Pushing..."
    echo " git push -u ${remote} ${mad_branch}"
    git push -u ${remote} ${mad_branch}
    echo ""

    cd - > /dev/null

done < vendor/mad/utils/aosp-forked-list