commit:     c2dcf16a1ca58a9e7b9b932aaccd43454dcfeb21
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 17 07:07:33 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 17 07:11:52 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2dcf16a

app-text/docbook-xml-dtd: Restore .cat backup for non-empty too

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 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 fdf2ac2ad67..9d06ca5a515 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 db788fca68f..2864178f068 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 db788fca68f..2864178f068 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 d0987c01141..fb841c4266b 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 d0987c01141..fb841c4266b 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

Reply via email to