2015-06-21 17:33:46 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Print the current source revision, if available
|
|
|
|
|
2020-04-08 17:41:55 +02:00
|
|
|
SDL_ROOT=$(dirname $0)/..
|
|
|
|
cd $SDL_ROOT
|
|
|
|
|
2021-02-12 17:50:16 +01:00
|
|
|
if [ -x "$(command -v git)" ]; then
|
|
|
|
rev=$(echo "$(git remote get-url origin 2>/dev/null)@$(git rev-list HEAD~.. 2>/dev/null)")
|
|
|
|
if [ "$rev" != "@" ]; then
|
2020-04-08 17:41:55 +02:00
|
|
|
echo $rev
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x "$(command -v p4)" ]; then
|
|
|
|
rev="$(p4 changes -m1 ./...\#have 2>/dev/null| awk '{print $2}')"
|
2020-04-29 17:32:08 +02:00
|
|
|
if [ $? = 0 ]; then
|
2020-04-08 17:41:55 +02:00
|
|
|
echo $rev
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-02-12 17:50:16 +01:00
|
|
|
echo ""
|
2020-04-08 17:41:55 +02:00
|
|
|
exit 1
|