aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2023-03-08 10:10:05 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-03-10 15:38:46 +0000
commitd26daa5933a29934468fd4754737a6d2e2deb0dd (patch)
tree6392047a9f10c74c8c8a2a4db38461f2fc359a78
parent59f0f40d088555ff4a4273066d799e55e87db614 (diff)
scripts: improve layer update script
Use the envs available from repo and do exact replacements for both sha1 and refs. Skip update for meta-boot2qt. Print number of new commits and possible new tag. Change-Id: I3e6efe4bf58aa00070a81a19e9bf2c1caac4c53f Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io> Reviewed-by: Ari Parkkila <ari.parkkila@qt.io> (cherry picked from commit 9b5cb857eabd1b672ab48770003338892e3cb27d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rwxr-xr-xscripts/update-meta-layers.sh20
1 files changed, 13 insertions, 7 deletions
diff --git a/scripts/update-meta-layers.sh b/scripts/update-meta-layers.sh
index 1a495595..4c7f27df 100755
--- a/scripts/update-meta-layers.sh
+++ b/scripts/update-meta-layers.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
############################################################################
##
## Copyright (C) 2021 The Qt Company Ltd.
@@ -32,10 +32,16 @@
MANIFEST=$(dirname $(realpath $0))/manifest.xml
-repo sync $@ -n
-repo forall $@ -c "\
- OLD_REV=\$(grep -A2 \${REPO_PROJECT} ${MANIFEST} | grep revision | sed -e 's/.*\"\(.*\)\"/\1/') ; \
+REPOS=${@:-$(repo list -n)}
+REPOS=${REPOS//meta-boot2qt}
+
+repo sync $REPOS -n
+repo forall $REPOS -c "\
git checkout \$REPO_REMOTE/\$REPO_UPSTREAM ; \
- echo Changelog for \$REPO_PROJECT: ; \
- git log --pretty=format:'%h %s' --abbrev-commit \${OLD_REV}..HEAD ; \
- sed -i -e /\${REPO_PROJECT}/,/path/s/revision.*/revision=\\\"\$(git rev-parse HEAD)\\\"/ ${MANIFEST}"
+ echo \$REPO_PROJECT has \$(git rev-list --count \$REPO_LREV..HEAD) new commits; \
+ if [ \"\$(git describe --abbrev=0 \$REPO_LREV)\" != \"\$(git describe --abbrev=0 HEAD)\" ]; then \
+ echo \" new tag available: \$(git describe --abbrev=0 HEAD)\"; \
+ fi ; \
+ sed -e s/\$REPO_LREV/\$(git rev-parse HEAD)/ \
+ -e \"/\$REPO_PROJECT/,/revision/s|\$REPO_RREV|\$(git rev-parse HEAD)|\" \
+ -i ${MANIFEST}"