app-text/sgmltools-lite: Restore .cat backup for non-empty too
authorMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:07:42 +0000 (09:07 +0200)
committerMichał Górny <mgorny@gentoo.org>
Tue, 17 Sep 2019 07:11:57 +0000 (09:11 +0200)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
app-text/sgmltools-lite/sgmltools-lite-3.0.3-r15.ebuild

index b8d8da45abc779ec318f0418c3a8fc2e96b20742..b23d92b022ee62b980f81042e02eb1228cf9b3d3 100644 (file)
@@ -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
 }