app-text/docbook-sgml-dtd: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:31 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:51 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.0-r4.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-3.1-r4.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.0-r4.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.1-r4.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.2-r3.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.3-r3.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.4-r1.ebuild
app-text/docbook-sgml-dtd/docbook-sgml-dtd-4.5-r1.ebuild

index d72a825680927deab0f0c3bac92826e6252674b0..1787a5d05c8a3181672de8d9884cd82ae74815c7 100644 (file)
@@ -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
 }
index d72a825680927deab0f0c3bac92826e6252674b0..1787a5d05c8a3181672de8d9884cd82ae74815c7 100644 (file)
@@ -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
 }
index d72a825680927deab0f0c3bac92826e6252674b0..1787a5d05c8a3181672de8d9884cd82ae74815c7 100644 (file)
@@ -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
 }
index d72a825680927deab0f0c3bac92826e6252674b0..1787a5d05c8a3181672de8d9884cd82ae74815c7 100644 (file)
@@ -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
 }
index 868d3429aecef872b2d3a435ee0803a68d2a06f4..118ee2068463b78f3e65b3ffc0bf79cf48ba3e80 100644 (file)
@@ -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
 }
index 65e94280b8f31fd4eb2b09e26e40a3622d539553..bef0181183d93d131998e7de5ad8f8cbfe817321 100644 (file)
@@ -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
 }
index 8e65feba19dc4e4c531703ffebd63676be545ae8..fd2c41e6679fa3b45599f48f28b93e37290506f8 100644 (file)
@@ -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
 }
index f72a63fe7579597cf762942f20ff7a4eff272444..9e8d322d952dde1fc07ba68d53dd93bf3872420d 100644 (file)
@@ -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
 }