[SCM] live-tools branch, debian-next, updated. debian/3.0.0-1-2-gb056ca8

Daniel Baumann daniel at debian.org
Fri Jun 22 12:18:33 UTC 2012


The following commit has been merged in the debian-next branch:
commit 1addc063b49e8b340bfaf3ca27f9d69b4fb044d2
Author: Daniel Baumann <daniel at debian.org>
Date:   Wed Jun 13 18:24:16 2012 +0200

    Adding live-uptime which previously was in linux-container.

diff --git a/debian/control b/debian/control
index 58b0a4f..b046063 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Vcs-Git: git://live.debian.net/git/live-tools.git
 Package: live-tools
 Architecture: all
 Depends: ${misc:Depends}
+Conflicts: linux-container (<< 2)
 Suggests: debian-installer-launcher, perl, rsync
 Description: Debian Live - System Support Scripts
  live-tools contains additional support scripts for Debian Live systems.
diff --git a/debian/live-tools.links b/debian/live-tools.links
index 42f5725..5a18980 100644
--- a/debian/live-tools.links
+++ b/debian/live-tools.links
@@ -1,5 +1,7 @@
 /usr/share/man/man7/live-tools.7.gz	/usr/share/man/man1/live-system.1.gz
 /usr/share/man/man7/live-tools.7.gz	/usr/share/man/man1/live-toram.1.gz
+/usr/share/man/man7/live-tools.7.gz	/usr/share/man/man1/live-uptime.1.gz
 
 /usr/share/man/de/man7/live-tools.7.gz	/usr/share/man/de/man1/live-system.1.gz
 /usr/share/man/de/man7/live-tools.7.gz	/usr/share/man/de/man1/live-toram.1.gz
+/usr/share/man/de/man7/live-tools.7.gz	/usr/share/man/de/man1/live-uptime.1.gz
diff --git a/debian/live-tools.postrm b/debian/live-tools.postrm
new file mode 100644
index 0000000..6c06daa
--- /dev/null
+++ b/debian/live-tools.postrm
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	remove)
+		rm -f /usr/bin/uptime
+
+		dpkg-divert --package live-tools --quiet --remove --rename --divert /usr/bin/uptime.procps /usr/bin/uptime
+		;;
+
+	purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+		;;
+
+	*)
+		echo "postrm called with unknown argument \`${1}'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/live-tools.preinst b/debian/live-tools.preinst
new file mode 100644
index 0000000..8b02200
--- /dev/null
+++ b/debian/live-tools.preinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+case "${1}" in
+	install|upgrade)
+		dpkg-divert --package live-tools --quiet --add --rename --divert /usr/bin/uptime.procps /usr/bin/uptime
+
+		ln -s /usr/bin/live-uptime /usr/bin/uptime
+		;;
+
+	abort-upgrade)
+
+		;;
+
+	*)
+		echo "preinst called with unknown argument \`$1'" >&2
+		exit 1
+		;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/manpages/de/live-tools.de.7 b/manpages/de/live-tools.de.7
index dced5b8..b34d38c 100644
--- a/manpages/de/live-tools.de.7
+++ b/manpages/de/live-tools.de.7
@@ -11,7 +11,7 @@
 .\" This file was generated with po4a. Translate the source file.
 .\"
 .\"*******************************************************************
-.TH LIVE\-TOOLS 7 05.06.2012 3.0.0\-1 "Debian Live Projekt"
+.TH LIVE\-TOOLS 7 13.06.2012 3.0.0\-1 "Debian Live Projekt"
 
 .SH NAME
 \fBlive\-tools\fP \- System Support Skripte
@@ -26,6 +26,9 @@
 kopiert das laufende System in RAM um das Live Medium auszuwerfen.
 .IP \fBlive\-system\fP 4
 bestimmt ob das laufende System ein Debian Live basiertes System ist.
+.IP \fBlive\-uptime\fP 4
+gibt die aktuelle Dauer wie lange das System läuft aus (funktioniert mit
+LXC).
 
 .SH "SIEHE AUCH"
 \fIlive\-boot\fP(7)
diff --git a/manpages/en/live-tools.7 b/manpages/en/live-tools.7
index 3e9c732..b795d44 100644
--- a/manpages/en/live-tools.7
+++ b/manpages/en/live-tools.7
@@ -6,7 +6,7 @@
 .\" under certain conditions; see COPYING for details.
 .\"
 .\"
