a0c83577cc
There would be build errors if multiple builds use the same SSTATE_DIR, and the builds use the different versions' docbook-sgml-dtd-native, the problems are: we have multiple versions docbook-sgml-dtd-native: docbook-sgml-dtd-3.1-native docbook-sgml-dtd-4.1-native docbook-sgml-dtd-4.5-native And they depend on sgml-common-native which installs the file sysroot/etc/sgml/sgml-docbook.cat, this file is also included in the sstate cache file (.tar.gz), but both the 3 versions docbook-sgml-dtd-native may update the sysroot/ect/sgml/sgml-docbook.cat, and it is a hardlink to SYSROOT_DESTDIR/etc/sgml/sgml-docbook.cat, so the sgml-docbook.cat in the sstate cache file may contain the docbook-sgml-dtd-<version>-native's info, and there would be errors when we mirror the sstate-cache to another build which uses a different version. Now we exclude the sgml-docbook.cat from the ${D}, and generate sysroot/ect/sgml/sgml-docbook.cat dynamically will fix the problem, both the sgml-common-native and docbook-sgml-dtd-<version>-native can update it it correctly. The similar to docbook-dsssl-stylesheets-native and openjade-native. [YOCTO #5994] (From OE-Core rev: 50683df81e1605ad7c03bc633aa55da7e97cfe62) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
72 lines
2.9 KiB
BlitzBasic
72 lines
2.9 KiB
BlitzBasic
SUMMARY = "Base utilities for working with SGML and XML"
|
|
DESCRIPTION = "The sgml-common package gathers very basic \
|
|
stuff necessary to work with SGML and XML, such as xml.dcl, \
|
|
a SGML declaration of XML; iso-entities, a list of the basic \
|
|
SGML ISO entities; and install-catalog, a script used to \
|
|
add entries to (or remove entries from) centralized catalogs \
|
|
whose entries are pointers to SGML open catalogs, \
|
|
as defined by OASIS."
|
|
HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
|
|
LICENSE = "GPLv2+"
|
|
# See the comments in license.patch when upgrading this recipe.
|
|
# This is inteded to be a temporary workaround.
|
|
LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
|
|
SECTION = "base"
|
|
|
|
PR = "r1"
|
|
|
|
require sgml-common_${PV}.bb
|
|
inherit native
|
|
|
|
S = "${WORKDIR}/sgml-common-${PV}"
|
|
|
|
SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
|
|
SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
|
|
CLEANFUNCS += "sgml_common_sstate_clean"
|
|
|
|
|
|
do_install_append() {
|
|
# install-catalog script contains hard-coded references to
|
|
# {sysconfdir}. Change it to ${D}${sysconfdir}.
|
|
sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog
|
|
|
|
${D}${bindir}/install-catalog \
|
|
--add ${D}${sysconfdir}/sgml/sgml-ent.cat \
|
|
${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
|
|
|
|
# The sgml-docbook.cat will be regenerated by sstate_postinst
|
|
rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat
|
|
}
|
|
|
|
sgml_common_native_mangle () {
|
|
# Revert back to ${sysconfdir} path in install-catalog
|
|
sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog
|
|
# Change path from ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog to ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog in sgml-ent.cat
|
|
sed -i -e "s|${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-ent.cat
|
|
# Remove ${D} path from catalog file created by install-catalog script
|
|
sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog
|
|
}
|
|
|
|
sgml_common_sstate_postinst() {
|
|
if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
|
|
then
|
|
${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat
|
|
if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then
|
|
for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do
|
|
if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then
|
|
${bindir}/install-catalog \
|
|
--add ${sysconfdir}/sgml/sgml-docbook.cat $catalog
|
|
fi
|
|
done
|
|
fi
|
|
fi
|
|
}
|
|
|
|
sgml_common_sstate_clean () {
|
|
# Ensure that the catalog file sgml-docbook.cat is properly
|
|
# updated when the package is removed from sstate cache.
|
|
if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
|
|
sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
|
|
fi
|
|
}
|