remove older script that generated tz data

This commit is contained in:
bharatnc 2020-08-19 12:51:14 -07:00 committed by Alexey Milovidov
parent a0a566bcf7
commit a44a90fe99
3 changed files with 2 additions and 61 deletions

View File

@ -1,8 +1,6 @@
# The file StorageSystemContributors.generated.cpp is generated at release time and committed to the source tree.
# The file StorageSystemContributors.cpp is generated at release time and committed to the source tree.
# You can also regenerate it manually this way:
# execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/StorageSystemContributors.sh)
# Similarly StorageSystemTimeZone.generated.cpp is also generated during release time
# execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/StorageSystemTimeZone.sh)
set (CONFIG_BUILD ${CMAKE_CURRENT_BINARY_DIR}/StorageSystemBuildOptions.generated.cpp)
get_property (BUILD_COMPILE_DEFINITIONS DIRECTORY ${ClickHouse_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS)
@ -24,18 +22,11 @@ add_custom_target(generate-contributors
# BYPRODUCTS StorageSystemContributors.generated.cpp
)
add_custom_target(generate-time-zones
./StorageSystemTimeZones.sh
SOURCES StorageSystemTimeZones.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# BYPRODUCTS StorageSystemTimeZones.generated.cpp
)
if(NOT TARGET generate-source)
add_custom_target(generate-source)
endif()
add_dependencies(generate-source generate-contributors generate-time-zones)
add_dependencies(generate-source generate-contributors)
set(GENERATED_LICENSES_SRC ${CMAKE_CURRENT_BINARY_DIR}/StorageSystemLicenses.generated.cpp)

View File

@ -1,49 +0,0 @@
#!/usr/bin/env bash
set -x
# doesn't actually cd to directory, but return absolute path
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# cd to directory
cd $CUR_DIR
TIMEZONES_FILE=${TIMEZONES_FILE=$CUR_DIR/StorageSystemTimeZones.generated.cpp}
# if there are older files present, remove them so that fresh ones will be generated.
if [ ! -s $TIMEZONES_FILE.tmp || -s $TIMEZONES_FILE ]; then
echo "Removing existing file $TIMEZONES_FILE & $TIMEZONES_FILE.tmp"
rm $TIMEZONES_FILE $TIMEZONES_FILE.tmp
fi
# Script will be run from $CUR_DIR i.e ClickHouse/src/Storages/System/StorageSystemTimeZones.sh
# Timezones are located under ClickHouse/contrib/cctz/testdata/zoneinfo so:
# * run find in target directory (Ignore *.tab files)
# * split by path '/' and extract timezone information
# (i.e everything after ClickHouse/contrib/cctz/testdata/zoneinfo/testdata/ namely America/*, Africa/* etc...)
# * remove empty lines and sort
TIMEZONES=$(find ../../../contrib/cctz/testdata/zoneinfo ! -name '*.tab' | cut -d'/' -f8- | sed '/^$/d' | sort)
# List of timezones are obtained from parsing the directory tree under ClickHouse/contrib/cctz/testdata/zoneinfo
# This is to remove top level dir names which are not valid timezones - ie. Pacific/Truk is a valid timezone but not Pacific.
for TZ in $TIMEZONES ;
do
if [[ $TZ == */* ]] ;
then
echo ' "'$TZ'",' >> $TIMEZONES_FILE.tmp
fi
done;
# If timezones are not available, don't generate the target file
if [ ! -s $TIMEZONES_FILE.tmp ]; then
echo List of timezones are empty
rm $TIMEZONES_FILE.tmp
exit
fi
echo "// autogenerated by $0" > $TIMEZONES_FILE
echo "const char * auto_time_zones[] {" >> $TIMEZONES_FILE
cat $TIMEZONES_FILE.tmp >> $TIMEZONES_FILE
echo -e " nullptr};" >> $TIMEZONES_FILE
echo "Collected `cat TIMEZONES_FILE.tmp | wc -l` timezones."
rm $TIMEZONES_FILE.tmp

View File

@ -102,7 +102,6 @@ function gen_revision_author {
gen_changelog "$VERSION_STRING" "" "$AUTHOR" ""
gen_dockerfiles "$VERSION_STRING"
src/Storages/System/StorageSystemContributors.sh ||:
src/Storages/System/StorageSystemTimeZones.sh ||:
utils/list-versions/list-versions.sh > utils/list-versions/version_date.tsv
git commit -m "$auto_message [$VERSION_STRING] [$VERSION_REVISION]" cmake/autogenerated_versions.txt debian/changelog docker/*/Dockerfile src/Storages/System/StorageSystemContributors.generated.cpp utils/list-versions/version_date.tsv