timescaledb/scripts/generate_typedefs.sh.in
David Kohn 55a7141953 Implement a cluster-wide launcher for background workers
The launcher controls how Timescale DB schedulers for each database are stopped/started
both at server start time and if they are started or stopped while the server is running
which can happen when, say, an update of the extension is performed.
Includes tests for multiple types of behavior within the launcher, but only a mock for the
db schedulers which will be dealt with in future commits. This launcher code is mostly in the loader,
as such it must remain backwards compatible for the foreseeable future, so significant thought and design
has gone into making interactions with this code well defined and consistent so that maintaining
backwards compatibility is relatively easy.
2018-09-10 13:29:59 -04:00

22 lines
753 B
Bash
Executable File

#!/bin/bash
if [ ! -x "@OBJDUMP@" ];
then
echo "Cannot generate typedefs.list for pgindent because objdump is not installed" >&2
exit 1
fi
TMPDIR=${TMPDIR:-$(mktemp -d 2>/dev/null || mktemp -d -t 'timescaledb_typedef')}
trap cleanup EXIT
cleanup() {
rm -rf ${TMPDIR}
}
@OBJDUMP@ -W `find @CMAKE_BINARY_DIR@ -not -path '*/\.*' -name *.o` | egrep -A3 DW_TAG_typedef |perl -e 'while (<>) { chomp; @flds = split;next unless (1 < @flds);\
next if $flds[0] ne "DW_AT_name" && $flds[1] ne "DW_AT_name";\
next if $flds[-1] =~ /^DW_FORM_str/;\
print $flds[-1],"\n"; }' |sort |uniq > ${TMPDIR}/typedefs.list.local
wget -q -O - "http://www.pgbuildfarm.org/cgi-bin/typedefs.pl?branch=HEAD" |\
cat - ${TMPDIR}/typedefs.list.local | sort | uniq