Skip to content
vigress8 edited this page May 20, 2024 · 2 revisions

A word of advice

First go and read how Pacup works to have a general understanding of Pacup. Understanding that isn't necessary to use repology variable in your pacscripts, but it helps.

This wiki uses pacup --show-repology <pacscript> command to show the parsed repology response.

Filters and the Filtrate

Let's look at an example of the repology var for brave-browser-bin.pacscript

repology=("project: brave")

Pacup uses the Repology API to get the latest versions of your pacscript. Here's how an API response from the API looks like (truncated) for the brave project.

[
    {
        "repo": "chaotic-aur",
        "srcname": "brave-nightly-bin",
        "binname": "brave-nightly-bin",
        "visiblename": "brave-nightly-bin",
        "version": "1.38.53",
        "licenses": [
            "MPL2"
        ],
        "summary": "Web browser that blocks ads and trackers by default (nightly binary release).",
        "status": "ignored",
        "origversion": "1.38.53-1"
    },
    {
        "repo": "aur",
        "srcname": "brave",
        "binname": "brave",
        "visiblename": "brave",
        "version": "1.29.79",
        "maintainers": [
            "alerque@aur"
        ],
        "licenses": [
            "custom"
        ],
        "summary": "A web browser that stops ads and trackers by default",
        "status": "outdated",
        "origversion": "1.29.79-1"
    },
    ...
    ...
    ...
    {
        "repo": "sabayon_for_gentoo",
        "srcname": "www-client/brave-bin",
        "visiblename": "www-client/brave-bin",
        "version": "1.3.114",
        "maintainers": [
            "fallback-mnt-sabayon@repology"
        ],
        "categories": [
            "www-client"
        ],
        "status": "legacy",
        "origversion": null
    },
    {
        "repo": "sabayon_for_gentoo",
        "srcname": "www-client/brave-bin",
        "visiblename": "www-client/brave-bin",
        "version": "1.15.75",
        "maintainers": [
            "fallback-mnt-sabayon@repology"
        ],
        "categories": [
            "www-client"
        ],
        "status": "outdated",
        "origversion": null
    }
]

Do look here for a rendered version of the API response.

So how will Pacup know which version to consider to be the latest from this response? The answer is through filtering the response. In fact the above response itself is a filtrate of the project filter.

Basic Filters

Project Filter

repology=("project: brave")

The project filter is the most basic filter and is a must for your pacscript to work with Pacup.

The project filter just queries repology with it's value (i.e. brave) in the above code example, which results in the above JSON response being sent back to Pacup.

When executing pacup --show-repology <pacscript> this filter would be absent from the Filters panel.

Status Filter

The status filter is an implicit filter that you don't have to specify in the repology array. It's default value is newest.

