void-packages icon indicating copy to clipboard operation
void-packages copied to clipboard

brother-brscan4: update to 0.4.11

Open shahab-vahedi opened this issue 1 year ago • 6 comments

Testing the changes

  • I tested the changes in this PR: briefly

Local build testing

  • I built this PR locally for my native architecture, x86_64-glibc
Along the way, I have also made the package template look closer
to brother-brscan5. That practically means:

- Adding symlink in /etc/opt/... to configuration files in /opt/...
- Handle udev rule

Also, I have updated the README.voidlinux (URL mentioned in there was
not valid anymore) AND added brscan_{c,g}netconfig files to the
package. Else, "brsaneconfig4" would complain when adding a new device.

shahab-vahedi avatar Aug 04 '24 19:08 shahab-vahedi

moving the config file will break the package for users

classabbyamp avatar Aug 06 '24 02:08 classabbyamp

moving the config file will break the package for users

Good catch! What about something like this as install hooks?

INSTALL:
case "${ACTION}" in
    pre)
    # Copy any existing config file that is not a symlink
    for config in Brsane4.ini brsanenetdevice4.cfg models4/; do
        if [ ! -L /etc/opt/brother/scanner/brscan4/${config} ]; then
            cp -r /etc/opt/brother/scanner/brscan4/${config} /tmp/${config}.brscan.upgrade
        fi
    done
    post)
    # If there exists any config file that should be migrated, handle it
    for config in Brsane4.ini brsanenetdevice4.cfg models4/; do
        if [ -e /tmp/${config}.brscan.upgrade ]; then
            mv /tmp/${config}.brscan.upgrade /opt/brother/scanner/brscan4/${config}
        fi
    done

If you agree, then I'll invest more time in it and test it.

shahab-vahedi avatar Aug 06 '24 08:08 shahab-vahedi

I'm not convinced moving these files to /opt is the right thing to do. /etc is the dir for local admin configs

classabbyamp avatar Aug 06 '24 09:08 classabbyamp

I'm not convinced moving these files to /opt is the right thing to do. /etc is the dir for local admin configs

Sure! I don't feel strong about it either way. I will undo the changes related to the config files and push again. For the record, brother-brscan5 package does keep the config files in /opt.

shahab-vahedi avatar Aug 06 '24 12:08 shahab-vahedi

@classabbyamp , I'm afraid the brsaneconfig4 -q, which queries the added entries:

# brsaneconfig4 -a name=mybrother model=DCP-L8410CDW ip=1.2.3.4
$ brsaneconfig4 -q
  * DCP-L8410CDW [    1.2.3.4]  mybrother

only works under these conditions:

  1. The brsaneconfig4 binary must be in /opt/brother/scanner/brscan4/brsaneconfig4. Hence, we cannot install it with vbin. We can only create a symlink in /usr/bin/.
  2. The configuration files must reside in /opt/brother/scanner/brscanr/ and their symlinks in /etc/opt/....

If any of the 2 above is violated, there will be no output:

# brsaneconfig4 -a name=mybrother model=DCP-L8410CDW ip=1.2.3.4
$ brsaneconfig4 -q

shahab-vahedi avatar Aug 06 '24 16:08 shahab-vahedi

Ping!

shahab-vahedi avatar Aug 27 '24 17:08 shahab-vahedi

Is there anything that I can do to make the review process easier?

shahab-vahedi avatar Sep 09 '24 07:09 shahab-vahedi

Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.

github-actions[bot] avatar Dec 09 '24 02:12 github-actions[bot]