Your message dated Wed, 21 Nov 2007 16:02:01 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#452261: fixed in debianutils 2.28
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: debianutils
Version: 2.27.1
Severity: wishlist
File: /usr/bin/savelog
Tags: patch

Attached patch adds -x to savelog and allows a shell script segment
to be called on the rotated file (foo.0). I would appreciate if it
found its way into the package. I want to use it to mail the files after
rotation.

Example:

piper:~> /tmp/savelog -x 'foo() { echo "New file: $1"; }; foo $FILE' -p bla
New file: .//bla.0
Rotated `bla' at Wed Nov 21 13:43:35 CET 2007.



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages debianutils depends on:
ii  libc6                         2.6.1-6    GNU C Library: Shared libraries

debianutils recommends no packages.

-- no debconf information


-- 
 .''`.   martin f. krafft <[EMAIL PROTECTED]>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
--- /usr/bin/savelog	2007-11-12 18:25:12.000000000 +0100
+++ /tmp/savelog	2007-11-21 13:43:21.000000000 +0100
@@ -26,6 +26,7 @@
 #	-l	  - don't compress any log files	(default: compress)
 #       -p        - preserve mode/user/group of original file
 #	-j        - use bzip2 instead of gzip
+#	-x script - invoke script with rotated log file in $FILE
 #	-n	  - do not rotate empty files
 #	-q	  - be quiet
 #	file 	  - log file names
@@ -94,6 +95,7 @@
 rolldir=
 datum=
 preserve=
+hookscript=
 quiet=0
 rotateifempty=yes
 count=7
@@ -114,6 +116,7 @@
     echo "	-l	   - don't compress any log files (default: compress)"
     echo "	-p         - preserve mode/user/group of original file"
     echo "	-j         - use bzip2 instead of gzip"
+    echo "	-x script  - invoke script with rotated log file in \$FILE"
     echo "	-n         - do not rotate empty files"
     echo "	-q         - suppress rotation message"
     echo "	file 	   - log file names"
@@ -134,7 +137,7 @@
 }
 
 
-while getopts m:u:g:c:r:CdD:tlphjnq opt ; do
+while getopts m:u:g:c:r:CdD:tlphjx:nq opt ; do
 	case "$opt" in
 	m) mode="$OPTARG" ;;
 	u) user="$OPTARG" ;;
@@ -146,6 +149,7 @@
 	D) DATUM=$(date +$OPTARG) ;;
 	t) touch=1 ;;
 	j) COMPRESS="bzip2"; COMPRESS_OPTS="-9f"; DOT_Z=".bz2" ;;
+	x) hookscript="$OPTARG" ;;
 	l) COMPRESS="" ;;
 	p) preserve=1 ;;
 	n) rotateifempty="no" ;;
@@ -291,24 +295,34 @@
 		filenew=1
 	fi
 
+	newfilename="$newname.0"
 	# link the file into the file.0 holding place
 	if [ -f "$filename" ]; then
 		if [ -n "$filenew" ]; then
-			if ln -f -- "$filename" "$newname.0"; then
+			if ln -f -- "$filename" "$newfilename"; then
 				mv -- "$filename.new" "$filename"
 			else
-				echo "Error hardlinking $filename to $newname.0" >&2
+				echo "Error hardlinking $filename to $newfilename" >&2
 				exitcode=8
 				continue
 			fi
 		else
-			mv -- "$filename" "$newname.0"
+			mv -- "$filename" "$newfilename"
 		fi
 	fi
-	[ ! -f "$newname.0" ] && touch -- "$newname.0"
-	fixfile "$newname.0"
+	[ ! -f "$newfilename" ] && touch -- "$newfilename"
+	fixfile "$newfilename"
 	if [ -n "$datum" ]; then
-		mv -- "$newname.0" "$newname.$DATUM"
+		mv -- "$newfilename" "$newname.$DATUM"
+		newfilename="$newname.$DATUM"
+	fi
+
+	if [ -n "$hookscript" ]; then
+	  FILE="$newfilename" $SHELL -c "$hookscript" || \
+	  {
+	    ret=$?
+	    test "$quiet" -eq 1 || echo "Hook script failed with exit code $ret." 1>&2
+	  }
 	fi
 
 	# report successful rotation

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)


--- End Message ---
--- Begin Message ---
Source: debianutils
Source-Version: 2.28

We believe that the bug you reported is fixed in the latest version of
debianutils, which is due to be installed in the Debian FTP archive:

debianutils_2.28.dsc
  to pool/main/d/debianutils/debianutils_2.28.dsc
debianutils_2.28.tar.gz
  to pool/main/d/debianutils/debianutils_2.28.tar.gz
debianutils_2.28_i386.deb
  to pool/main/d/debianutils/debianutils_2.28_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Clint Adams <[EMAIL PROTECTED]> (supplier of updated debianutils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Wed, 21 Nov 2007 10:53:22 -0500
Source: debianutils
Binary: debianutils
Architecture: source i386
Version: 2.28
Distribution: unstable
Urgency: low
Maintainer: Clint Adams <[EMAIL PROTECTED]>
Changed-By: Clint Adams <[EMAIL PROTECTED]>
Description: 
 debianutils - Miscellaneous utilities specific to Debian
Closes: 452261
Changes: 
 debianutils (2.28) unstable; urgency=low
 .
   * Apply patch from Martin Krafft to add -x option to savelog.
     closes: #452261.
Files: 
 277264b63da37b6e09b5b7048b7dc8b5 614 utils required debianutils_2.28.dsc
 c68fa4d9e234951358c4f5b9f780ea12 138013 utils required debianutils_2.28.tar.gz
 d0b5354368fd49ac6702209174c632a5 54780 utils required debianutils_2.28_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Debian!

iD8DBQFHRFU25m0u66uWM3ARAg1HAKCUqMT/I4rcsYBIQVtHjQjJcxyWNwCffgkO
sTTB9HcdsM/Q8NGoIurzUZM=
=/jtj
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to