Parsed Repology Data
╭────────────────────────────────────── Repology for brave ──────────────────────────────────────╮
│ ╭───────────────────────────────────────── Filters ──────────────────────────────────────────╮ │
│ │ {'status': 'newest'}                                                                       │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭───────────────────────────────────────── Filtrate ─────────────────────────────────────────╮ │
│ │ [                                                                                          │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'aur',                                                                     │ │
│ │ │   │   'srcname': 'brave-bin',                                                            │ │
│ │ │   │   'binname': 'brave-bin',                                                            │ │
│ │ │   │   'visiblename': 'brave-bin',                                                        │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'maintainers': ['alerque@aur'],                                                    │ │
│ │ │   │   'licenses': ['BSD', 'custom:chromium', 'MPL2'],                                    │ │
│ │ │   │   'summary': 'Web browser that blocks ads and trackers by default (binary release)', │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': '1:1.36.116-1'                                                      │ │
│ │ │   },                                                                                     │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'chaotic-aur',                                                             │ │
│ │ │   │   'srcname': 'brave-bin',                                                            │ │
│ │ │   │   'binname': 'brave-bin',                                                            │ │
│ │ │   │   'visiblename': 'brave-bin',                                                        │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'licenses': ['MPL2', 'BSD', 'custom:chromium'],                                    │ │
│ │ │   │   'summary': 'Web browser that blocks ads and trackers by default (binary release)', │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': '1:1.36.116-1'                                                      │ │
│ │ │   },                                                                                     │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'nix_stable_21_11',                                                        │ │
│ │ │   │   'name': 'brave',                                                                   │ │
│ │ │   │   'visiblename': 'brave',                                                            │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'maintainers': [                                                                   │ │
│ │ │   │   │   '[email protected]',                                                     │ │
│ │ │   │   │   '[email protected]',                                                       │ │
│ │ │   │   │   '[email protected]',                                                │ │
│ │ │   │   │   '[email protected]'                                                    │ │
│ │ │   │   ],                                                                                 │ │
│ │ │   │   'licenses': ['MPL-2.0'],                                                           │ │
│ │ │   │   'summary': 'Privacy-oriented browser for Desktop and Laptop computers',            │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': None                                                                │ │
│ │ │   },                                                                                     │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'pclinuxos',                                                               │ │
│ │ │   │   'srcname': 'brave',                                                                │ │
│ │ │   │   'visiblename': 'brave',                                                            │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'summary': 'Brave Web Browser',                                                    │ │
│ │ │   │   'categories': ['Networking/WWW'],                                                  │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': '1.36.116-1pclos2022'                                               │ │
│ │ │   },                                                                                     │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'solus',                                                                   │ │
│ │ │   │   'srcname': 'brave',                                                                │ │
│ │ │   │   'binname': 'brave',                                                                │ │
│ │ │   │   'visiblename': 'brave',                                                            │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'maintainers': ['[email protected]'],                                          │ │
│ │ │   │   'licenses': ['GPL-2.0-or-later', 'GPL-3.0-or-later', 'MPL-2.0'],                   │ │
│ │ │   │   'summary': 'A browser focused on privacy that blocks ads and trackers by default', │ │
│ │ │   │   'categories': ['network.web.browser'],                                             │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': None                                                                │ │
│ │ │   },                                                                                     │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'solus',                                                                   │ │
│ │ │   │   'srcname': 'brave',                                                                │ │
│ │ │   │   'binname': 'brave-dbginfo',                                                        │ │
│ │ │   │   'visiblename': 'brave-dbginfo',                                                    │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'maintainers': ['[email protected]'],                                          │ │
│ │ │   │   'licenses': ['GPL-2.0-or-later', 'GPL-3.0-or-later', 'MPL-2.0'],                   │ │
│ │ │   │   'summary': 'Debug symbols for brave',                                              │ │
│ │ │   │   'categories': ['debug'],                                                           │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': None                                                                │ │
│ │ │   }                                                                                      │ │
│ │ ]                                                                                          │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭────────────────────────────── Selected version (most common) ──────────────────────────────╮ │
│ │ 1.36.116                                                                                   │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯

For most of your pacscripts only using the project filter would be sufficient, but for more complicated pacscripts you would have to delve into the advanced filters.

Advanced Filters

Repo Filter

repology=("project: brave" "repo: aur")

The repo filter's value is the name of the repository you want to filter, so applying the above filter would result in the filtrate only containing the packages from aur.

Parsed Repology Data
╭────────────────────────────────────── Repology for brave ──────────────────────────────────────╮
│ ╭───────────────────────────────────────── Filters ──────────────────────────────────────────╮ │
│ │ {'repo': 'aur', 'status': 'newest'}                                                        │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭───────────────────────────────────────── Filtrate ─────────────────────────────────────────╮ │
│ │ [                                                                                          │ │
│ │ │   {                                                                                      │ │
│ │ │   │   'repo': 'aur',                                                                     │ │
│ │ │   │   'srcname': 'brave-bin',                                                            │ │
│ │ │   │   'binname': 'brave-bin',                                                            │ │
│ │ │   │   'visiblename': 'brave-bin',                                                        │ │
│ │ │   │   'version': '1.36.116',                                                             │ │
│ │ │   │   'maintainers': ['alerque@aur'],                                                    │ │
│ │ │   │   'licenses': ['BSD', 'custom:chromium', 'MPL2'],                                    │ │
│ │ │   │   'summary': 'Web browser that blocks ads and trackers by default (binary release)', │ │
│ │ │   │   'status': 'newest',                                                                │ │
│ │ │   │   'origversion': '1:1.36.116-1'                                                      │ │
│ │ │   }                                                                                      │ │
│ │ ]                                                                                          │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭────────────────────────────── Selected version (most common) ──────────────────────────────╮ │
│ │ 1.36.116                                                                                   │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────────╯
Screenshot

