#!/bin/bash . "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" script_lock set_umask dirname="$(/bin/readlink -f $(/usr/bin/dirname $0))" [ ! -d "${LOGDIR}/sourceballs" ] && mkdir -p "${LOGDIR}/sourceballs" [ -e "${LOGDIR}/sourceballs/errors.txt" ] && /bin/mv "${LOGDIR}/sourceballs/errors.txt" "${LOGDIR}/sourceballs/errors.txt.old" [ -e "${LOGDIR}/sourceballs/failed.txt" ] && /bin/mv "${LOGDIR}/sourceballs/failed.txt" "${LOGDIR}/sourceballs/failed.txt.old" for repo in ${PKGREPOS[@]}; do for arch in ${ARCHES[@]}; do ftppath="${FTP_BASE}/$repo/os/$arch" dbfile="${ftppath}/${repo}${DBEXT}" if [ ! -r "${dbfile}" ]; then warning "DB file does not exist: ${dbfile}" continue fi for pkg in $(bsdtar -xOf "${dbfile}" \ | awk '/^%NAME%/{getline b};/^%BASE%/{getline b};/^%VERSION%/{getline v};/^%ARCH%/{printf "%s/%s\n", b, v}' \ | sort -u); do pkgbase=${pkg%/*} pkgver=${pkg#*/} srcpkg="${pkgbase}-${pkgver}${SRCEXT}" # Don't do anything for package in this 'blacklist' if grep -q "^${pkgbase}\$" "$dirname/sourceballs.skip"; then continue fi # Use this file to 'whitelist' or force building some sourceballs, # skipping the license check force="" if grep -q "^$pkgbase\$" "$dirname/sourceballs.force"; then force="-f" fi if [ ! -f "${FTP_BASE}/${SRCPOOL}/$srcpkg" ]; then if ! $dirname/../misc-scripts/make-sourceball $force \ $pkgbase $repo $arch 2>>"${LOGDIR}/sourceballs/errors.txt"; then echo "$pkgbase" >> "${LOGDIR}/sourceballs/failed.txt" fi fi done done done $dirname/../misc-scripts/sourceballs-cleanup script_unlock