clearlinux / distribution

Placeholder repository to allow filing of general bugs/issues/etc against the Clear Linux OS for Intel Architecture linux distribution
521 stars 29 forks source link

please consider to add wildcards in swupd search #1423

Open seafrog1 opened 4 years ago

seafrog1 commented 4 years ago

Based on my search on torrents - besides forgetting qbittorent - I tried a lot of torrents but a search like *torrent would be quite an enhancement. I now that sounds more easy than it might be to implement ...

lebensterben commented 4 years ago

Based on my search on torrents - besides forgetting qbittorent - I tried a lot of torrents but a search like *torrent would be quite an enhancement. I now that sounds more easy than it might be to implement ...

@seafrog in your specific case, swupd search torrent suffices

Sent with GitHawk

seafrog1 commented 4 years ago

Thx, but this you have to know. If you were a lot of years used to other distributions (in my case Fedora) you try to do an accurate search and if this fails you try wildcards. After you mentioned qbittorrent in the other case if was easy.

lebensterben commented 4 years ago

Thx, but this you have to know. ...

@seafrog1 when you use *torrent it can not be accurate... At least you need a character class before a wildcard. But I've never seen any package managers that support regular expression, not even basic regular expression. For complicated queries, you can always pipe the output to sed or awk, who supports regular expression. And in general it's an anti-pattern to have a program to encompass a huge set of non-essential functionality. A package manager only needs to do his job well. There are two distinct programs that searches for a package for you. swupd search is based bundle information, and it find matches in binary names, bundle names, and bundle descriptions. swups search-file works on manifest files of bundles, which directly search for any occurrences of a query in the manifest files. If you vaguely know the name of a package, or if you know a generic name for that class of packages, swupd search suffices in most cases. If there are too many results, you need -a (or -A?) flag to show the full results. Then you're free to pipe that output to other programs for filtering. If you know the name of a file included in a package, you have swupd search-file.

In your case, many BitTorrent clients have torrent as a keyword, or even directly include it in the name of the binary, and it's also likely to appear in bundle names of bundle descriptions. So swupd search torrent would give all mentions of torrent, and there's no need for having wildcard.

Sent with GitHawk

ahkok commented 4 years ago

We're in the process of coming up with a much more elaborate way of searching "everything" and this is one of the things that we may be able to implement. It's definitely needed.