#1104482 /usr/bin/savelog: savelog -C -d spews gzip error message

Package:
debianutils
Source:
debianutils
Description:
Miscellaneous utilities specific to Debian
Submitter:
George Robbert
Date:
2025-04-30 23:33:02 UTC
Severity:
normal
#1104482#5
Date:
2025-04-30 23:22:04 UTC
From:
To:
Dear Maintainer,


$ touch bar
$ savelog -C -d bar
gzip: .//bar.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]: No such file or directory
Rotated `bar' at Wed Apr 30 16:22:11 MDT 2025.

This looks similar to bug #653940, but on closer inspection actually comes
from a different spot.

Here is a patch that addresses this issue.

Thanks for maintaining debianutils!

George
--- /usr/bin/savelog	2023-07-28 17:46:35.000000000 -0600
+++ /tmp/savelog	2025-04-30 16:11:20.425388982 -0600
@@ -292,7 +292,11 @@

 	# compress the old uncompressed log if needed
 	if test -n "$datum" && test -n "$COMPRESS"; then
-		$COMPRESS $COMPRESS_OPTS -- "$newname".[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
+		for f in "$newname".[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]; do
+			if [ -f "$f" ]; then
+			    $COMPRESS $COMPRESS_OPTS -- "$f"
+			fi
+		done
 	fi

 	# remove old files if so desired