On Fri, May 03, 2013 at 09:54:42PM -0500, Bruce Dubbs wrote: > I'm going to write a program to automatically identify out of date > packages for LFS. Has anyone already done such a beast? > > Has anyone else looked at this?
Hi. I wrote something like that not long ago. Here some ideas you might find helpful: 1. Lots of packages use git tagging for new versions, so if you have local git clone, you can periodically pull and check for new tags. I use alias like that for sorting tags by date (works only for annotated tags -- not every project uses them): [alias] sorted-tags = for-each-ref --sort='*authordate' --format='%(tag)' refs/tags Without alias it can be used like that from the root of git cloned tree: git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags 2. The most reliable way I found to compare verions is using coreutils sort (newer versions have -V flag for sorting versions): BIGGER=`echo -e "$1\n$2" | sort -V | head -n 1` 3. I also found checking package versions in testing branches of other distributions quite handy. Arch Linux testing branch is particulary easy to work with. I periodically pull from these two repositories: git://projects.archlinux.org/svntogit/packages.git git://projects.archlinux.org/svntogit/community.git Parsing versions from these repositories is trivial -- just sourcing sh scripts and checking ${pkgver}. One caveat -- not everything is up to date in Arch Linux testing (but mostly everything, they are quite quick to update), so you need to use other sources too. 4. Some projects use special "announce" mailing lists to announce new versions, like gnu-announce for example. These mailing lists can be used manually alongside automated scripted version checking. As for parsing file listings -- I thought about that, but think it is less reliable and more clunky way than everything above combined. The code for my version checker is in my git: https://github.com/alekseyrybalkin/kiin/blob/master/kiin The code is not very well organized, but you can lookup "prepare-check-updates", "check-updates" and "vercomp" strings. I check git tags for linux and linux-stable versions (to check other packages is in my TODO-list) and Arch Linux community/core repos.
pgpiyVNGDjY5q.pgp
Description: PGP signature
-- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page