From 339d963f90d10d92781414b6ec7f5b8aaa66831d Mon Sep 17 00:00:00 2001 From: Bryan Kowal Date: Wed, 21 Mar 2012 16:49:38 -0500 Subject: [PATCH] Issue #19 - fix ldm so that it will handle both date and sequence substitutions correctly. Former-commit-id: 8a4c883e0bfdd253b5193b20e20fc55d0445c1d3 [formerly 8a4c883e0bfdd253b5193b20e20fc55d0445c1d3 [formerly efc134f920b0cc0e493d74f1bb14b22fdc8013ca]] Former-commit-id: 31f989ecb4b324d1ee718885e1f7a274bb26d93b Former-commit-id: 81a360d1398b2084186c390f1dae3e457436edf2 --- rpms/awips2.core/Installer.ldm/component.spec | 10 ++++- .../Installer.ldm/src/ldm-6.8.1.patch2 | 42 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 rpms/awips2.core/Installer.ldm/src/ldm-6.8.1.patch2 diff --git a/rpms/awips2.core/Installer.ldm/component.spec b/rpms/awips2.core/Installer.ldm/component.spec index cd24da758a..b91feafe9b 100644 --- a/rpms/awips2.core/Installer.ldm/component.spec +++ b/rpms/awips2.core/Installer.ldm/component.spec @@ -5,7 +5,7 @@ Name: awips2-ldm Summary: AWIPS II LDM Distribution Version: 6.8.1 -Release: 18 +Release: 19 Group: AWIPSII BuildRoot: /tmp URL: N/A @@ -65,6 +65,9 @@ cp ${WORKSPACE_DIR}/${LDM_TAR_DIR}/ldm-6.8.1.patch0 \ # Copy patch1 to the build directory. cp ${WORKSPACE_DIR}/${LDM_TAR_DIR}/ldm-6.8.1.patch1 \ ${LDM_BUILD_DIR} +# Copy patch2 to the build directory. +cp ${WORKSPACE_DIR}/${LDM_TAR_DIR}/ldm-6.8.1.patch2 \ + ${LDM_BUILD_DIR} cd ${LDM_BUILD_DIR} tar -xvf ${LDM_TAR_FILE} # remove the copied tar file @@ -81,6 +84,11 @@ patch -p1 < ../ldm-6.8.1.patch1 # remove the patch file rm -f ../ldm-6.8.1.patch1 +patch -p1 < ../ldm-6.8.1.patch2 + +# remove the patch file. +rm -f ../ldm-6.8.1.patch2 + %build LDM_BUILD_DIR="/tmp/awips2-${USER}/ldm-build" LDM_TAR_DIR="Installer.rpm/awips2.core/Installer.ldm/src" diff --git a/rpms/awips2.core/Installer.ldm/src/ldm-6.8.1.patch2 b/rpms/awips2.core/Installer.ldm/src/ldm-6.8.1.patch2 new file mode 100644 index 0000000000..8394365e4e --- /dev/null +++ b/rpms/awips2.core/Installer.ldm/src/ldm-6.8.1.patch2 @@ -0,0 +1,42 @@ +diff -crB ldm-6.8.1/src/pqact/palt.c ldm-6.8.1-patch2/src/pqact/palt.c +*** ldm-6.8.1/src/pqact/palt.c 2012-03-21 14:43:55.000000000 -0500 +--- ldm-6.8.1-patch2/src/pqact/palt.c 2012-03-21 14:48:12.000000000 -0500 +*************** +*** 1148,1153 **** +--- 1148,1154 ---- + */ + static char buf1[_POSIX_ARG_MAX]; + static char buf2[_POSIX_ARG_MAX]; ++ static char final_buf[_POSIX_ARG_MAX]; + static char* argv[1 + _POSIX_ARG_MAX/2]; + + regsub(pal, prod->info.ident, buf1); +*************** +*** 1159,1171 **** + date_sub(buf2, buf1, prod->info.arrival.tv_sec); + buf1[sizeof(buf1)-1] = 0; + +! seq_sub(buf2, buf1, prod->info.seqno); +! buf1[sizeof(buf1) -1] = 0; + + if (ulogIsVerbose()) +! uinfo(" %s: %s and the ident is %s", s_actiont(&pal->action), buf1, prod->info.ident); + +! argc = tokenize(buf1, argv, ARRAYLEN(argv)); + + if (argc < ARRAYLEN(argv)) + { +--- 1160,1172 ---- + date_sub(buf2, buf1, prod->info.arrival.tv_sec); + buf1[sizeof(buf1)-1] = 0; + +! seq_sub(buf1, final_buf, prod->info.seqno); +! final_buf[sizeof(final_buf) -1] = 0; + + if (ulogIsVerbose()) +! uinfo(" %s: %s and the ident is %s", s_actiont(&pal->action), final_buf, prod->info.ident); + +! argc = tokenize(final_buf, argv, ARRAYLEN(argv)); + + if (argc < ARRAYLEN(argv)) + {