app-text/sgml-common: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:41 +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/sgml-common/sgml-common-0.6.3-r7.ebuild

index a9d675c8206af6b14684dd84fbd247c976aea02f..18b9bdd5b860187dce77bdc30b940e3729e9ea7b 100644 (file)
@@ -62,7 +62,7 @@ pkg_preinst() {
 pkg_postinst() {
        # restore backed up files if necessary
        for f in sgml-ent.cat sgml-docbook.cat; do
-               if [[ ! -s ${EROOT}/etc/sgml/${f} ]]; then
+               if ! cmp -s "${T}/${f}" "${EROOT}/etc/sgml/${f}"; then
                        cp "${T}/${f}" "${EROOT}"/etc/sgml/ || die
                fi
        done