mirror of https://github.com/CISOfy/lynis.git
Improve detection and display of gzipped changelog
This commit is contained in:
parent
773c410a02
commit
6d6cd79a82
|
@ -123,15 +123,19 @@ if [ $# -gt 0 ]; then
|
|||
CHANGELOG=""
|
||||
if [ -z "${SEARCH_VERSION}" ]; then SEARCH_VERSION="${PROGRAM_VERSION}"; fi
|
||||
STARTED=0
|
||||
for FILE in ${CHANGELOG_PATHS}; do
|
||||
if [ -f ${FILE}/CHANGELOG.md ]; then CHANGELOG="${FILE}/CHANGELOG.md"; fi
|
||||
# We might come accross a gzipped changelog
|
||||
if [ -f ${FILE}/changelog.gz ]; then
|
||||
for FILEPATH in ${CHANGELOG_PATHS}; do
|
||||
if [ -f ${FILEPATH}/CHANGELOG.md ]; then
|
||||
CHANGELOG="${FILEPATH}/CHANGELOG.md"
|
||||
# Check also for gzipped changelog
|
||||
elif [ -f ${FILEPATH}/changelog.gz ]; then
|
||||
ZCAT=$(which zcat 2> /dev/null)
|
||||
if [ ! -z "${HAS_ZCAT}" ]; then
|
||||
if [ ! -z "${ZCAT}" ]; then
|
||||
CreateTempFile
|
||||
CHANGELOG="${TEMP_FILE}"
|
||||
${ZCAT} ${FILE}/changelog.gz > ${CHANGELOG}
|
||||
LogText "Result: found gzipped changelog in ${FILEPATH}"
|
||||
LogText "Action: Creating temporary file to store text"
|
||||
${ZCAT} ${FILEPATH}/changelog.gz > ${CHANGELOG}
|
||||
else
|
||||
DisplayError "Could not find zcat utility to use on gzipped changelog"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue