dvershinin / lastversion

Find the latest release version of an arbitrary project
https://lastversion.getpagespeed.com
BSD 2-Clause "Simplified" License
377 stars 33 forks source link

Alpine packages support #83

Open rodrigoaguilera opened 2 years ago

rodrigoaguilera commented 2 years ago

I want to be able to do something like lastversion https://pkgs.alpinelinux.org/package/v3.16/main/x86_64/git and get 2.36.2-r0

Basically to be able to update packages without lokking manually at the alpine linux page

dvershinin commented 1 year ago

@rodrigoaguilera as I'm not familiar with Alpine, can you please explain in further detail? Isn't there a command like apk upgrade <pkg name> to do what you want?

rodrigoaguilera commented 1 year ago

Sure I can explain. I have a dockerfile that fixes the versions of packages so instead of having steps like apk add <pkg name> I add the version like apk add <pkg name>=<current version>. This way I have no surprises when package is updated and I can track package upgrades in version control. I use lastversion to be able to automate the process that edits the dockerfile with the latest versions but sometime there is a mismatch between the upstream and what is in alpine package repository so that is why I want to know what is the "lastversion" in alpine.

dvershinin commented 1 year ago

@rodrigoaguilera I guess this won't be implemented for the time being. I've checked if there's something easily parseable like rss feed for package updates, but there's none there. Parsing HTML I'd like to avoid, as a different website layout will yield broken fetching of the versions... Unless you have other ideas than parsing that page :)

rodrigoaguilera commented 1 year ago

I understand is a big effort. An alternative to parsing HTML is to fetch the APKBUILD file for the package and from there read the pkgver and pkgrel variables. With those you can build the version but the alpine version also needs to be provided somehow to fetch the APKBUILD file from a specific release. An example: https://git.alpinelinux.org/aports/tree/main/git/APKBUILD?h=3.17-stable

I don't have the bandwidth right now to contribute this change to lastversion just dropping an idea that doesn't involve HTML.