app-text/docbook-xml-dtd: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:33 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:52 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/docbook-xml-dtd/docbook-xml-dtd-4.1.2-r7.ebuild
app-text/docbook-xml-dtd/docbook-xml-dtd-4.2-r3.ebuild
app-text/docbook-xml-dtd/docbook-xml-dtd-4.3-r2.ebuild
app-text/docbook-xml-dtd/docbook-xml-dtd-4.4-r3.ebuild
app-text/docbook-xml-dtd/docbook-xml-dtd-4.5-r2.ebuild

index fdf2ac2ad673a053bef2b18d63d6b57ad2c64711..9d06ca5a5154dd6fe15364b47008e48d227e92ee 100644 (file)
@@ -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
index db788fca68f32ea73f8378aa902be009f67f4a9f..2864178f068a483ab61b74663c99fff2ef7ef033 100644 (file)
@@ -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
index db788fca68f32ea73f8378aa902be009f67f4a9f..2864178f068a483ab61b74663c99fff2ef7ef033 100644 (file)
@@ -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
index d0987c01141cc26c196fda6275f36c32a6640808..fb841c4266b0b8f3eeace861ad9bd8ba96d7fc75 100644 (file)
@@ -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
index d0987c01141cc26c196fda6275f36c32a6640808..fb841c4266b0b8f3eeace861ad9bd8ba96d7fc75 100644 (file)
@@ -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