app-text/openjade: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:39 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:56 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/openjade/openjade-1.3.2-r9.ebuild

index 2d63798c3d740857d3666bc4ce7b3a85de66edb6..9aa17662d63f0e6754f8eaac654ae0391f1d822f 100644 (file)
@@ -124,8 +124,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/${P}.cat ]]; then
-               cp "${T}"/${P}.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/${P}.cat
+       local real=${EROOT}/etc/sgml/${P}.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
        # this one's shared with docbook-dsssl, so we need to do it in postinst
        if ! grep -q -s ${P}.cat \