aosp-merger: Make script output a bit more readable

Change-Id: Ia624f82dd19b7d6e7902eaec3584748db72a90b5
This commit is contained in:
Michael Bestas
2023-11-06 23:23:29 +02:00
committed by Michael Bestas
parent a045b16bfe
commit 7748a3c18d
8 changed files with 28 additions and 28 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -97,7 +97,7 @@ if [ ! -z "${OLDTAG}" ]; then
fi fi
if [[ "${OPERATION}" == "merge" ]]; then if [[ "${OPERATION}" == "merge" ]]; then
echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####" echo -e "\n#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
git merge --no-commit --log "${NEWTAG}" && git commit --no-edit git merge --no-commit --log "${NEWTAG}" && git commit --no-edit
# Check if we've actually changed anything after the merge # Check if we've actually changed anything after the merge
@@ -108,7 +108,7 @@ if [[ "${OPERATION}" == "merge" ]]; then
exit 0 exit 0
fi fi
elif [[ "${OPERATION}" == "rebase" ]]; then elif [[ "${OPERATION}" == "rebase" ]]; then
echo "#### Rebasing ${PROJECTPATH} onto ${NEWTAG} ####" echo -e "\n#### Rebasing ${PROJECTPATH} onto ${NEWTAG} ####"
git rebase --onto "${NEWTAG}" "${OLDTAG}" git rebase --onto "${NEWTAG}" "${OLDTAG}"
fi fi

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -98,7 +98,7 @@ fi
CONFLICT="" CONFLICT=""
echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####" echo -e "\n#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
git merge --no-commit --log "${NEWTAG}" git merge --no-commit --log "${NEWTAG}"
if [[ -z "$(git diff --no-ext-diff HEAD)" ]]; then if [[ -z "$(git diff --no-ext-diff HEAD)" ]]; then

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -59,10 +59,10 @@ STAGINGBRANCH="staging/${BRANCHSUFFIX}"
# Build list of forked repos # Build list of forked repos
PROJECTPATHS=$(grep "name=\"LineageOS/" "${MANIFEST}" | sed -n 's/.*path="\([^"]\+\)".*/\1/p') PROJECTPATHS=$(grep "name=\"LineageOS/" "${MANIFEST}" | sed -n 's/.*path="\([^"]\+\)".*/\1/p')
echo "#### Old tag = ${OLDTAG} Branch = ${BRANCH} Staging branch = ${STAGINGBRANCH} ####" echo -e "\n#### Old tag = ${OLDTAG} Branch = ${BRANCH} Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -59,10 +59,10 @@ STAGINGBRANCH="staging/${BRANCHSUFFIX}"
# Build list of AOSP repos # Build list of AOSP repos
PROJECTPATHS=$(grep -v "remote=\"gitlab" "${MANIFEST}" | grep -v "clone-depth=\"1" | sed -n 's/.*path="\([^"]\+\)".*/\1/p') PROJECTPATHS=$(grep -v "remote=\"gitlab" "${MANIFEST}" | grep -v "clone-depth=\"1" | sed -n 's/.*path="\([^"]\+\)".*/\1/p')
echo "#### Old tag = ${OLDTAG} New tag = ${NEWTAG} Staging branch = ${STAGINGBRANCH} ####" echo -e "\n#### Old tag = ${OLDTAG} New tag = ${NEWTAG} Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -49,10 +49,10 @@ source "${TOP}/build/envsetup.sh"
# List of merged repos # List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}') PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Staging branch = ${STAGINGBRANCH} ####" echo -e "\n#### Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then
@@ -62,7 +62,7 @@ for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
done done
echo "#### Verification complete - no uncommitted changes found ####" echo "#### Verification complete - no uncommitted changes found ####"
echo "#### $(basename ${MERGEDREPOS}) ####" echo -e "\n#### $(basename ${MERGEDREPOS}) ####"
read -p "Pushing ${STAGINGBRANCH}. Press enter to confirm." read -p "Pushing ${STAGINGBRANCH}. Press enter to confirm."
# Iterate over each forked project # Iterate over each forked project
@@ -78,7 +78,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do
fi fi
fi fi
echo "#### Submitting ${PROJECTPATH} merge ####" echo -e "\n#### Submitting ${PROJECTPATH} merge ####"
git checkout "${STAGINGBRANCH}" git checkout "${STAGINGBRANCH}"
lineageremote | grep -v "Remote 'lineage' created" lineageremote | grep -v "Remote 'lineage' created"
git push lineage HEAD:refs/heads/"${BRANCH}" git push lineage HEAD:refs/heads/"${BRANCH}"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -54,10 +54,10 @@ fi
# List of merged repos # List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}') PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Branch = ${BRANCH} Squash branch = ${SQUASHBRANCH} ####" echo -e "\n#### Branch = ${BRANCH} Squash branch = ${SQUASHBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then
@@ -70,7 +70,7 @@ echo "#### Verification complete - no uncommitted changes found ####"
# Iterate over each forked project # Iterate over each forked project
for PROJECTPATH in ${PROJECTPATHS}; do for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
echo "#### Squashing ${PROJECTPATH} ####" echo -e "\n#### Squashing ${PROJECTPATH} ####"
repo abandon "${SQUASHBRANCH}" . repo abandon "${SQUASHBRANCH}" .
git checkout -b "${SQUASHBRANCH}" "${STAGINGBRANCH}" git checkout -b "${SQUASHBRANCH}" "${STAGINGBRANCH}"
git branch --set-upstream-to=m/"${BRANCH}" git branch --set-upstream-to=m/"${BRANCH}"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -59,10 +59,10 @@ source "${TOP}/build/envsetup.sh"
# List of merged repos # List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}') PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Staging branch = ${STAGINGBRANCH} ####" echo -e "\n#### Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then
@@ -85,7 +85,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do
fi fi
fi fi
echo "#### Pushing ${PROJECTPATH} merge to review ####" echo -e "\n#### Pushing ${PROJECTPATH} merge to review ####"
git checkout "${STAGINGBRANCH}" git checkout "${STAGINGBRANCH}"
lineageremote | grep -v "Remote 'lineage' created" lineageremote | grep -v "Remote 'lineage' created"
FIRST_SHA="$(git show -s --pretty=%P HEAD | cut -d ' ' -f 1)" FIRST_SHA="$(git show -s --pretty=%P HEAD | cut -d ' ' -f 1)"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project # SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute # SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
# #
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@@ -56,10 +56,10 @@ fi
# List of merged repos # List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}') PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Squash branch = ${SQUASHBRANCH} ####" echo -e "\n#### Squash branch = ${SQUASHBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state # Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####" echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then if [[ -n "$(git status --porcelain)" ]]; then
@@ -72,7 +72,7 @@ echo "#### Verification complete - no uncommitted changes found ####"
# Iterate over each forked project # Iterate over each forked project
for PROJECTPATH in ${PROJECTPATHS}; do for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}" cd "${TOP}/${PROJECTPATH}"
echo "#### Pushing ${PROJECTPATH} squash to review ####" echo -e "\n#### Pushing ${PROJECTPATH} squash to review ####"
git checkout "${SQUASHBRANCH}" git checkout "${SQUASHBRANCH}"
repo upload -c -y --no-verify -o topic="${TOPIC}" . repo upload -c -y --no-verify -o topic="${TOPIC}" .
done done