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

app-text/xhtml1: Restore .cat backup for non-empty too

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

 app-text/xhtml1/xhtml1-20020801-r6.ebuild | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app-text/xhtml1/xhtml1-20020801-r6.ebuild 
b/app-text/xhtml1/xhtml1-20020801-r6.ebuild
index 306fefc150c..f8356d929bb 100644
--- a/app-text/xhtml1/xhtml1-20020801-r6.ebuild
+++ b/app-text/xhtml1/xhtml1-20020801-r6.ebuild
@@ -46,8 +46,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/xhtml1.cat ]]; then
-               cp "${T}"/xhtml1.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/xhtml1.cat
+       local real=${EROOT}/etc/sgml/xhtml1.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        sgml-catalog-r1_pkg_postinst
 

Reply via email to