From 299042fc29cbb1cb9dbbcea2c5518761fd3819cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 17 Sep 2019 09:07:31 +0200 Subject: [PATCH] app-text/docbook-sgml-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-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild | 6 ++++-- app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild | 6 ++++-- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild index d72a82568092..1787a5d05c8a 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild index d72a82568092..1787a5d05c8a 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild index d72a82568092..1787a5d05c8a 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild index d72a82568092..1787a5d05c8a 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild index 868d3429aece..118ee2068463 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild index 65e94280b8f3..bef0181183d9 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild index 8e65feba19dc..fd2c41e6679f 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } diff --git a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild index f72a63fe7579..9e8d322d952d 100644 --- a/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild +++ b/app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild @@ -37,8 +37,10 @@ pkg_preinst() { } pkg_postinst() { - if [[ ! -f ${EROOT}/etc/sgml/sgml-docbook-${PV}.cat ]]; then - cp "${T}"/sgml-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die + local backup=${T}/sgml-docbook-${PV}.cat + local real=${EROOT}/etc/sgml/sgml-docbook-${PV}.cat + if ! cmp -s "${backup}" "${real}"; then + cp "${backup}" "${real}" || die fi sgml-catalog-r1_pkg_postinst } -- 2.26.2