From c2dcf16a1ca58a9e7b9b932aaccd43454dcfeb21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 17 Sep 2019 09:07:33 +0200 Subject: [PATCH] app-text/docbook-xml-dtd: Restore .cat backup for non-empty too MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Górny --- app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild | 6 ++++-- app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild | 6 ++++-- app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild | 6 ++++-- app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild | 6 ++++-- app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild index fdf2ac2ad673..9d06ca5a5154 100644 --- a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild +++ b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild @@ -49,8 +49,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/xml-docbook-${PV}.cat ]]; then - cp "${T}"/xml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/xml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/xml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi build-docbook-catalog sgml-catalog-r1_pkg_postinst diff --git a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild index db788fca68f3..2864178f068a 100644 --- a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild +++ b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild @@ -49,8 +49,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/xml-docbook-${PV}.cat ]]; then - cp "${T}"/xml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/xml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/xml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi build-docbook-catalog sgml-catalog-r1_pkg_postinst diff --git a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild index db788fca68f3..2864178f068a 100644 --- a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild +++ b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild @@ -49,8 +49,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/xml-docbook-${PV}.cat ]]; then - cp "${T}"/xml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/xml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/xml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi build-docbook-catalog sgml-catalog-r1_pkg_postinst diff --git a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild index d0987c01141c..fb841c4266b0 100644 --- a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild +++ b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild @@ -50,8 +50,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/xml-docbook-${PV}.cat ]]; then - cp "${T}"/xml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/xml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/xml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi build-docbook-catalog sgml-catalog-r1_pkg_postinst diff --git a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild index d0987c01141c..fb841c4266b0 100644 --- a/app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild +++ b/app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild @@ -50,8 +50,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/xml-docbook-${PV}.cat ]]; then - cp "${T}"/xml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/xml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/xml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi build-docbook-catalog sgml-catalog-r1_pkg_postinst -- 2.26.2