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

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

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

 app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild 
b/app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild
index b8d8da45abc..b23d92b022e 100644
--- a/app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild
+++ b/app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild
@@ -92,8 +92,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/sgml-lite.cat ]]; then
-               cp "${T}"/sgml-lite.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/sgml-lite.cat
+       local real=${EROOT}/etc/sgml/sgml-lite.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        sgml-catalog-r1_pkg_postinst
 }

Reply via email to