summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/third_party_build/commit-build-file-changes.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /dom/media/webrtc/third_party_build/commit-build-file-changes.sh
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/webrtc/third_party_build/commit-build-file-changes.sh')
-rw-r--r--dom/media/webrtc/third_party_build/commit-build-file-changes.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/media/webrtc/third_party_build/commit-build-file-changes.sh b/dom/media/webrtc/third_party_build/commit-build-file-changes.sh
new file mode 100644
index 0000000000..b6bf1cd4e1
--- /dev/null
+++ b/dom/media/webrtc/third_party_build/commit-build-file-changes.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+function show_error_msg()
+{
+ echo "*** ERROR *** $? line $1 $0 did not complete successfully!"
+ echo "$ERROR_HELP"
+}
+ERROR_HELP=""
+
+# Print an Error message if `set -eE` causes the script to exit due to a failed command
+trap 'show_error_msg $LINENO' ERR
+
+# All commands should be printed as they are executed
+# set -x
+
+# After this point:
+# * eE: All commands should succede.
+# * u: All variables should be defined before use.
+# * o pipefail: All stages of all pipes should succede.
+set -eEuo pipefail
+
+MOZ_BUILD_CHANGE_CNT=`hg status --include="**moz.build" third_party/libwebrtc | wc -l | tr -d " "`
+echo "MOZ_BUILD_CHANGE_CNT: $MOZ_BUILD_CHANGE_CNT"
+if [ "x$MOZ_BUILD_CHANGE_CNT" != "x0" ]; then
+ CURRENT_COMMIT_SHA=`hg id -i | sed 's/+//'`
+ COMMIT_DESC=`hg --config alias.log=log log -T '{desc|firstline}' -r $CURRENT_COMMIT_SHA`
+
+ # since we have build file changes, touch the CLOBBER file
+ cat CLOBBER | egrep "^#|^$" > CLOBBER.new
+ mv CLOBBER.new CLOBBER
+ echo "Modified build files in third_party/libwebrtc - $COMMIT_DESC" >> CLOBBER
+
+ ADD_CNT=`hg status --include="**moz.build" -nu third_party/libwebrtc | wc -l | tr -d " "`
+ DEL_CNT=`hg status --include="**moz.build" -nd third_party/libwebrtc | wc -l | tr -d " "`
+ if [ "x$ADD_CNT" != "x0" ]; then
+ hg status --include="**moz.build" -nu third_party/libwebrtc | xargs hg add
+ fi
+ if [ "x$DEL_CNT" != "x0" ]; then
+ hg status --include="**moz.build" -nd third_party/libwebrtc | xargs hg rm
+ fi
+
+ hg commit -m \
+ "$COMMIT_DESC - moz.build file updates" \
+ --include="**moz.build" --include="CLOBBER" third_party/libwebrtc CLOBBER
+fi
+
+echo "Done in $0"