git: 88a97c47423c - main - Tools/scripts/tindex: update for git
Rene Ladan
rene at FreeBSD.org
Tue Apr 6 09:03:33 UTC 2021
The branch main has been updated by rene:
URL: https://cgit.FreeBSD.org/ports/commit/?id=88a97c47423cfefc85efd108ec31cadef59c19af
commit 88a97c47423cfefc85efd108ec31cadef59c19af
Author: Rene Ladan <rene at FreeBSD.org>
AuthorDate: 2021-04-06 09:01:21 +0000
Commit: Rene Ladan <rene at FreeBSD.org>
CommitDate: 2021-04-06 09:01:21 +0000
Tools/scripts/tindex: update for git
Reviewed by: uqs
Differential Revision: https://reviews.freebsd.org/D29451
---
Tools/scripts/tindex | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/Tools/scripts/tindex b/Tools/scripts/tindex
index 9fe704f159e6..9adbfc4e7b80 100755
--- a/Tools/scripts/tindex
+++ b/Tools/scripts/tindex
@@ -6,7 +6,7 @@
# that 'make fetchindex' sees it.
#
# When INDEX is broken, assemble the list of committers who touched files
-# on the most recent 'svn update', and put those committers "on the hook".
+# on the most recent 'git pull', and put those committers "on the hook".
# These committers all stay on the hook until INDEX is buildable again.
#
# MAINTAINER= portmgr at FreeBSD.org
@@ -44,10 +44,7 @@ fi
blame() {
# Find out who is responsible for current version of file $1
- # Fastest way to extract is from svn info
- who=$(${SVN} info $1 2>/dev/null | grep '^Last Changed Author' | awk '{print $4}')
-
- echo $who
+ git log --no-patch --max-count=1 --format='%ce' $1
}
indexfail() {
@@ -78,7 +75,7 @@ indexfail() {
# Find out which committers are on the hook
- commits=$(grep ^U ${PORTSDIR}/svn.log | grep -v INDEX | awk '{print $2}')
+ commits=$(${GIT} diff --name-only ${OLD_HEAD})
for i in ${commits}; do
blame $i >> ${PORTSDIR}/hook
done
@@ -89,8 +86,8 @@ indexfail() {
tr -s '\n' ' ' < ${PORTSDIR}/hook
echo
echo
- echo "Most recent SVN update was:";
- grep -v '/work$' svn.log | grep -v '^\?'
+ echo "Most recent Git update was:";
+ (IFS=""; echo ${commits})
) | mail -s "INDEX build failed for ${BRANCH}" ${REPORT_ADDRESS}
exit 1
}
@@ -131,10 +128,10 @@ OSVERSION14=$(awk '/^#define[[:blank:]]__FreeBSD_version/ {print $3}' < ${SRCDIR
cd ${PORTSDIR}
rm -f INDEX-11 INDEX-11.bz2 INDEX-12 INDEX-12.bz2 INDEX-13 INDEX-13.bz2 INDEX-14 INDEX-14.bz2
-(${SVN} up 2>1 ) > svn.log
-if grep -q ^C svn.log ; then
- (echo "svn update failed with conflicts:";
- grep ^C svn.log) | mail -s "Ports svn up failed" ${ERROR_ADDRESS}
+OLD_HEAD=$(${GIT} rev-parse HEAD)
+if ! ${GIT} pull --ff-only > git.log 2>&1 ; then
+ (echo "Git update failed with conflicts:";
+ cat git.log) | mail -s "Ports Git update failed" ${ERROR_ADDRESS}
exit 1
fi
@@ -148,7 +145,7 @@ for branch in 11.x 12.x 13.x 14.x; do
echo "Building INDEX for ${branch} with OSVERSION=${OSVERSION}"
cd ${PORTSDIR}
- ((make index 2> index.err) > index.out) || indexfail ${branch}
+ ( (make index 2> index.err) > index.out) || indexfail ${branch}
if [ -s index.err ]; then
indexfail ${branch}
fi
More information about the dev-commits-ports-all
mailing list