mcabber/hgcset.sh
author Mikael Berthe <mikael@lilotux.net>
Sat, 28 Aug 2021 23:02:24 +0200
changeset 2360 fef9f1a7d2aa
parent 2041 e8f2db654e67
permissions -rwxr-xr-x
Fix disco issue reported by Sam Whited IQ namespace is incorrect when responding to a disco#items request on the commands node.

#! /bin/sh

srcdir="$1"
builddir="$2"

if [ ! -f "$srcdir/logprint.h" ]; then
  echo "Unable to find mcabber sources!" >&2
  exit 1
fi

cd "$srcdir"

if which hg > /dev/null 2>&1; then
  cs=$(hg id 2> /dev/null | cut -d' ' -f1)
  if test $? -eq 0; then
    if [ x"$cs" != x ]; then
      grep -q "$cs" "$builddir/hgcset.h" > /dev/null 2>&1 || \
        echo "#define HGCSET \"$cs\"" > "$builddir/hgcset.h"
      exit 0
    fi
  fi
fi

echo > "$builddir/hgcset.h"