Stale APKBUILDs Detection

By chimo on (updated on )

I wrote a script to detect when my APKBUILDs need to be sync’ed with upstream. Then, I hooked it up to my custom swaybar to be notified.

The script grabs a copy of master.tar.gz from my APKBUILD repo. It iterates through all the APKBUILDs to check if they need to be updated.

It expects the APKBUILDs to have a variable called “_giturl” pointing to the upstream package’s git repository. It also expects either a “_gittag” variable when the APKBUILD is built against a release/tag, or a “_gitcommit” variable when the APKBUILD is built against the latest git commit.

If “_gittag” is present, it uses the “_giturl” to get the latest git-tag, then compares the value with the value of “_gittag”. If they don’t match, the APKBUILD is considered stale.

Similarly, if “_gitcommit” is present, it compares its value with the latest commit from the upstream repository. Different values means a stale APKBUILD.


The shuibar block just calls the script above and displays the number of APKBUILDs that need attention.

It’s the “A: 2” in the following screenshot:

shuibar screenshot