summaryrefslogtreecommitdiff
path: root/offapi/type_reference/update-rdb.sh
blob: 18ddc21412cd51b165d9a54ff8330481444de14d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash

# Basic argument checks
if [ $# -lt 1 ]
then
  echo "usage:"
  echo "    $0 <idl file list>"
  echo ""
  echo "example:"
  echo "    $0 \\"
  echo "      offapi/com/sun/star/auth/SSOManagerFactory.idl \\"
  echo "      offapi/com/sun/star/auth/SSOPasswordCache.idl"
  exit 1
fi

# Load env vars
source "$(dirname "$0")"/../../config_host.mk 2>/dev/null

set -e
mkdir tmp
for i in "$@"; do
  "${OUTDIR_FOR_BUILD?}"/bin/regmerge tmp/out1.rdb /UCR \
    "${WORKDIR_FOR_BUILD?}"/UnoApiPartTarget/"${i%.idl}".urd
done
"${OUTDIR_FOR_BUILD?}"/bin/regmerge tmp/out2.rdb / \
  "${SRC_ROOT?}"/offapi/type_reference/types.rdb tmp/out1.rdb
echo "sanity check diff:"
diff <("${OUTDIR_FOR_BUILD?}"/bin/regview \
  "${SRC_ROOT?}"/offapi/type_reference/types.rdb) \
  <("${OUTDIR_FOR_BUILD?}"/bin/regview tmp/out2.rdb) && $? -le 1
mv tmp/out2.rdb "${SRC_ROOT?}"/offapi/type_reference/types.rdb
rm -r tmp