[pacman-dev] xdelta patches

Roman Kyrylych roman.kyrylych at gmail.com
Sun Jun 3 07:19:36 EDT 2007

2007/6/3, Dale Ogilvie <pnyli0002 at sneakemail.com>:
> Hello,
> I've made a few alterations to the recently comitted xdelta mods for makepkg &
> wget-xdelta.sh.
> Please check these out in my forum post:
> http://bbs.archlinux.org/viewtopic.php?pid=255563#p255563
> In short, I fixed a couple of bugs, although oldversion detection is still not
> bullet-proof due to difficulties parsing out the package name. The main
> problem is that package names can include hyphens...
> My best effort looks like this, the first 0-9 is meant to be the start of the
> pkg version, and the last being the release number:
> ls {"$cache_dir","$PKGDEST"}/${pkgname}-[0-9]*-[0-9]*${PKGEXT}
> This will fail if there happens to be a sub-package of foo such as:
> foo-1st-sub-1.0-1.i686.pkg.tar.gz
> ...or a package that happens to be:
> foo-A0-1.i686.pkg.tar.gz

The right way would be to split by hyphens:
package name is everything minus 2 chunks separated by 2 rightmost hyphens.
But my bash/sed/awk/cut/whatever skills were not enought when I've
tried to do such parsing. :-P
Or maybe there is already such solution that I'm not aware of?

Roman Kyrylych (Роман Кирилич)

More information about the pacman-dev mailing list