[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] live-wrapper: Fix customise.sh/customize.sh mix



live-wrapper was testing if hooks/customise.sh exists but it was executing
hooks/customize.sh instead
Adopt a single spelling for coherence
As both are correct, adopt "customize" to be coherent to the argument --customize
---

Path based on git://anonscm.debian.org/debian-live/live-wrapper.git

 bin/lwr                     |  4 ++--
 debian/live-wrapper.install |  2 +-
 doc/quickstart.rst          |  2 +-
 hooks/customise.sh          | 22 ----------------------
 hooks/customize.sh          | 22 ++++++++++++++++++++++
 lwr/vm.py                   | 10 +++++-----
 6 files changed, 31 insertions(+), 31 deletions(-)
 delete mode 100755 hooks/customise.sh
 create mode 100755 hooks/customize.sh

diff --git a/bin/lwr b/bin/lwr
index de1fef6..0ebf180 100755
--- a/bin/lwr
+++ b/bin/lwr
@@ -211,9 +211,9 @@ class LiveWrapper(cliapp.Application):
         # Create work directory
         self.cdroot = tempfile.mkdtemp()  # all other directories are based off this
 
-        logging.debug("Setting environment variables for customise hook...")
+        logging.debug("Setting environment variables for customize hook...")
 
-        # Make options available to customise hook in vmdebootstrap
+        # Make options available to customize hook in vmdebootstrap
         os.environ['LWR_MIRROR'] = self.settings['mirror']
         os.environ['LWR_DISTRIBUTION'] = self.settings['distribution']
         os.environ['LWR_TASK_PACKAGES'] = self.settings['tasks']
diff --git a/debian/live-wrapper.install b/debian/live-wrapper.install
index 77e500e..652e4c9 100644
--- a/debian/live-wrapper.install
+++ b/debian/live-wrapper.install
@@ -1,3 +1,3 @@
 usr/bin
 usr/lib
-hooks/customise.sh usr/share/live-wrapper
+hooks/customize.sh usr/share/live-wrapper
diff --git a/doc/quickstart.rst b/doc/quickstart.rst
index bbcad77..bd57ce0 100644
--- a/doc/quickstart.rst
+++ b/doc/quickstart.rst
@@ -25,7 +25,7 @@ Customising the Image
 ---------------------
 
 There are a number of supported command-line arguments that can be passed to
-live-wrapper. These change the behaviour to create a customised image.
+live-wrapper. These change the behaviour to create a customized image.
 
 Changing the Distribution
 ~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/hooks/customise.sh b/hooks/customise.sh
deleted file mode 100755
index abb5bf0..0000000
--- a/hooks/customise.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-set -e
-
-rootdir=$1
-
-# common needs rootdir to already be defined.
-. /usr/share/vmdebootstrap/common/customise.lib
-
-trap cleanup 0
-
-mount_support
-disable_daemons
-
-prepare_apt_source "${LWR_MIRROR}" "${LWR_DISTRIBUTION}"
-
-chroot ${rootdir} apt-get -y install initramfs-tools live-boot live-config ${LWR_TASK_PACKAGES} ${LWR_EXTRA_PACKAGES} task-laptop task-english libnss-myhostname
-
-echo "blacklist bochs-drm" > $rootdir/etc/modprobe.d/qemu-blacklist.conf
-
-replace_apt_source
-
diff --git a/hooks/customize.sh b/hooks/customize.sh
new file mode 100755
index 0000000..b5a0178
--- /dev/null
+++ b/hooks/customize.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -e
+
+rootdir=$1
+
+# common needs rootdir to already be defined.
+. /usr/share/vmdebootstrap/common/customize.lib
+
+trap cleanup 0
+
+mount_support
+disable_daemons
+
+prepare_apt_source "${LWR_MIRROR}" "${LWR_DISTRIBUTION}"
+
+chroot ${rootdir} apt-get -y install initramfs-tools live-boot live-config ${LWR_TASK_PACKAGES} ${LWR_EXTRA_PACKAGES} task-laptop task-english libnss-myhostname
+
+echo "blacklist bochs-drm" > $rootdir/etc/modprobe.d/qemu-blacklist.conf
+
+replace_apt_source
+
diff --git a/lwr/vm.py b/lwr/vm.py
index 8a8fa35..90673f5 100644
--- a/lwr/vm.py
+++ b/lwr/vm.py
@@ -29,7 +29,7 @@ class VMDebootstrap(object):
 
     def __init__(self, distribution, architecture, mirror=None, cdroot='/tmp/'):
         self.cdroot = cdroot
-        # FIXME: The customise script needs to be specified in the command line
+        # FIXME: The customize script needs to be specified in the command line
         # arguments, falling back to /usr/share/vmdebootstrap/hooks/customize.sh
         # if no script is specified and hooks/customize.sh does not exist in
         # the current directory.
@@ -49,11 +49,11 @@ class VMDebootstrap(object):
 
         # FIXME: Logging should happen here
         if os.path.exists(os.path.join(".", "hooks", "customize.sh")):
-            self.args.extend(["--customize", "hooks/customise.sh"])
-        elif os.path.exists("/usr/share/live-wrapper/customise.sh"):
-            self.args.extend(["--customize", "/usr/share/live-wrapper/customise.sh"])
+            self.args.extend(["--customize", "hooks/customize.sh"])
+        elif os.path.exists("/usr/share/live-wrapper/customize.sh"):
+            self.args.extend(["--customize", "/usr/share/live-wrapper/customize.sh"])
         else:
-            raise cliapp.AppException("Could not locate customise.sh")
+            raise cliapp.AppException("Could not locate customize.sh")
 
     def run(self):
         print(' '.join(self.args))
-- 
2.7.4


Reply to: