diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-11-23 12:04:30 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-11-23 12:04:30 +0100 |
commit | 4d16d294f338d5e90a92acb2096bca77e9e924e7 (patch) | |
tree | 7c977635edc813dfb1a766d214d56ecf63a49867 /db-functions | |
parent | 1dca721c5149f69067f38d4a33dabbebef98009b (diff) |
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
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 35 |
1 files changed, 2 insertions, 33 deletions
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 |