dart-lang / dart-lang/pub-dev

How query for packages which have license A AND/OR license B

Open
#6,176 7 comments 1 reaction 0 assignees View on GitHub
Type: enhancement
Dominant language
Dart
Stars
944
Forks
184
Avg merge
1d 15h
Merged PRs (30d)
12

Description

Unfortunately the search help page on pub.dev does not go into detail on boolean search expressions:
https://pub.dev/help/search

The goal here is to search for packages filtered by a list of licenses which should be either allowed or forbidden.

e.g. `license:mit,gpl-3.0` should list all packages with either MIT or GPL-3.0 license.

I was looking into implementing the filter functionality discussed here:
https://github.com/dart-lang/pub-dev/issues/4373

In this related issue: https://github.com/dart-lang/pub-dev/issues/5490 the option of adding search flags is discussed, but it seems like the license tag can only search for ONE license and not for multiple licenses (any of a given list).

`license:`

I tried the following:

`license:mit license:gpl-3.0` https://pub.dev/packages?q=license%3Amit+license%3Agpl-3.0
-> 2 Results with MIT && GPL-3.0

`license:mit,gpl-3.0` https://pub.dev/packages?q=license%3Amit%2Cgpl-3.0
-> 7 Results all MIT, I would expect all packages with either MIT or GPL-3.0

**Negating works:**

`license:mit -license:gpl-3.0` https://pub.dev/packages?q=license%3Amit+-license%3Agpl-3.0
-> 14874 (which is the list of all mit licensed packages minus those with two licenses)

`license:mit` https://pub.dev/packages?q=license%3Amit
-> 14876

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.