Package Details: rearx-bin 0.1.4-1

Git Clone URL: https://aur.archlinux.org/rearx-bin.git (read-only, click to copy)
Package Base: rearx-bin
Description: A TUI client for the Searx meta-engine, written in Rust
Upstream URL: https://github.com/garak92/rearx
Keywords: search searx tui
Licenses: GPL v3.0
Provides: rearx
Submitter: elimgarak
Maintainer: elimgarak
Last Packager: elimgarak
Votes: 2
Popularity: 0.000000
First Submitted: 2021-03-18 02:36 (UTC)
Last Updated: 2021-03-23 01:47 (UTC)

Latest Comments

elimgarak commented on 2021-12-18 23:26 (UTC) (edited on 2021-12-18 23:26 (UTC) by elimgarak)

Hello, m040601! Many thanks for your interesting on improving this humble package of mine. Indeed, the config file thing is bad and has been bugging me for a while. I will be on vacation time this month, so I will use that time to implement the following feature: rearx will check if a config file exists; if it does not exists, then it will prompt the user to create one; if the user agrees, rearx will ask them to input their searx instance of choice.

Regarding your advices on packaging, this is my first time packaging on the AUR, so your comment is greatly appreciated. I will take care of improving this aspect as well.

Cheers.

m040601 commented on 2021-12-16 17:15 (UTC) (edited on 2021-12-16 17:32 (UTC) by m040601)

Thanks for your work providing this PKGBUILD for this very interesting searx tool.

Mandatory: In order to use Rearx, you first need to create the folder /etc/rearx/
and copy the rearx.yaml configuration file in there. Inside this file, you specify
which instance of Searxyou will connect to

It's a little awkward that after installing this PKGBUILD, one has to go back to the internet, search the github repo, and then copy the rearx.yaml file to your computer.

Could you please update this PKGBUILD so that it also pull it to be installed ?

....I don't think there is a sane default in this case: ¿Which Searx instance would be the default one? ...

Please dont complicate. Just pull exactly what's on github, and name it "example" or something. Should end up in something like for ex:

/etc/rearx/rearx.yaml.example

or

/usr/share/doc/rearx/rearx.yaml.example

And by the way, "rearx --help" doesnt provide anything, so the github README (and the missing LICENSE) is also needed.

/usr/share/doc/rearx/README
/usr/share/licences/rearx/LICENSE

Please dont create folders name "rearx-bin", like for ex "/usr/share/rearx-bin" or "/etc/rearx-bin/something" That's not the Archlinux standard. Even if this PKGBUILD is called "rearx-bin", they should be named "rearx" and not "rearx-bin".

Maybe later there will be another PKGBUILD called "rearx" building from source. And the way to prevent conflicts is to had a "Conflicts with " tag on the PKBUILD recipe. So that the user either installs "rearx" or "rearx-bin". But not both.

Thanks in advance

BachoSeven commented on 2021-09-09 14:25 (UTC)

Prompting for the creation of the file sounds good, perhaps a default configuration without any selected instance(i.e. empty field) could be good, and the program could just mention the fact that the file needs to be tweaked before the program actually works (at least for now).

elimgarak commented on 2021-09-09 14:06 (UTC)

@BachoSeven

Thank you very much for your comment, any feedback is greatly appreciated. The reason why I didn't go for the route of creating and packaging a default configuration file inside /usr/share/rearx-bin is because I don't think there is a sane default in this case: ¿Which Searx instance would be the default one? Even if I had the permission of the owner of a particular instance to set it as default (or even if I created my own), this would make the entire program dependent on the existence and availability of said instance, which I don't think is good.

However, I do agree that panicking is a bit nasty. A good idea could be: checking if said file exist, and if not, giving the user a prompt such as "File doesn't exist. Do you want to create it now? (y/n)" and if the user says "yes", another prompt asking for the Searx instance url and, in the future, other configurations such as search language that may apply. I am curious to know what you think of this.

Cheers.

BachoSeven commented on 2021-09-09 08:49 (UTC)

@elimgarak This is failing at runtime with:

thread 'main' panicked at 'Failed to read config file on /etc/rearx/rearx.yaml. Perhaps you need to create it.: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/request.rs:25:39
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Obviously as you mention in the README.md the configuration file needs to be edited, but perhaps you could provide it in this package by default in /usr/share/rearx-bin and then if it doesn't exist in /etc/rearx write a message to stout mentioning it should be copied there(?)

jonathon commented on 2021-03-17 19:18 (UTC) (edited on 2021-03-17 19:19 (UTC) by jonathon)

There are several issues in the PKGBUILD:

  1. It extracts a binary so should either be named -bin or (better) compile from source;
  2. It escapes from package() to write directly to the filesystem, completely missing the point of having a package (and which will break if packaged correctly);
  3. It hard-codes use of a third-party Searx instance; you may want to ask before using someone's tool in your package.

Item 2 can be avoided by having the code read from a system-wide configuration file (https://github.com/garak92/rearx/blob/3b11f76844d507c227368769edaf53008da931cd/src/request.rs#L25) and reading through https://wiki.archlinux.org/index.php/Arch_package_guidelines#Directories