app-text/docbook-xml-simple-dtd: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:34 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:53 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/docbook-xml-simple-dtd/docbook-xml-simple-dtd-1.0-r3.ebuild
app-text/docbook-xml-simple-dtd/docbook-xml-simple-dtd-4.1.2.4-r4.ebuild
app-text/docbook-xml-simple-dtd/docbook-xml-simple-dtd-4.1.2.5-r3.ebuild

index ca6929bbed33c6d1de6f8a2b5a14ccb00f6c5c12..19a3541028bdc96fcc4024c6cac20a3f1819df4b 100644 (file)
@@ -36,8 +36,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat ]]; then
-               cp "${T}"/xml-simple-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/xml-simple-docbook-${PV}.cat
+       local real=${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        build-docbook-catalog
        sgml-catalog-r1_pkg_postinst
index d4e1735315d052cb86c8f2f38f5f7c14ba672280..bd0a32a10e5ed5a610b0c6266aa42606dff091a4 100644 (file)
@@ -39,8 +39,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat ]]; then
-               cp "${T}"/xml-simple-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/xml-simple-docbook-${PV}.cat
+       local real=${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        build-docbook-catalog
        sgml-catalog-r1_pkg_postinst
index b818a587508ee79d0985e8dc408e5b718a616ecf..e68783e3d120e402b938bbf852bc450872c86c4a 100644 (file)
@@ -36,8 +36,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat ]]; then
-               cp "${T}"/xml-simple-docbook-${PV}.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/xml-simple-docbook-${PV}.cat
+       local real=${EROOT}/etc/sgml/xml-simple-docbook-${PV}.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        build-docbook-catalog
        sgml-catalog-r1_pkg_postinst