From 842bdc50c67f64fa76fe4c6cad389a2630768aee Mon Sep 17 00:00:00 2001 From: lihui Date: Sun, 9 Feb 2020 12:07:59 +0800 Subject: [PATCH] [modify pkg name] --- packaging/deb/makedeb.sh | 2 +- packaging/rpm/makerpm.sh | 2 +- packaging/tools/makeclient.sh | 2 +- packaging/tools/makepkg.sh | 4 ++-- src/util/src/ttime.c | 39 ++++++++++++++++++++++++++++++++++- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index 92734cb980..faa29aeac8 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -73,7 +73,7 @@ sed -i "2c$debver" ${pkg_dir}/DEBIAN/control if [ "$verMode" == "cluster" ]; then debname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - debname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} + debname="TDengine-server"-${tdengine_ver}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/rpm/makerpm.sh b/packaging/rpm/makerpm.sh index 20b7d5f755..cc31a6b8d4 100755 --- a/packaging/rpm/makerpm.sh +++ b/packaging/rpm/makerpm.sh @@ -66,7 +66,7 @@ cp_rpm_package ${pkg_dir}/RPMS if [ "$verMode" == "cluster" ]; then rpmname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - rpmname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} + rpmname="TDengine-server"-${tdengine_ver}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index 34dacbc9f3..58ce6183c1 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -111,7 +111,7 @@ cd ${release_dir} if [ "$verMode" == "cluster" ]; then pkg_name=${install_dir}-${version}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} + pkg_name=${install_dir}-${version}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index e0cd65a00e..1b095a4c76 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -111,7 +111,7 @@ cd ${release_dir} if [ "$verMode" == "cluster" ]; then pkg_name=${install_dir}-${version}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} + pkg_name=${install_dir}-${version}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 @@ -128,4 +128,4 @@ fi tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : -cd ${curr_dir} \ No newline at end of file +cd ${curr_dir} diff --git a/src/util/src/ttime.c b/src/util/src/ttime.c index 52faa0cac4..1408d1678f 100644 --- a/src/util/src/ttime.c +++ b/src/util/src/ttime.c @@ -24,7 +24,43 @@ #include "ttime.h" #include "tutil.h" +/* + * mktime64 - Converts date to seconds. + * Converts Gregorian date to seconds since 1970-01-01 00:00:00. + * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 + * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. + * + * [For the Julian calendar (which was used in Russia before 1917, + * Britain & colonies before 1752, anywhere else before 1582, + * and is still in use by some communities) leave out the + * -year/100+year/400 terms, and add 10.] + * + * This algorithm was first published by Gauss (I think). + * + * A leap second can be indicated by calling this function with sec as + * 60 (allowable under ISO 8601). The leap second is treated the same + * as the following second since they don't exist in UNIX time. + * + * An encoding of midnight at the end of the day as 24:00:00 - ie. midnight + * tomorrow - (allowable under ISO 8601) is supported. + */ +int64_t mktime64(const unsigned int year0, const unsigned int mon0, + const unsigned int day, const unsigned int hour, + const unsigned int min, const unsigned int sec) +{ + unsigned int mon = mon0, year = year0; + + /* 1..12 -> 11,12,1..10 */ + if (0 >= (int) (mon -= 2)) { + mon += 12; /* Puts Feb last since it has leap day */ + year -= 1; + } + int64_t res = (((((int64_t) (year/4 - year/100 + year/400 + 367*mon/12 + day) + + year*365 - 719499)*24 + hour)*60 + min)*60 + sec); + + return (res + timezone); +} // ==== mktime() kernel code =================// static int64_t m_deltaUtc = 0; void deltaToUtcInitOnce() { @@ -293,7 +329,8 @@ int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec) { /* mktime will be affected by TZ, set by using taos_options */ //int64_t seconds = mktime(&tm); - int64_t seconds = (int64_t)user_mktime(&tm); + //int64_t seconds = (int64_t)user_mktime(&tm); + int64_t seconds = mktime64(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); int64_t fraction = 0; -- GitLab