stefan-langenmaier / brother-overlay

Portage overlay for Brother printer and scanner software
GNU General Public License v3.0
34 stars 42 forks source link

media-gfx/brother-scan4-bin loses its sane config when reinstalled #68

Closed sbraz closed 5 years ago

sbraz commented 5 years ago

Hi, Currently the ebuild makes /etc/opt/brother/scanner/brscan4//brsanenetdevice4.cfg point to ../../../../../opt/brother/scanner/brscan4/brsanenetdevice4.cfg (that is /opt/brother/scanner/brscan4/brsanenetdevice4.cfg). The latter file is not protected so every time the package is installed, I lose the sane config that I added by calling brsaneconfig4.

I think that we should protect the file, hopefully this is the right way to do it (feel free to pick this diff if you want to commit it):

--- brother-scan4-bin-0.4.6-r1.ebuild   2018-12-30 23:32:08.752459425 +0100
+++ brother-scan4-bin-0.4.6-r2.ebuild   2019-04-28 23:20:24.423364830 +0200
@@ -61,6 +61,9 @@
        echo "brother4" > brscan4.conf || die
        insinto etc/sane.d/dll.d
        doins brscan4.conf
+
+       echo 'CONFIG_PROTECT="/opt/brother/scanner/brscan4/brsanenetdevice4.cfg"' > "${T}/50brscan4" || die
+       doenvd "${T}/50brscan4"
 }

 pkg_postinst() {
stefan-langenmaier commented 5 years ago

Sorry for the long delay and thanks a lot for the input and example. Indeed this is very useful.