Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=f9dd398bfcf97b561c2124eec3253c7717f0195d
commit f9dd398bfcf97b561c2124eec3253c7717f0195d Author: Michel Hermier <[EMAIL PROTECTED]> Date: Sun Sep 9 18:44:14 2007 +0200 source/include/util.sh: Create a new Flastarchive helper to allow to check archive with user suffixes. Make the Flasttar* methods using it. Increase the power of Flasttar so that the other Flasttar* are somehow deprecated. Report me any breakage. diff --git a/source/include/util.sh b/source/include/util.sh index 721d601..a58c6c1 100644 --- a/source/include/util.sh +++ b/source/include/util.sh @@ -787,27 +787,32 @@ Fautoreconf() { } ### +# * Flastarchive: Extracts version from a page's last archive. +# Extension of the archive is given as argument. +### +Flastarchive() { + grep "$1\(\$\|#\)"|sed -n "s/.*-\(.*\)$1/\1/;\$ p" +} + +### # * Flasttar(): Extracts version from a page's last tar.gz link. ### -Flasttar() -{ - grep 'tar.gz\($\|#\)'|sed -n 's/.*-\(.*\)\.t.*/\1/;$ p' +Flasttar() { + Flastarchive '\.tar\(\|\.gz\|\.bz2\)\|\.tgz' } ### # * Flasttgz(): Extracts version from a page's last tgz link. ### -Flasttgz() -{ - grep 'tgz\($\|#\)'|sed -n 's/.*-\(.*\)\.t.*/\1/;$ p' +Flasttgz() { + Flastarchive '\.tgz\(\|\.gz\)' } ### # * Flasttarbz2(): Extracts version from a page's last tar.bz2 link. ### -Flasttarbz2() -{ - grep 'tar.bz2\($\|#\)'|sed -n 's/.*-\(.*\)\.t.*/\1/;$ p' +Flasttarbz2() { + Flastarchive '\.tar\.bz2' } ### _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git