From: Michał Górny Date: Tue, 17 Sep 2019 07:07:31 +0000 (+0200) Subject: app-text/docbook-sgml-dtd: Restore .cat backup for non-empty too X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=299042fc29cbb1cb9dbbcea2c5518761fd3819cb;p=gentoo.git app-text/docbook-sgml-dtd: Restore .cat backup for non-empty too Signed-off-by: Michał Górny --- 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 }