Set the actual LANG and LC_ALL values inside the generated scripts instead of exported envars.
This commit is contained in:
parent
ad71d98ef1
commit
d87b293ccd
6 changed files with 17 additions and 41 deletions
|
@ -1212,8 +1212,6 @@ $HEADER
|
||||||
|
|
||||||
SRC= /sources
|
SRC= /sources
|
||||||
MOUNT_PT= $BUILDDIR
|
MOUNT_PT= $BUILDDIR
|
||||||
PAGE= $PAGE
|
|
||||||
TIMEZONE= $TIMEZONE
|
|
||||||
|
|
||||||
include makefile-functions
|
include makefile-functions
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,10 @@
|
||||||
<!-- Page size -->
|
<!-- Page size -->
|
||||||
<xsl:param name="page" select="letter"/>
|
<xsl:param name="page" select="letter"/>
|
||||||
|
|
||||||
|
<!-- Locale settings -->
|
||||||
|
<xsl:param name="lang" select="en_ca"/>
|
||||||
|
<xsl:param name="lc_all" select="en_ca"/>
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<xsl:apply-templates select="//sect1"/>
|
<xsl:apply-templates select="//sect1"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
@ -176,8 +180,11 @@
|
||||||
<xsl:when test="ancestor::sect1[@id='bootable-profile'] and
|
<xsl:when test="ancestor::sect1[@id='bootable-profile'] and
|
||||||
contains(string(),'export LANG=')">
|
contains(string(),'export LANG=')">
|
||||||
<xsl:value-of select="substring-before(string(),'export LC_ALL=')"/>
|
<xsl:value-of select="substring-before(string(),'export LC_ALL=')"/>
|
||||||
<xsl:text>export LC_ALL=$LC_ALL
export LANG=$LANG
</xsl:text>
|
<xsl:text>export LC_ALL=</xsl:text>
|
||||||
<xsl:text>export INPUTRC</xsl:text>
|
<xsl:value-of select="$lc_all"/>
|
||||||
|
<xsl:text>
export LANG=</xsl:text>
|
||||||
|
<xsl:value-of select="$lang"/>
|
||||||
|
<xsl:text>
export INPUTRC</xsl:text>
|
||||||
<xsl:value-of select="substring-after(string(),'INPUTRC')"/>
|
<xsl:value-of select="substring-after(string(),'INPUTRC')"/>
|
||||||
<xsl:text>
</xsl:text>
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
|
@ -453,10 +453,6 @@ EOF
|
||||||
echo -e "\t@cp -f $CONFIG \$(MOUNT_PT)/sources/kernel-config" >> $MKFILE.tmp
|
echo -e "\t@cp -f $CONFIG \$(MOUNT_PT)/sources/kernel-config" >> $MKFILE.tmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${this_script}" in
|
|
||||||
*profile* ) wrt_export_lang2 ;; # For /etc/profile we need to set LANG envar.
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Check if we have a real /etc/fstab file
|
# Check if we have a real /etc/fstab file
|
||||||
if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then
|
if [[ `_IS_ $this_script fstab` ]] && [[ -n "$FSTAB" ]] ; then
|
||||||
wrt_copy_fstab "$this_script"
|
wrt_copy_fstab "$this_script"
|
||||||
|
@ -512,10 +508,6 @@ $HEADER
|
||||||
|
|
||||||
SRC= /sources
|
SRC= /sources
|
||||||
MOUNT_PT= $BUILDDIR
|
MOUNT_PT= $BUILDDIR
|
||||||
PAGE= $PAGE
|
|
||||||
TIMEZONE= $TIMEZONE
|
|
||||||
LC_ALL= $LC_ALL
|
|
||||||
LANG= $LANG
|
|
||||||
|
|
||||||
include makefile-functions
|
include makefile-functions
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,9 @@
|
||||||
<!-- Page size -->
|
<!-- Page size -->
|
||||||
<xsl:param name="page" select="letter"/>
|
<xsl:param name="page" select="letter"/>
|
||||||
|
|
||||||
|
<!-- Locale settings -->
|
||||||
|
<xsl:param name="lang" select="en_ca"/>
|
||||||
|
|
||||||
<xsl:template match="/">
|
<xsl:template match="/">
|
||||||
<xsl:apply-templates select="//sect1"/>
|
<xsl:apply-templates select="//sect1"/>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
@ -133,7 +136,8 @@
|
||||||
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
|
<xsl:when test="ancestor::sect1[@id='ch-scripts-profile'] and
|
||||||
contains(string(),'export LANG=')">
|
contains(string(),'export LANG=')">
|
||||||
<xsl:value-of select="substring-before(string(),'export LANG=')"/>
|
<xsl:value-of select="substring-before(string(),'export LANG=')"/>
|
||||||
<xsl:text>export LANG=$LANG</xsl:text>
|
<xsl:text>export LANG=</xsl:text>
|
||||||
|
<xsl:value-of select="$lang"/>
|
||||||
<xsl:value-of select="substring-after(string(),'modifiers]')"/>
|
<xsl:value-of select="substring-after(string(),'modifiers]')"/>
|
||||||
<xsl:text>
</xsl:text>
|
<xsl:text>
</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
|
|
|
@ -255,10 +255,6 @@ chapter789_Makefiles() {
|
||||||
wrt_unpack2 "$FILE"
|
wrt_unpack2 "$FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "${this_script}" in
|
|
||||||
*profile* ) wrt_export_lang ;; # For /etc/profile we need to set LANG envar.
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Check if we have a real /etc/fstab file
|
# Check if we have a real /etc/fstab file
|
||||||
if [[ `_IS_ ${this_script} fstab` ]] && [[ -n "$FSTAB" ]] ; then
|
if [[ `_IS_ ${this_script} fstab` ]] && [[ -n "$FSTAB" ]] ; then
|
||||||
wrt_copy_fstab "${this_script}"
|
wrt_copy_fstab "${this_script}"
|
||||||
|
@ -309,9 +305,6 @@ $HEADER
|
||||||
|
|
||||||
SRC= /sources
|
SRC= /sources
|
||||||
MOUNT_PT= $BUILDDIR
|
MOUNT_PT= $BUILDDIR
|
||||||
PAGE= $PAGE
|
|
||||||
TIMEZONE= $TIMEZONE
|
|
||||||
LANG= $LANG
|
|
||||||
|
|
||||||
include makefile-functions
|
include makefile-functions
|
||||||
|
|
||||||
|
|
|
@ -420,21 +420,6 @@ EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
|
||||||
wrt_export_lang() { #
|
|
||||||
#----------------------------------#
|
|
||||||
echo -e '\t@echo "export LANG=$(LANG)" > envars' >> $MKFILE.tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
|
||||||
wrt_export_lang2() { #
|
|
||||||
#----------------------------------#
|
|
||||||
echo -e '\t@echo "export LC_ALL=$(LC_ALL)" > envars' >> $MKFILE.tmp
|
|
||||||
echo -e '\t@echo "export LANG=$(LANG)" >> envars' >> $MKFILE.tmp
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
wrt_export_pkgdir() { #
|
wrt_export_pkgdir() { #
|
||||||
#----------------------------------#
|
#----------------------------------#
|
||||||
|
@ -633,12 +618,11 @@ extract_commands() { #
|
||||||
--stringparam testsuite $TEST \
|
--stringparam testsuite $TEST \
|
||||||
--stringparam timezone $TIMEZONE \
|
--stringparam timezone $TIMEZONE \
|
||||||
--stringparam page $PAGE \
|
--stringparam page $PAGE \
|
||||||
|
--stringparam lang $LANG \
|
||||||
|
--stringparam lc_all $LC_ALL \
|
||||||
--stringparam keymap $KEYMAP \
|
--stringparam keymap $KEYMAP \
|
||||||
--stringparam grsecurity_host $GRSECURITY_HOST \
|
--stringparam grsecurity_host $GRSECURITY_HOST \
|
||||||
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
||||||
for i in $(find ./${PROGNAME}-commands/chapter07/*) ; do
|
|
||||||
sed -i 's/"EOF"/EOF/g' $i ;
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
lfs)
|
lfs)
|
||||||
echo -n "${tab_} ${L_arrow}${BOLD}LFS${R_arrow} build"
|
echo -n "${tab_} ${L_arrow}${BOLD}LFS${R_arrow} build"
|
||||||
|
@ -648,10 +632,8 @@ extract_commands() { #
|
||||||
--stringparam vim-lang $VIMLANG \
|
--stringparam vim-lang $VIMLANG \
|
||||||
--stringparam timezone $TIMEZONE \
|
--stringparam timezone $TIMEZONE \
|
||||||
--stringparam page $PAGE \
|
--stringparam page $PAGE \
|
||||||
|
--stringparam lang $LANG \
|
||||||
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
|
||||||
for i in $(find ./${PROGNAME}-commands/chapter07/*) ; do
|
|
||||||
sed -i 's/"EOF"/EOF/g' $i ;
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
blfs)
|
blfs)
|
||||||
echo -n "${tab_} ${L_arrow}${BOLD}BLFS${R_arrow} build"
|
echo -n "${tab_} ${L_arrow}${BOLD}BLFS${R_arrow} build"
|
||||||
|
|
Reference in a new issue