app-text/linuxdoc-tools: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:38 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:55 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/linuxdoc-tools/linuxdoc-tools-0.9.73-r1.ebuild

index 4f2129a2644ab3bfe682204b2b1a429a0140f29a..0639b6ae8b3dcda719fcdcee3a4974b5d76d4d81 100644 (file)
@@ -72,8 +72,10 @@ pkg_preinst() {
 }
 
 pkg_postinst() {
-       if [[ ! -f ${EROOT}/etc/sgml/linuxdoc.cat ]]; then
-               cp "${T}"/linuxdoc.cat "${EROOT}"/etc/sgml/ || die
+       local backup=${T}/linuxdoc.cat
+       local real=${EROOT}/etc/sgml/linuxdoc.cat
+       if ! cmp -s "${backup}" "${real}"; then
+               cp "${backup}" "${real}" || die
        fi
 
        latex-package_pkg_postinst