[Pkg-ltsp-devel] Bug#693496: ltsp-update-image/update-kernels: fails when /bin/sh points to bash

Vagrant Cascadian vagrant at freegeek.org
Mon Nov 19 21:26:40 UTC 2012


Control: tags 693496 patch pending
Control: tags 693499 patch pending

The following patch is committed to bzr and will be uploaded soon: 

=== modified file 'client/share/ltsp/update-kernels'
--- old/client/share/ltsp/update-kernels	2012-08-20 23:05:03 +0000
+++ new/client/share/ltsp/update-kernels	2012-11-18 21:19:26 +0000
@@ -51,7 +51,9 @@
 # Distros are required to set e.g. KERNEL_PREFIX="vmlinuz-*', KERNEL_SUFFIX="".
 # The * goes where the version is expected to go.
 kernel_versions() {
-    local - kernels arch loop_kernels kernel
+    local orig_flags kernels arch loop_kernels kernel
+    # Save values of flags, and restore them later.
+    orig_flags=$(set +o)
 
     # Disable glob expansion for this function
     set -f
@@ -72,6 +74,7 @@
             esac
         done
     done | sort -frV | awk '{ print $2 }'
+    eval "$orig_flags"
 }
 
 # This also sources vendor functions and .conf file settings

=== modified file 'server/ltsp-update-image'
--- old/server/ltsp-update-image	2012-11-17 07:05:52 +0000
+++ new/server/ltsp-update-image	2012-11-18 21:19:25 +0000
@@ -53,8 +53,9 @@
 
 trap_cleanup() {
     # Don't stop on errors within this function.
-    # local - means "restore flags on function exit".
-    local -
+    # Save and restore flags in a way that works with dash and bash.
+    local orig_flags
+    orig_flags=$(set +o)
     set +e
 
     # Stop trapping
@@ -65,6 +66,7 @@
     rmdir "$cu_rofs"
     rmdir "$cu_base"
     unlock_package_management
+    eval "$orig_flags"
 }
 
 # Get a sorted list of all "real" mount points under $chroot,


live well,
  vagrant



More information about the Pkg-ltsp-devel mailing list