-.TH LIVE\-TOOLS 7 2012\-06\-05 3.0.0-1 "Debian Live Project"
+.TH LIVE\-TOOLS 7 2012\-06\-13 3.0.0-1 "Debian Live Project"
 
 .SH NAME
 \fBlive\-tools\fR \- System Support Scripts
@@ -21,6 +21,8 @@
 copies running system to RAM in order to eject the live media.
 .IP "\fBlive\-system\fR" 4
 determines if running system is a debian-live based system.
+.IP "\fBlive\-uptime\fR" 4
+tells how long the system has been running (works with LXC).
 
 .SH SEE ALSO
 \fIlive\-boot\fR(7)
diff --git a/manpages/po/de/live-tools.7.po b/manpages/po/de/live-tools.7.po
index 86c27f8..4525a60 100644
--- a/manpages/po/de/live-tools.7.po
+++ b/manpages/po/de/live-tools.7.po
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: live-tools 3.0.0-1\n"
-"POT-Creation-Date: 2012-06-05 13:54+0300\n"
+"POT-Creation-Date: 2012-06-13 18:26+0300\n"
 "PO-Revision-Date: 2010-05-24 09:59+0300\n"
 "Last-Translator: Daniel Baumann <daniel at debian.org>\n"
 "Language-Team: none\n"
@@ -24,8 +24,8 @@ msgstr "LIVE-TOOLS"
 #. type: TH
 #: en/live-tools.7:9
 #, no-wrap
-msgid "2012-06-05"
-msgstr "05.06.2012"
+msgid "2012-06-13"
+msgstr "13.06.2012"
 
 #. type: TH
 #: en/live-tools.7:9
@@ -95,35 +95,48 @@ msgstr "B<live-system>"
 msgid "determines if running system is a debian-live based system."
 msgstr "bestimmt ob das laufende System ein Debian Live basiertes System ist."
 
+#. type: IP
+#: en/live-tools.7:24
+#, no-wrap
+msgid "B<live-uptime>"
+msgstr "B<live-uptime>"
+
+#. type: Plain text
+#: en/live-tools.7:26
+msgid "tells how long the system has been running (works with LXC)."
+msgstr ""
+"gibt die aktuelle Dauer wie lange das System läuft aus (funktioniert mit "
+"LXC)."
+
 #. type: SH
-#: en/live-tools.7:25
+#: en/live-tools.7:27
 #, no-wrap
 msgid "SEE ALSO"
 msgstr "SIEHE AUCH"
 
 #. type: Plain text
-#: en/live-tools.7:27
+#: en/live-tools.7:29
 msgid "I<live-boot>(7)"
 msgstr "I<live-boot>(7)"
 
 #. type: Plain text
-#: en/live-tools.7:29
+#: en/live-tools.7:31
 msgid "I<live-build>(7)"
 msgstr "I<live-build>(7)"
 
 #. type: Plain text
-#: en/live-tools.7:31
+#: en/live-tools.7:33
 msgid "I<live-config>(7)"
 msgstr "I<live-config>(7)"
 
 #. type: SH
-#: en/live-tools.7:32
+#: en/live-tools.7:34
 #, no-wrap
 msgid "HOMEPAGE"
 msgstr "HOMEPAGE"
 
 #. type: Plain text
-#: en/live-tools.7:34
+#: en/live-tools.7:36
 msgid ""
 "More information about live-tools and the Debian Live project can be found "
 "on the homepage at E<lt>I<http://live.debian.net/>E<gt> and in the manual at "
@@ -134,13 +147,13 @@ msgstr ""
 "unter E<lt>I<http://live.debian.net/manual/>E<gt> gefunden werden."
 
 #. type: SH
-#: en/live-tools.7:35
+#: en/live-tools.7:37
 #, no-wrap
 msgid "BUGS"
 msgstr "FEHLER"
 
 #. type: Plain text
-#: en/live-tools.7:37
+#: en/live-tools.7:39
 msgid ""
 "Bugs can be reported by submitting a bugreport for the live-tools package in "
 "the Debian Bug Tracking System at E<lt>I<http://bugs.debian.org/>E<gt> or by "
@@ -154,13 +167,13 @@ msgstr ""
 "werden."
 
 #. type: SH
-#: en/live-tools.7:38
+#: en/live-tools.7:40
 #, no-wrap
 msgid "AUTHOR"
 msgstr "AUTOR"
 
 #. type: Plain text
-#: en/live-tools.7:39
+#: en/live-tools.7:41
 msgid ""
 "live-tools was written by Daniel Baumann E<lt>I<daniel at debian.org>E<gt>."
 msgstr ""
