[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

2. version of sysklogd patch



Hello! 

Please look over my second try to patch sysklogd to use debconf
questions. 
If your found this patches okay, I will contact the maintainer and talk
to him, if he could integrate this patches into his package. 

Greetings
Patrick
diff -Nru /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/config /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/config
--- /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/config	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/config	2006-09-18 07:46:06.000000000 +0000
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. /usr/share/debconf/confmodule
+
+db_input low sysklogd/sysklogd-default-options || true
+db_go
+
+db_get sysklogd/sysklogd-default-options
+
+if [ ! -z "$RET" ]; then 
+	if [ -z `grep "-r" "$RET"` ]; then
+		db_input low sysklogd/sysklogd-remot-loghost || true
+		db_go
+	fi
+fi
+db_stop
+
diff -Nru /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/control /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/control
--- /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/control	2006-09-18 07:46:06.000000000 +0000
+++ /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/control	2006-09-18 07:46:06.000000000 +0000
@@ -7,7 +7,7 @@
 Package: sysklogd
 Architecture: any
 Section: admin
-Depends: ${shlibs:Depends}, klogd | linux-kernel-log-daemon
+Depends: ${shlibs:Depends}, klogd | linux-kernel-log-daemon, debconf ( >=0.5 ) | debconf-2.0
 Conflicts: syslogd
 Provides: syslogd, system-log-daemon
 Replaces: syslogd
diff -Nru /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/postinst /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/postinst
--- /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/postinst	2006-09-18 07:46:06.000000000 +0000
+++ /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/postinst	2006-09-18 07:46:06.000000000 +0000
@@ -2,6 +2,8 @@
 
 set -e
 
+. /usr/share/debconf/confmodule
+
 if [ ! -d /var/log/news ] \
 	&& grep -q /var/log/news/ /etc/syslog.conf \
 	&& grep -q ^news: /etc/passwd \
@@ -74,6 +76,20 @@
 	fi
 	set -e
     fi
+    
+    db_get sysklogd/sysklogd-default-options
+
+    if [ ! -z "$RET" ]; then
+    	 sed -e "s/^\([[:space:]]*\)SYSLOGD=.*/\1SYSLOGD=\"$RET\"/" -i /etc/default/syslogd
+	 if [ ! -z `grep "-r" "$RET"` ]; then
+	 	db_get sysklogd/sysklogd-remote-loghost
+		if [ ! -z "$RET" ]; then
+			echo "$RET" >> /etc/syslog.conf
+		fi
+	fi
+    fi
+
+    db_stop
 fi
 
 
diff -Nru /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/rules /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/rules
--- /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/rules	2006-09-18 07:46:06.000000000 +0000
+++ /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/rules	2006-09-18 07:46:06.000000000 +0000
@@ -74,8 +74,8 @@
 	chown -R root:root debian/tmp.sysklogd
 	chmod -R g-ws debian/tmp.sysklogd
 	$(installbin) -d debian/tmp.sysklogd/usr/share/doc/$(package)
-	$(installbin) debian/{preinst,postinst,postrm,prerm} debian/tmp.sysklogd/DEBIAN/
-	$(installdoc) debian/conffiles debian/tmp.sysklogd/DEBIAN/
+	$(installbin) debian/{preinst,postinst,postrm,prerm,config} debian/tmp.sysklogd/DEBIAN/
+	$(installdoc) debian/{conffiles,templates} debian/tmp.sysklogd/DEBIAN/
 	$(installdoc) debian/changelog debian/tmp.sysklogd/usr/share/doc/$(package)/changelog.Debian
 	#
 	$(installbin) -d debian/tmp.sysklogd/usr/share/$(package)
diff -Nru /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/templates /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/templates
--- /tmp/aEIq9ONO4x/sysklogd-1.4.1/debian/templates	1970-01-01 00:00:00.000000000 +0000
+++ /tmp/3OsP4rY3JE/sysklogd-1.4.1/debian/templates	2006-09-18 07:46:06.000000000 +0000
@@ -0,0 +1,14 @@
+Template: sysklogd/sysklogd-default-options
+Type: string
+Description: Enter the options you want sysklogd to use
+ Enter only the options like "-r" or "-m 0" without anything else before
+ or behind.
+Description-de.UTF-8: Geben Sie die Optionen an, die sysklogd benutzen soll
+ Geben Sie lediglich die Optionen an, ohne zum Beispiel den Programmnamen davor
+ oder dahinter. Ähnlich wie dieses Beispiel: -r
+
+Template: sysklogd/sysklogd-remote-loghost
+Type: string
+Description: Enter the host you want to log to
+ You have choosen the -r option so you can here decide what and to which host you want
+ to log to. A sample entry can look like: "*.* @loghost" 

Reply to: