mirror of
https://github.com/ceph/ceph
synced 2024-12-18 09:25:49 +00:00
a37c34debd
Support srcdir != . looking for .git in srcdir when computing the ceph release and git tag. Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
20 lines
361 B
Bash
Executable File
20 lines
361 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dname=`dirname $0`
|
|
|
|
if [ ! -d $dname/../.git ]; then
|
|
echo "not updating .git_version (no $dname/../.git)"
|
|
exit 0
|
|
fi
|
|
|
|
cur=`cd $dname && git rev-parse HEAD 2>/dev/null; git describe 2>/dev/null`
|
|
[ -e $1 ] && old=`cat $1`
|
|
|
|
if [ "$cur" != "$old" ]; then
|
|
echo regenerating $1 with $cur
|
|
echo "$cur" > $1
|
|
else
|
|
echo $1 is up to date.
|
|
fi
|
|
|