screenshot

Visiblename Filter

repology=("project: brave" "visiblename: brave-nightly-bin")

The visiblename filter's value is the "Package Name" column in the Repology project page. It's useful when you want to track a particular package out of filtrate.

Parsed Repology Data
╭────────────────────────────────────────── Repology for brave ───────────────────────────────────────────╮
│ ╭────────────────────────────────────────────── Filters ──────────────────────────────────────────────╮ │
│ │ {'visiblename': 'brave-nightly-bin', 'status': 'newest'}                                            │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭───────────────────────────────────────────── Filtrate ──────────────────────────────────────────────╮ │
│ │ [                                                                                                   │ │
│ │ │   {                                                                                               │ │
│ │ │   │   'repo': 'aur',                                                                              │ │
│ │ │   │   'srcname': 'brave-nightly-bin',                                                             │ │
│ │ │   │   'binname': 'brave-nightly-bin',                                                             │ │
│ │ │   │   'visiblename': 'brave-nightly-bin',                                                         │ │
│ │ │   │   'version': '1.38.59',                                                                       │ │
│ │ │   │   'maintainers': ['gregbunk@aur'],                                                            │ │
│ │ │   │   'licenses': ['MPL2'],                                                                       │ │
│ │ │   │   'summary': 'Web browser that blocks ads and trackers by default (nightly binary release).', │ │
│ │ │   │   'status': 'ignored',                                                                        │ │
│ │ │   │   'origversion': '1.38.59-1'                                                                  │ │
│ │ │   },                                                                                              │ │
│ │ │   {                                                                                               │ │
│ │ │   │   'repo': 'chaotic-aur',                                                                      │ │
│ │ │   │   'srcname': 'brave-nightly-bin',                                                             │ │
│ │ │   │   'binname': 'brave-nightly-bin',                                                             │ │
│ │ │   │   'visiblename': 'brave-nightly-bin',                                                         │ │
│ │ │   │   'version': '1.38.59',                                                                       │ │
│ │ │   │   'licenses': ['MPL2'],                                                                       │ │
│ │ │   │   'summary': 'Web browser that blocks ads and trackers by default (nightly binary release).', │ │
│ │ │   │   'status': 'ignored',                                                                        │ │
│ │ │   │   'origversion': '1.38.59-1'                                                                  │ │
│ │ │   }                                                                                               │ │
│ │ ]                                                                                                   │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ ╭────────────────────────────────── Selected version (most common) ───────────────────────────────────╮ │
│ │ 1.38.59                                                                                             │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Obscure Filters

All the above filters are the ones that you're most likely to use, but just for being complete I've enlisted them here:

  • subrepo: name of subrepository (if applicable; for example, main or contrib or non-free for Debian).

  • name, srcname, binname: package name(s) as used in repository - generic one and/or source package name and/or binary package name, whichever is applicable (all fields are optional).

  • summary: one-line description of the package.

A tale of caution

As you might have guessed the more filters you add the more specific filtrate you get. So why not just use the advanced filters specifically filter a package always? The reason is that in certain circumstances the more filters you add ironically the more inaccurate you become.

Suppose you've used a visiblename filter to filter in a package (let's call it "A"). This may work right now but it may lead to problems in the future. For instance when the package "A" gets outdated your pacscript and thus pacup will still track that outdated package. Even though other packages (that you've filtered out) might have already been updated.

So, the basic rule of thumb is to always use the basic filters and only use the advanced filters when absolutely necessary.