Package: xen-tools
Version: 2.7-4
Severity: important
Tags: patch
I use dash as /bin/sh to make sure shutdown work with nss-ldap when
/usr/ is on a separate partition. With this setup, I discovered that
xen-create-image fail to work. I get messages like this in the build
log:
Running hook 10-disable-tls
/usr/lib/xen-tools/common.sh: 19: function: not found
/usr/lib/xen-tools/common.sh: 51: function: not found
/usr/lib/xen-tools/common.sh: 77: logMessage: not found
assert failed: /usr/lib/xen-tools/sarge.d/10-disable-tls: []
hook 10-disable-tls: done.
This patch solve these problems.
- Use () instead of the funciton keyward
- Avoid [[ ]], use [ ] instead.
- Do not assume $LINENO is set by adding quotes around it to get the
assert function limping along when it is empty.
--- /usr/lib/xen-tools/common.sh.orig 2006-11-19 01:35:14.000000000 +0100
+++ /usr/lib/xen-tools/common.sh 2006-11-19 01:57:13.000000000 +0100
@@ -16,7 +16,7 @@
#
# If we're running verbosely show a message, otherwise swallow it.
#
-function logMessage
+logMessage()
{
message="$*"
@@ -31,7 +31,7 @@
# Test the given condition is true, and if not abort.
#
# Sample usage:
-# assert $LINENO "${verbose}"
+# assert "$LINENO" "${verbose}"
#
assert ()
{
@@ -48,7 +48,7 @@
#
# Install a Debian package via apt-get.
#
-function installDebianPackage
+installDebianPackage()
{
prefix=$1
package=$2
@@ -61,13 +61,13 @@
#
# We require a package + prefix
#
- assert $LINENO "${package}"
- assert $LINENO "${prefix}"
+ assert "$LINENO" "${package}"
+ assert "$LINENO" "${prefix}"
#
# Prefix must be a directory.
#
- assert $LINENO -d ${prefix}
+ assert "$LINENO" -d ${prefix}
#
# Install the package
@@ -81,7 +81,7 @@
#
# Remove a Debian package.
#
-function removeDebianPackage
+removeDebianPackage()
{
prefix=$1
package=$2
@@ -94,13 +94,13 @@
#
# We require a package + prefix
#
- assert $LINENO "${package}"
- assert $LINENO "${prefix}"
+ assert "$LINENO" "${package}"
+ assert "$LINENO" "${prefix}"
#
# Prefix must be a directory.
#
- assert $LINENO -d ${prefix}
+ assert "$LINENO" -d ${prefix}
#
# Purge the package
@@ -113,7 +113,7 @@
#
# Install a CentOS4 package via yum
#
-function installCentOS4Package
+installCentOS4Package()
{
prefix=$1
package=$2
@@ -126,13 +126,13 @@
#
# We require a package + prefix
#
- assert $LINENO "${package}"
- assert $LINENO "${prefix}"
+ assert "$LINENO" "${package}"
+ assert "$LINENO" "${prefix}"
#
# Prefix must be a directory.
#
- assert $LINENO -d ${prefix}
+ assert "$LINENO" -d ${prefix}
#
# Install the package
@@ -146,7 +146,7 @@
#
# TODO: STUB
#
-function installGentooPackage
+installGentooPackage()
{
prefix=$1
package=$2
--- /usr/lib/xen-tools/sarge.d/40-setup-networking.orig 2006-11-19
01:41:34.000000000 +0100
+++ /usr/lib/xen-tools/sarge.d/40-setup-networking 2006-11-19
01:45:00.000000000 +0100
@@ -35,7 +35,7 @@
#
# A function to setup DHCP for our new image.
#
-function setupDynamicNetworking
+setupDynamicNetworking()
{
#
# The host is using DHCP.
@@ -65,7 +65,7 @@
#
# A function to setup static IP addresses for our new image.
#
-function setupStaticNetworking
+setupStaticNetworking()
{
#
# if $p2p is set then add a "pointtopoint" setting.
@@ -131,7 +131,7 @@
#
# Call the relevant function
#
-if [[ -z "${dhcp}" ]]; then
+if [ -z "${dhcp}" ]; then
logMessage "Setting up static networking"
setupStaticNetworking
@@ -144,4 +144,4 @@
#
# Log our finish
#
-logMessage Script $0 finished
\ Intet linjeskift ved filafslutning
+logMessage Script $0 finished
--- /usr/lib/xen-tools/sarge.d/50-setup-hostname.orig 2006-11-19
01:45:47.000000000 +0100
+++ /usr/lib/xen-tools/sarge.d/50-setup-hostname 2006-11-19
01:46:11.000000000 +0100
@@ -39,7 +39,7 @@
# Fixup the /etc/hosts file upon the new image for
# machines with static IPs
#
-if [[ -z "${dhcp}" ]]; then
+if [ -z "${dhcp}" ]; then
# Non-IPv6 stuff.
grep -v '\(::\|IPv6\)' /etc/hosts > ${prefix}/etc/hosts
@@ -56,7 +56,7 @@
#
# Allow the host system to know the IP address of our new guest.
#
-if [[ -z "${dhcp}" ]]; then
+if [ -z "${dhcp}" ]; then
if ( grep ${hostname} /etc/hosts > /dev/null ) ; then
tester
-- System Information:
Debian Release: 4.0
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/dash
Kernel: Linux 2.6.17-2-xen-686
Locale: LANG=nb_NO.UTF-8, LC_CTYPE=nb_NO.UTF-8 (charmap=UTF-8)
Versions of packages xen-tools depends on:
ii debootstrap 0.3.3 Bootstrap a basic Debian system
ii libtext-template-perl 1.44-1.1 Text::Template perl module
ii perl-modules 5.8.8-6.1 Core Perl modules
Versions of packages xen-tools recommends:
ii perl-doc 5.8.8-6.1 Perl documentation
ii reiserfsprogs 1:3.6.19-4 User-level tools for ReiserFS file
ii rpmstrap 0.5.2-2 bootstrap a basic RPM-based system
ii xen-hypervisor-3. 3.0-unstable+hg11561-1 The Xen Hypervisor on i386-class
ii xen-hypervisor-3. 3.0.3-0-2 The Xen Hypervisor on i386
ii xfsprogs 2.8.11-1 Utilities for managing the XFS fil
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]