[debian-edu-commits] r81126 - branches/wheezy/debian-edu/debian

pere at alioth.debian.org pere at alioth.debian.org
Sun Jun 23 22:44:52 UTC 2013


Author: pere
Date: 2013-06-23 22:44:52 +0000 (Sun, 23 Jun 2013)
New Revision: 81126

Added:
   branches/wheezy/debian-edu/debian/edu-tasksel-setup
Modified:
   branches/wheezy/debian-edu/debian/changelog
   branches/wheezy/debian-edu/debian/education-tasks.install
Log:
Add helper script edu-tasksel-setup which is useful for setting up
and tearing down diverts before running tasksel.  It can be used
to reduce the code duplication in debian-edu-install and
debian-edu-config.

Modified: branches/wheezy/debian-edu/debian/changelog
===================================================================
--- branches/wheezy/debian-edu/debian/changelog	2013-06-23 22:31:49 UTC (rev 81125)
+++ branches/wheezy/debian-edu/debian/changelog	2013-06-23 22:44:52 UTC (rev 81126)
@@ -8,6 +8,10 @@
   [ Petter Reinholdtsen ]
   * Suggests freeplane in the misc task, as it is the prefered mind mapping
     tool in the Uberstudent distribution.
+  * Add helper script edu-tasksel-setup which is useful for setting up
+    and tearing down diverts before running tasksel.  It can be used
+    to reduce the code duplication in debian-edu-install and
+    debian-edu-config.
 
  -- Petter Reinholdtsen <pere at debian.org>  Sat, 22 Jun 2013 06:32:15 +0200
 

Added: branches/wheezy/debian-edu/debian/edu-tasksel-setup
===================================================================
--- branches/wheezy/debian-edu/debian/edu-tasksel-setup	                        (rev 0)
+++ branches/wheezy/debian-edu/debian/edu-tasksel-setup	2013-06-23 22:44:52 UTC (rev 81126)
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+error() {
+    print "error: " $@ 1>&2
+}
+
+setup_tasksel_overrides() {
+    # Modify tasksels desktop test so the normal Debian desktop
+    # profiles are not installed. Use dpkg-divert to to switch to our
+    # version
+    sed -e 's/if desktop_hardware/# Do not install a desktop - added by debian-edu-install\nunmark\n\n&/' \
+        < /usr/lib/tasksel/tests/desktop \
+        > /usr/lib/tasksel/tests/desktop.edu
+    chmod 755 /usr/lib/tasksel/tests/desktop.edu
+    dpkg-divert --package debian-edu-install --rename --quiet \
+        --add /usr/lib/tasksel/tests/desktop
+    ln -sf ./desktop.edu /usr/lib/tasksel/tests/desktop
+
+    # And for the standard system task too
+    sed -e 's/^case/# Do not install standard system task - added by debian-edu-install\nexit 3\n\n&/' \
+        < /usr/lib/tasksel/tests/new-install \
+        > /usr/lib/tasksel/tests/new-install.edu
+    chmod 755 /usr/lib/tasksel/tests/new-install.edu
+    dpkg-divert --package debian-edu-install --rename --quiet \
+        --add /usr/lib/tasksel/tests/new-install
+    ln -sf ./new-install.edu /usr/lib/tasksel/tests/new-install
+}
+
+remove_tasksel_overrides() {
+    for test in desktop new-install ; do
+        file=/usr/lib/tasksel/tests/$test
+        if [ -x $file.edu ] ; then
+            rm $file
+            dpkg-divert --package debian-edu-install \
+                --rename --quiet --remove $file
+            rm $file.edu
+        else
+            error "Missing divert for $file."
+        fi
+    done
+}
+
+case "$1" in
+    setup)
+	setup_tasksel_overrides
+	;;
+    teardown)
+	remove_tasksel_overrides
+	;;
+    tasksel)
+	setup_tasksel_overrides
+	tasksel
+	remove_tasksel_overrides
+esac


Property changes on: branches/wheezy/debian-edu/debian/edu-tasksel-setup
___________________________________________________________________
Added: svn:executable
   + *

Modified: branches/wheezy/debian-edu/debian/education-tasks.install
===================================================================
--- branches/wheezy/debian-edu/debian/education-tasks.install	2013-06-23 22:31:49 UTC (rev 81125)
+++ branches/wheezy/debian-edu/debian/education-tasks.install	2013-06-23 22:44:52 UTC (rev 81126)
@@ -1,3 +1,4 @@
 debian/always-lang   /usr/lib/tasksel/tests
 debian/always-laptop   /usr/lib/tasksel/tests
 debian/edu-profile   /usr/lib/tasksel/tests
+debian/edu-tasksel-setup /usr/lib/education-tasks




More information about the debian-edu-commits mailing list