File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
postgres-appliance/build_scripts Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -121,16 +121,15 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
121121 " postgresql-${version} -pg-stat-kcache" \
122122 " ${EXTRAS[@]} "
123123
124- # Clean up timescaledb versions except the highest compatible and transition version
124+ # Clean up timescaledb versions except the last 5 minor versions
125125 exclude_patterns=()
126- prev_highest_ver=" $ts_highest_ver "
127- ts_highest_ver=$( find " /usr/lib/postgresql/$version /lib/" -name ' timescaledb-2.*.so' | sed -rn ' s/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV | head -n1)
128- if [ " $prev_highest_ver " != " $ts_highest_ver " ]; then
129- ts_transition_version=" $prev_highest_ver "
130- fi
131- for ts_version in " $ts_transition_version " " $ts_highest_ver " ; do
132- exclude_patterns+=(! -name timescaledb-" ${ts_version} " .so)
133- exclude_patterns+=(! -name timescaledb-tsl-" ${ts_version} " .so)
126+ versions=$( find " /usr/lib/postgresql/$version /lib/" -name ' timescaledb-2.*.so' | sed -rn ' s/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV)
127+ latest_minor_versions=$( echo " $versions " | awk -F. ' {print $1"."$2}' | uniq | head -n 5)
128+ for minor in $latest_minor_versions ; do
129+ for full_version in $( echo " $versions " | grep " ^$minor " ) ; do
130+ exclude_patterns+=(! -name timescaledb-" ${full_version} " .so)
131+ exclude_patterns+=(! -name timescaledb-tsl-" ${full_version} " .so)
132+ done
134133 done
135134 find " /usr/lib/postgresql/$version /lib/" \( -name ' timescaledb-2.*.so' -o -name ' timescaledb-tsl-2.*.so' \) " ${exclude_patterns[@]} " -delete
136135
You can’t perform that action at this time.
0 commit comments