summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorEric Bélanger <snowmaniscool@gmail.com>2010-02-08 16:13:42 +0100
committerPierre Schmitz <pierre@archlinux.de>2010-03-13 11:33:26 +0100
commite7fe897a91e6376a8724c226f8e078251620a173 (patch)
tree93a9b814b3e96b38734d0bc1908b9c18a8f09d2c /db-functions
parent17dd60ced8eb8ca461b73dd8429be0fda83264e5 (diff)
downloaddbscripts-e7fe897a91e6376a8724c226f8e078251620a173.tar.gz
dbscripts-e7fe897a91e6376a8724c226f8e078251620a173.tar.xz
sourceballs: Make cleanup more efficient
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 <snowmaniscool@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions21
1 files changed, 21 insertions, 0 deletions
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: