[debian-edu-commits] debian-edu/ 01/03: Restructure pre-pkgsel.d code and improve error handling.
Petter Reinholdtsen
pere at moszumanska.debian.org
Mon Sep 22 12:48:51 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 55b417a64cd932e71df017cd69e2f451bcf1274f
Author: Petter Reinholdtsen <pere at hungry.com>
Date: Mon Sep 22 14:45:34 2014 +0200
Restructure pre-pkgsel.d code and improve error handling.
* Restructure pre-pkgsel.d code and make sure all errors in the
scripts are reported as fatal forcing a boot.
* Ignore errors from 'apt-get update', which some times fail if the
ISO is umounted when it run.
---
debian/changelog | 9 +++++++++
pre-pkgsel | 29 ++++++++++++++++++-----------
2 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 0570ec2..9a73796 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debian-edu-install (1.803) UNRELEASED; urgency=low
+
+ * Restructure pre-pkgsel.d code and make sure all errors in the
+ scripts are reported as fatal forcing a boot.
+ * Ignore errors from 'apt-get update', which some times fail if the
+ ISO is umounted when it run.
+
+ -- Petter Reinholdtsen <pere at debian.org> Mon, 22 Sep 2014 14:42:20 +0200
+
debian-edu-install (1.802) unstable; urgency=high
* Fix typo in error message from edu-eatmydata-install.
diff --git a/pre-pkgsel b/pre-pkgsel
index 56b54bc..675b6e9 100755
--- a/pre-pkgsel
+++ b/pre-pkgsel
@@ -14,8 +14,21 @@ error() {
logger -t edu-pre-pkgsel "error: $*"
}
+report_fatal_error() {
+ template=debian-edu-install/errors-pkg-installation
+ db_subst $template PACKAGES "$p"
+ db_fset $template seen false
+ db_capb "" # Disable "Go Back" button
+ db_settitle $template-title
+ db_input critical $template || [ $? -eq 30 ]
+ db_go
+ db_capb backup
+ reboot
+}
+
at_exit() {
error "script $0 terminated unexpectedly."
+ report_fatal_error "unexpected exit"
}
disable_exception() { trap - INT TERM EXIT; }
trap at_exit INT TERM EXIT
@@ -23,18 +36,11 @@ trap at_exit INT TERM EXIT
# Install required packages, report fatal error and reboot if it fail.
install_required_pkg() {
p="$1"
+ log "installing package $p"
if apt-install --allow-remove --with-recommends $p ; then
:
else
- template=debian-edu-install/errors-pkg-installation
- db_subst $template PACKAGES "$p"
- db_fset $template seen false
- db_capb "" # Disable "Go Back" button
- db_settitle $template-title
- db_input critical $template || [ $? -eq 30 ]
- db_go
- db_capb backup
- reboot
+ report_fatal_error "$p"
fi
}
@@ -91,8 +97,9 @@ log "asking for a few extra packages to be installed"
# our local archive keyring, update apt database after it is installed
install_required_pkg debian-edu-archive-keyring
-# Update mirrors using the latest keys
-in-target apt-get update
+
+log "update mirrors using the latest keys"
+in-target apt-get update || true
# education tasksel tasks
install_required_pkg education-tasks
--
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