Make build_chroot compatible with Squeeze
authorMichele Tartara <mtartara@google.com>
Tue, 30 Jul 2013 15:17:11 +0000 (15:17 +0000)
committerMichele Tartara <mtartara@google.com>
Wed, 31 Jul 2013 07:03:37 +0000 (09:03 +0200)
Modify build_chroot to make it compatible with debian Squeeze. This
is done by using a function instead of a alias for the command that
was failing.

Fixes Issue 507.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

devel/build_chroot

index 17e67be..c65b5ff 100755 (executable)
@@ -88,14 +88,16 @@ apt-get install -y schroot debootstrap
 
 shopt -s expand_aliases
 alias in_chroot='schroot -c $CHNAME -d / '
-alias subst_variables='sed \
-  -e "s/\${ARCH}/$ARCH/" \
-  -e "s*\${CHDIR}*$CHDIR*" \
-  -e "s/\${CHNAME}/$CHNAME/" \
-  -e "s/\${CHROOTNAME}/$CHROOTNAME/" \
-  -e "s*\${CHROOT_DIR}*$CHROOT_DIR*" \
-  -e "s/\${COMP_FILENAME}/$COMP_FILENAME/" \
-  -e "s/\${DIST_RELEASE}/$DIST_RELEASE/"'
+function subst_variables {
+  sed \
+    -e "s/\${ARCH}/$ARCH/" \
+    -e "s*\${CHDIR}*$CHDIR*" \
+    -e "s/\${CHNAME}/$CHNAME/" \
+    -e "s/\${CHROOTNAME}/$CHROOTNAME/" \
+    -e "s*\${CHROOT_DIR}*$CHROOT_DIR*" \
+    -e "s/\${COMP_FILENAME}/$COMP_FILENAME/" \
+    -e "s/\${DIST_RELEASE}/$DIST_RELEASE/" $@
+}
 
 #Generate chroot configurations
 cat $ACTUAL_DATA_DIR/temp.schroot.conf.in | subst_variables > $TEMP_CHROOT_CONF