app-text/docbook-dsssl-stylesheets: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:30 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:50 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-1.79-r4.ebuild

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