import to mercurial
authorChristian Arnold <arnold@schlittermann.de>
Thu, 28 Apr 2011 13:06:25 +0200
changeset 0 117aabc28c6c
child 1 54d18ebcdf02
import to mercurial
.hgignore
99iusupgrade
Makefile
apt-feed-logbuch.sh
debian/changelog
debian/compat
debian/control
debian/copyright
debian/dirs
debian/docs
debian/rules
ius.upgrade.conf
ius.upgrade.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,11 @@
+syntax: glob
+*.swp
+debian/files
+apt-feed-logbuch
+ius.upgrade
+
+
+syntax: regexp
+(build|configure)-stamp$
+debian/ius.upgrade[./]
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/99iusupgrade	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,8 @@
+DPkg {
+  Pre-Invoke {
+    "wc -l < /var/log/apt/history.log > /tmp/lines_count.dat";
+  };
+  Post-Invoke {
+    "test -x /usr/sbin/apt-feed-logbuch && /usr/sbin/apt-feed-logbuch $(echo $PPID) || true";
+  };
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,24 @@
+SCRIPTS = apt-feed-logbuch ius.upgrade
+APTCONFDIR = /etc/apt/apt.conf.d
+DEFAULTCONFDIR = /etc/default
+CLEANFILES = ${SCRIPTS}
+DESTDIR =
+prefix = /usr
+sbindir = ${prefix}/sbin
+
+.PHONY:	all clean install
+
+all:	$(SCRIPTS)
+
+clean:
+	-rm -f ${CLEANFILES}
+
+install: all
+	install -d -m 0755 ${DESTDIR}/${sbindir}
+	install -m 0755 $(SCRIPTS) ${DESTDIR}/${sbindir}/
+	install -m 0644 99iusupgrade ${DESTDIR}/${APTCONFDIR}/
+	install -m 0644 ius.upgrade.conf ${DESTDIR}/${DEFAULTCONFDIR}/
+
+%:	%.sh
+	@cp -f $< $@
+	@chmod a-w+x $@
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/apt-feed-logbuch.sh	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,36 @@
+#! /bin/sh
+#
+# automaticly update logbuch
+# if using apt-get or aptitude command
+#
+# (C) 2011 by Christian Arnold - Schlittermann internet & unix support
+
+set -e
+
+unset  LC_ALL
+export LANG=C
+export LC_CTYPE=en_US.UTF-8
+
+APT_LOG="/var/log/apt/history.log"
+LINES_COUNT="/tmp/lines_count.dat"
+LOGBUCH_OPT=""
+
+if test -f /etc/default/ius.upgrade.conf; then
+    . /etc/default/ius.upgrade.conf
+fi
+
+APT_CMD=$(ps -p $1 -o args=)
+APT_TMP="/tmp/$$.tmp"
+APT_OUT="/tmp/$$.out"
+
+if [ $APT_LOG -nt $LINES_COUNT ]; then
+  BEFOR=$(cat $LINES_COUNT)
+  AFTER=$(wc -l < $APT_LOG)
+  LINES=$(($AFTER - $BEFOR - 1))
+  echo APT: $APT_CMD > $APT_OUT
+  tail -n $LINES $APT_LOG | sed -e '/^Start-Date:/d;/^Commandline:/d;/^End-Date:/d' >> $APT_TMP
+  perl -ne 'chomp; ($action, $packages) = split " ", $_, 2; print map { "- $action $_\n" } $packages =~ /\S+\s\(.*?\)/g' $APT_TMP >> $APT_OUT
+  logbuch $LOGBUCH_OPT --message=@$APT_OUT
+  # cleanup
+  rm -f $APT_TMP $LINES_COUNT $APT_OUT
+fi
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/changelog	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,60 @@
+ius.upgrade (1.0-1) stable; urgency=low
+
+  * automaticly update logbuch if using apt-get or aptitude
+
+ -- Christian Arnold <arnold@schlittermann.de>  Thu, 28 Apr 2011 11:03:48 +0200
+
+ius.upgrade (0.9-1) stable; urgency=low
+
+  * new upstream
+
+ -- Christian Arnold <arnold@schlittermann.de>  Tue, 24 Mar 2009 12:31:30 +0100
+
+ius.upgrade (0.8-1) stable; urgency=low
+
+  * new upstream
+
+ -- Marcus Obst <maob@hrz.tu-chemnitz.de>  Wed, 21 Jan 2009 12:06:44 +0100
+
+ius.upgrade (0.7-1) stable; urgency=low
+
+  * new upstream
+
+ -- Marcus Obst <maob@hrz.tu-chemnitz.de>  Wed, 21 Jan 2009 12:06:44 +0100
+
+ius.upgrade (0.6-1) stable; urgency=low
+
+  * new upstream
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed, 16 Aug 2006 23:59:10 +0200
+
+ius.upgrade (0.5-1) stable; urgency=low
+
+  * new upstream
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed, 16 Aug 2006 23:59:10 +0200
+
+ius.upgrade (0.4-1) stable; urgency=low
+
+  * new upstream
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed,  3 Aug 2006 08:06:20 +0000
+
+ius.upgrade (0.3-1) stable; urgency=low
+
+  * new upstream
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed,  2 Aug 2006 08:06:20 +0000
+
+ius.upgrade (0.2-1) stable; urgency=low
+
+  * bug fixed
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed,  2 Aug 2006 08:06:20 +0000
+
+ius.upgrade (0.1-1) stable; urgency=low
+
+  * Initial Release.
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Wed,  2 Aug 2006 07:06:20 +0000
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/compat	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,1 @@
+7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/control	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,12 @@
+Source: ius.upgrade
+Section: admin
+Priority: optional
+Maintainer: Heiko Schlittermann <hs@schlittermann.de>
+Build-Depends: debhelper (>= 7.0.50~)
+Standards-Version: 3.8.4
+
+Package: ius.upgrade
+Architecture: all
+Depends: logbuch (>= 0.17)
+Description: short script for logging apt-get/aptitude actions to logbuch
+ logging all apt-get/aptitude actions automatically to logbuch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/copyright	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,39 @@
+This work was packaged for Debian by:
+
+    Christian Arnold <arnold@schlittermann.de> on Tue, 28 Apr 2011 11:02:49 +0200
+
+It was downloaded from:
+
+    https://keller.schlittermann.de/hg/ius/ius.upgrade/
+
+Upstream Author(s):
+
+    Christian Arnold <arnold@schlittermann.de>
+
+Copyright:
+
+    Copyright (C) 2011 Schlittermann internet & unix support
+
+License:
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+On Debian systems, the complete text of the GNU General
+Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+The Debian packaging is:
+
+    Copyright (C) 2011 Christian Arnold <arnold@schlittermann.de>
+
+and is licensed under the GPL version 3, see above.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/dirs	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,4 @@
+usr/bin
+usr/sbin
+etc/apt/apt.conf.d
+etc/default
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/rules	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ius.upgrade.conf	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,3 @@
+APT_LOG="/var/log/apt/history.log"
+LINES_COUNT="/tmp/lines_count.dat"
+#LOGBUCH_OPT="--nomail --nodb"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ius.upgrade.sh	Thu Apr 28 13:06:25 2011 +0200
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+echo "###############################################################################"
+echo "# You don't need ius.upgrade to add apt-get/aptitude informations to logbuch. #"
+echo "# All apt-get/aptitude actions will be logged automatically.                  #"
+echo "###############################################################################"