From 4d16d294f338d5e90a92acb2096bca77e9e924e7 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Tue, 23 Nov 2010 12:04:30 +0100 Subject: Rewrite sourceballs to increase performance and reliability * Decrease file stats as much as possible * Create a list of all packages and meta data only once * Create a list of available source packages only once * Create a list of expected packages only once * Combine all three scripts into one to share data and code * Use as much information from the db files as possible and avoid using svn * Avoid attempting to create the same source package twice Logic works as follows: 1) create a list of all packages 2) Check for each package if we need a src package and create one 3) During this process create a list of all src packages that should be there 4) Diff both lists for the cleanup --- db-functions | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'db-functions') diff --git a/db-functions b/db-functions index d2df1a7..67a52aa 100644 --- a/db-functions +++ b/db-functions @@ -347,44 +347,13 @@ check_pkgrepos() { #usage: chk_license ${license[@]}" chk_license() { local l - local allowed - for l in "$@"; do - l="$(echo $l | tr '[:upper:]' '[:lower:]')" - for allowed in ${ALLOWED_LICENSES[@]}; do - allowed="$(echo $allowed | tr '[:upper:]' '[:lower:]')" - if [ "$l" = "$allowed" ]; then - return 0 - fi - done + for l in ${@}; do + in_array ${l} ${ALLOWED_LICENSES[@]} && return 0 done return 1 } -pkgname_from_src() { - local tmp - local a - tmp=${1##*/} - tmp=${tmp%$SRCEXT} - for a in ${ARCHES[@]}; do - tmp=${tmp%-$a} - done - tmp=${tmp%-any} - echo ${tmp%-*-*} -} - -pkgver_from_src() { - local tmp - local a - tmp=${1##*/} - tmp=${tmp%$SRCEXT} - for a in ${ARCHES[@]}; do - tmp=${tmp%-$a} - done - tmp=${tmp%-any} - echo $tmp | sed 's|.*-\(.*-.*\)$|\1|g' -} - check_repo_permission() { local repo=$1 -- cgit v1.2.3-24-g4f1b