[debian-edu-commits] debian-edu/ 01/01: Add exception handling in xdebian-edu-firstboot.init too, and fix some typos introduced by exception handling in d-i hooks.

Petter Reinholdtsen pere at moszumanska.debian.org
Fri Sep 12 10:24:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-install.

commit 1f7eb141fc3a6f0168ccd91340a290441fff61c8
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Fri Sep 12 12:24:41 2014 +0200

    Add exception handling in xdebian-edu-firstboot.init too, and fix some typos introduced by exception handling in d-i hooks.
---
 apt-setup/generators/70debian-edu-install            |  8 ++++----
 base-installer                                       |  6 +++---
 debian/changelog                                     |  4 ++--
 debian/debian-edu-install.xdebian-edu-firstboot.init | 12 ++++++++++++
 finish-install                                       |  2 +-
 post-base-installer                                  |  6 +++---
 pre-pkgsel                                           |  2 +-
 7 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/apt-setup/generators/70debian-edu-install b/apt-setup/generators/70debian-edu-install
index 14de5fd..ccb8db2 100644
--- a/apt-setup/generators/70debian-edu-install
+++ b/apt-setup/generators/70debian-edu-install
@@ -4,14 +4,14 @@ set -e
 . /usr/share/debconf/confmodule
 . /lib/debian-edu-common
 
-logmsg() { logger -t debian-edu-install/apt-setup "$*" }
-log() { logmsg "info: $*" }
-error() { logmsg "error: $*" }
+logmsg() { logger -t debian-edu-install/apt-setup "$*"; }
+log() { logmsg "info: $*"; }
+error() { logmsg "error: $*"; }
 
 at_exit() {
     error "script $0 terminated unexpectedly."
 }
-disable_exception() { trap - INT TERM EXIT }
+disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
 log "Doing some apt-source magic for Debian-Edu"
diff --git a/base-installer b/base-installer
index f4ed4a4..b18de8d 100755
--- a/base-installer
+++ b/base-installer
@@ -1,12 +1,12 @@
 #!/bin/sh -e
 
-logmsg() { logger -t debian-edu-install/base-installer "info: $*" }
-log() { logmsg "info: $*" }
+logmsg() { logger -t debian-edu-install/base-installer "info: $*"; }
+log() { logmsg "info: $*"; }
 
 at_exit() {
     logmsg "error: script $0 terminated unexpectedly."
 }
-disable_exception() { trap - INT TERM EXIT }
+disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
 # remove the debianfreespace logical volume.  Doing it before
diff --git a/debian/changelog b/debian/changelog
index b52dfc1..7d021fd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,8 +2,8 @@ debian-edu-install (1.730) UNRELEASED; urgency=low
 
   * Fix base-installer.d script to not crash unable to remove
     /target/debianedufreespace/.
-  * Add signal trapping in all d-i hooks to print an error: string if
-    one of them terminates unexpectedly.
+  * Add signal trapping in all d-i hooks and the first boot init.d script
+    to print/log an error: string if one of them terminates unexpectedly.
 
  -- Petter Reinholdtsen <pere at debian.org>  Fri, 12 Sep 2014 08:42:54 +0200
 
diff --git a/debian/debian-edu-install.xdebian-edu-firstboot.init b/debian/debian-edu-install.xdebian-edu-firstboot.init
index 6cce3ba..6bf0413 100755
--- a/debian/debian-edu-install.xdebian-edu-firstboot.init
+++ b/debian/debian-edu-install.xdebian-edu-firstboot.init
@@ -24,6 +24,16 @@ firstboot_file=/etc/debian-edu/xdebian-edu-firstboot
 
 set -e
 
+error() {
+    logger -t debian-edu-install "error: $@"
+}
+
+at_exit() {
+    error "script $0 terminated unexpectedly."
+}
+disable_exception() { trap - INT TERM EXIT; }
+trap at_exit INT TERM EXIT
+
 run_testsuite() {
     log_begin_msg "Collecting testsuite results"
     logfile=/var/log/installer/debian-edu-install-testsuite
@@ -202,8 +212,10 @@ case "$1" in
 	;;
     *)
         echo "Usage: /etc/init.d/xdebian-edu-firstboot {start|stop|restart|force-reload}"
+        disable_exception
         exit 1
         ;;
 esac
 
+disable_exception
 exit 0
diff --git a/finish-install b/finish-install
index b6cc7bf..41cdabd 100755
--- a/finish-install
+++ b/finish-install
@@ -20,7 +20,7 @@ error() {
 at_exit() {
     error "script $0 terminated unexpectedly."
 }
-disable_exception() { trap - INT TERM EXIT }
+disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
 # Stop automatic lvm resize script set up before base-installer
diff --git a/post-base-installer b/post-base-installer
index ca02f1e..c4218ca 100755
--- a/post-base-installer
+++ b/post-base-installer
@@ -4,13 +4,13 @@
 # is installed, and before most packages are installed.  APT is
 # only using packages on the CD/DVD at this point.
 
-log() { logger -t debian-edu-install/post-base-installer "$@" }
-error() { log "error: $*" }
+log() { logger -t debian-edu-install/post-base-installer "$@"; }
+error() { log "error: $*"; }
 
 at_exit() {
     error "script $0 terminated unexpectedly."
 }
-disable_exception() { trap - INT TERM EXIT }
+disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
 # ...
diff --git a/pre-pkgsel b/pre-pkgsel
index 17c3a0d..fa09da5 100755
--- a/pre-pkgsel
+++ b/pre-pkgsel
@@ -17,7 +17,7 @@ error() {
 at_exit() {
     error "script $0 terminated unexpectedly."
 }
-disable_exception() { trap - INT TERM EXIT }
+disable_exception() { trap - INT TERM EXIT; }
 trap at_exit INT TERM EXIT
 
 # Install required packages, report fatal error and reboot if it fail.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-install.git



More information about the debian-edu-commits mailing list