From e7fe897a91e6376a8724c226f8e078251620a173 Mon Sep 17 00:00:00 2001 From: Eric Bélanger Date: Mon, 8 Feb 2010 10:13:42 -0500 Subject: sourceballs: Make cleanup more efficient MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Moved all cleanup related code in sourceballs-cleanup script and moved, now common, functions in db-functions. The cleanup script is now ran after all the new sourceballs have been fetched. Signed-off-by: Eric Bélanger --- db-functions | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'db-functions') diff --git a/db-functions b/db-functions index df50f22..d688df6 100644 --- a/db-functions +++ b/db-functions @@ -170,4 +170,25 @@ chk_license() { return 1 } +pkgname_from_src() { + local tmp + tmp=${1##*/} + tmp=${tmp%$SRCEXT} + for a in ${ARCHES[@]}; do + tmp=${tmp%-$a} + done + tmp=${tmp%-any} + echo ${tmp%-*-*} +} + +pkgver_from_src() { + tmp=${1##*/} + tmp=${tmp%$SRCEXT} + for a in ${ARCHES[@]}; do + tmp=${tmp%-$a} + done + tmp=${tmp%-any} + echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g' +} + # vim: set ts=4 sw=4 noet ft=sh: -- cgit v1.2.3-24-g4f1b