On Sat, Dec 05, 2015 at 11:20:41AM -0800, openbsd-m...@clark-communications.com wrote: > One approach would be to scrape http://www.openbsd.org/errata.html > <http://www.openbsd.org/errata.html>, and figure out the release numbers, and > then scrape the errata page of a particular release to obtain the patch > numbers.
If you're just looking for a raw number that will increase for every patch added, you shouldn't need to scrape the website. There is a tarball containing all patches for a given release, eg: http://ftp.openbsd.org/pub/OpenBSD/patches/5.8.tar.gz It is updated once a day. If you retrieve this, you can get a crude 'patch level' by just counting the number of entries in this tarball: $ tar -tzf 5.8.tar.gz | wc -l 10 If you want to remove the whitespace, you can pipe through tr: $ tar -tzf 5.8.tar.gz | wc -l | tr -d '[:space:]' 10$ But it sounds like you're using CVS, so I don't think you even need to bother with the errata page. If you are updating CVS via cron, then add the -q flag to your cvs up command. If anything in the stable tree is updated, then you'll get an email from cron listing the updated files and then you can go build a new release using your usual method. Everything that ends up on the errata page is also in CVS, so you won't miss anything. If you do something like this, then the 'patch level' can be reduced to just the day you did the build, and you can include this in your build by creating a siteXX file: http://www.openbsd.org/faq/faq4.html#site Where your siteXX.tgz contains a file with the date you did the build (say, /etc/builddate). Then you can easily see if your machines are running the most recent build by comparing the contents of that file to the date you did your most recent build. Anyway, I know this isn't quite what you were after (machine readable version / patch level), but if you're just looking to know when to do a new release build, then you should be able to get there by just tracking CVS. If you're just looking to track errata, then the tarball can help you without having to scrape the website, and if you'd prefer to not hit the website unnecessarily, then tracking the www CVS repo can tell you when the errata pages have changed, and then you can retrieve the patch tarball without having to scrape out info about the actual patch numbers. Todd