diff --git a/manpages/pot/live-tools.7.pot b/manpages/pot/live-tools.7.pot
index 786c521..93ecb47 100644
--- a/manpages/pot/live-tools.7.pot
+++ b/manpages/pot/live-tools.7.pot
@@ -7,7 +7,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: live-config VERSION\n"
-"POT-Creation-Date: 2012-06-05 13:54+0300\n"
+"POT-Creation-Date: 2012-06-13 18:26+0300\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -25,7 +25,7 @@ msgstr ""
 #. type: TH
 #: en/live-tools.7:9
 #, no-wrap
-msgid "2012-06-05"
+msgid "2012-06-13"
 msgstr ""
 
 #. type: TH
@@ -96,35 +96,46 @@ msgstr ""
 msgid "determines if running system is a debian-live based system."
 msgstr ""
 
+#. type: IP
+#: en/live-tools.7:24
+#, no-wrap
+msgid "B<live-uptime>"
+msgstr ""
+
+#. type: Plain text
+#: en/live-tools.7:26
+msgid "tells how long the system has been running (works with LXC)."
+msgstr ""
+
 #. type: SH
-#: en/live-tools.7:25
+#: en/live-tools.7:27
 #, no-wrap
 msgid "SEE ALSO"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:27
+#: en/live-tools.7:29
 msgid "I<live-boot>(7)"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:29
+#: en/live-tools.7:31
 msgid "I<live-build>(7)"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:31
+#: en/live-tools.7:33
 msgid "I<live-config>(7)"
 msgstr ""
 
 #. type: SH
-#: en/live-tools.7:32
+#: en/live-tools.7:34
 #, no-wrap
 msgid "HOMEPAGE"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:34
+#: en/live-tools.7:36
 msgid ""
 "More information about live-tools and the Debian Live project can be found "
 "on the homepage at E<lt>I<http://live.debian.net/>E<gt> and in the manual at "
@@ -132,13 +143,13 @@ msgid ""
 msgstr ""
 
 #. type: SH
-#: en/live-tools.7:35
+#: en/live-tools.7:37
 #, no-wrap
 msgid "BUGS"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:37
+#: en/live-tools.7:39
 msgid ""
 "Bugs can be reported by submitting a bugreport for the live-tools package in "
 "the Debian Bug Tracking System at E<lt>I<http://bugs.debian.org/>E<gt> or by "
@@ -147,13 +158,13 @@ msgid ""
 msgstr ""
 
 #. type: SH
-#: en/live-tools.7:38
+#: en/live-tools.7:40
 #, no-wrap
 msgid "AUTHOR"
 msgstr ""
 
 #. type: Plain text
-#: en/live-tools.7:39
+#: en/live-tools.7:41
 msgid ""
 "live-tools was written by Daniel Baumann E<lt>I<daniel at debian.org>E<gt>."
 msgstr ""
diff --git a/scripts/live-uptime b/scripts/live-uptime
new file mode 100755
index 0000000..31ae24f
--- /dev/null
+++ b/scripts/live-uptime
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+## live-tools(7) - System Support Scripts
+## Copyright (C) 2006-2012 Daniel Baumann <daniel at debian.org>
+##
+## live-tools comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+set -e
+
+_UPTIME="$(/usr/bin/uptime.procps)"
+
+_DATE_HOST="$(date +%s)"
+
+_DATE_LXC="$(stat /dev/pts | awk '/^Change: / { print $2, $3 }')"
+_DATE_LXC="$(date +%s -d"${_DATE_LXC}")"
+
+_UPTIME_LXC="$((${_DATE_HOST} - ${_DATE_LXC}))"
+
+if [ "${_UPTIME_LXC}" -gt 172800 ]
+then
+	# LXC uptime >= 2 days
+	_DAYS="$((${_UPTIME_LXC} / 86400))"
+
+	_UPTIME="$(echo ${_UPTIME} | sed -e "s|up .* days,|up ${_DAYS} days,|")"
+else
+	# LXC uptime < 2 days
+	_HOURS="$((${_UPTIME_LXC} / 3600))"
+	_MINUTES="$((${_UPTIME_LXC} - ${_HOURS}))"
+	_MINUTES="$((${_MINUTES} / 60))"
+
+	_UPTIME="$(echo ${_UPTIME} | sed -e "s|up .*,  |up ${_HOURS}:${_MINUTES},  |")"
+fi
+
+echo " ${_UPTIME}"

-- 
live-tools



More information about the debian-live-changes mailing list