diff options
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/check_archlinux/parse_pkgbuilds.sh | 36 | ||||
-rwxr-xr-x | cron-jobs/devlist-mailer | 2 | ||||
-rwxr-xr-x | cron-jobs/ftpdir-cleanup | 27 | ||||
-rwxr-xr-x | cron-jobs/integrity-check | 4 | ||||
-rwxr-xr-x | cron-jobs/repo-sanity-check | 5 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 41 | ||||
-rw-r--r-- | cron-jobs/sourceballs.skip | 24 | ||||
-rwxr-xr-x | cron-jobs/sourceballs2 | 50 | ||||
-rwxr-xr-x | cron-jobs/update-web-db | 16 |
9 files changed, 114 insertions, 91 deletions
diff --git a/cron-jobs/check_archlinux/parse_pkgbuilds.sh b/cron-jobs/check_archlinux/parse_pkgbuilds.sh index c8d8618..38af179 100755 --- a/cron-jobs/check_archlinux/parse_pkgbuilds.sh +++ b/cron-jobs/check_archlinux/parse_pkgbuilds.sh @@ -12,7 +12,7 @@ readonly -a variables splitpkg_overrides backup_package_variables() { for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" - eval "${indirect}=(\${$var[@]})" + eval "${indirect}=(\"\${$var[@]}\")" done } @@ -20,9 +20,9 @@ restore_package_variables() { for var in "${splitpkg_overrides[@]}"; do indirect="${var}_backup" if [ -n "${!indirect}" ]; then - eval "${var}=(\${$indirect[@]})" + eval "${var}=(\"\${$indirect[@]}\")" else - unset ${var} + unset "${var}" fi done } @@ -42,31 +42,31 @@ print_info() { if [ -n "$arch" ]; then echo "%ARCH%" - for i in "${arch[@]}"; do echo $i; done + for i in "${arch[@]}"; do echo "$i"; done echo "" fi if [ -n "$depends" ]; then echo "%DEPENDS%" for i in "${depends[@]}"; do - echo $i + echo "$i" done echo "" fi if [ -n "$makedepends" ]; then echo "%MAKEDEPENDS%" for i in "${makedepends[@]}"; do - echo $i + echo "$i" done echo "" fi if [ -n "$conflicts" ]; then echo "%CONFLICTS%" - for i in "${conflicts[@]}"; do echo $i; done + for i in "${conflicts[@]}"; do echo "$i"; done echo "" fi if [ -n "$provides" ]; then echo "%PROVIDES%" - for i in "${provides[@]}"; do echo $i; done + for i in "${provides[@]}"; do echo "$i"; done echo "" fi } @@ -76,9 +76,9 @@ source_pkgbuild() { dir=$1 pkgbuild=$dir/PKGBUILD for var in "${variables[@]}"; do - unset ${var} + unset "${var}" done - source $pkgbuild &>/dev/null || ret=$? + source "$pkgbuild" &>/dev/null || ret=$? # ensure $pkgname and $pkgver variables were found if [ $ret -ne 0 -o -z "$pkgname" -o -z "$pkgver" ]; then @@ -89,7 +89,7 @@ source_pkgbuild() { if [ "${#pkgname[@]}" -gt "1" ]; then pkgbase=${pkgbase:-${pkgname[0]}} for pkg in "${pkgname[@]}"; do - if [ "$(type -t package_${pkg})" != "function" ]; then + if [ "$(type -t "package_${pkg}")" != "function" ]; then echo -e "%INVALID%\n$pkgbuild\n" return 1 else @@ -104,7 +104,7 @@ source_pkgbuild() { break fi done - done < <(type package_${pkg}) + done < <(type "package_${pkg}") print_info restore_package_variables fi @@ -124,14 +124,14 @@ find_pkgbuilds() { return fi - if [ -f $1/PKGBUILD ]; then - source_pkgbuild $1 + if [ -f "$1/PKGBUILD" ]; then + source_pkgbuild "$1" return fi empty=1 - for dir in $1/*; do - if [ -d $dir ]; then - find_pkgbuilds $dir + for dir in "$1"/*; do + if [ -d "$dir" ]; then + find_pkgbuilds "$dir" unset empty fi done @@ -147,7 +147,7 @@ fi CARCH=$1 shift for dir in "$@"; do - find_pkgbuilds $dir + find_pkgbuilds "$dir" done exit 0 diff --git a/cron-jobs/devlist-mailer b/cron-jobs/devlist-mailer index ca2e46b..61cd32c 100755 --- a/cron-jobs/devlist-mailer +++ b/cron-jobs/devlist-mailer @@ -23,6 +23,6 @@ echo "Subject: $SUBJECT To: $LIST From: $FROM -$stdin" | /usr/sbin/sendmail -F$FROM "$LIST" +$stdin" | /usr/sbin/sendmail -F"$FROM" "$LIST" fi diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index f2d8b33..292952b 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -7,14 +7,14 @@ clean_pkg() { local pkg local target - if ! ${CLEANUP_DRYRUN}; then + if ! "${CLEANUP_DRYRUN}"; then for pkg in "$@"; do if [ -h "$pkg" ]; then rm -f "$pkg" "$pkg.sig" else - mv -f "$pkg" "$CLEANUP_DESTDIR" + mv_acl "$pkg" "$CLEANUP_DESTDIR/${pkg##*/}" if [ -e "$pkg.sig" ]; then - mv -f "$pkg.sig" "$CLEANUP_DESTDIR" + mv_acl "$pkg.sig" "$CLEANUP_DESTDIR/${pkg##*/}.sig" fi touch "${CLEANUP_DESTDIR}/${pkg##*/}" fi @@ -22,8 +22,15 @@ clean_pkg() { fi } +script_lock -${CLEANUP_DRYRUN} && warning 'dry run mode is active' +for repo in "${PKGREPOS[@]}"; do + for arch in "${ARCHES[@]}"; do + repo_lock "${repo}" "${arch}" || exit 1 + done +done + +"${CLEANUP_DRYRUN}" && warning 'dry run mode is active' for repo in "${PKGREPOS[@]}"; do for arch in "${ARCHES[@]}"; do @@ -38,7 +45,7 @@ for repo in "${PKGREPOS[@]}"; do missing_pkgs=($(comm -13 "${WORKDIR}/repo-${repo}-${arch}" "${WORKDIR}/db-${repo}-${arch}")) if [ ${#missing_pkgs[@]} -ge 1 ]; then error "Missing packages in [${repo}] (${arch})..." - for missing_pkg in ${missing_pkgs[@]}; do + for missing_pkg in "${missing_pkgs[@]}"; do msg2 "${missing_pkg}" done fi @@ -62,18 +69,18 @@ cat "${WORKDIR}/db-"* | sort -u > "${WORKDIR}/db" old_pkgs=($(comm -23 "${WORKDIR}/pool" "${WORKDIR}/db")) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from package pool..." - for old_pkg in ${old_pkgs[@]}; do + for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" clean_pkg "$FTP_BASE/${PKGPOOL}/${old_pkg}" done fi -old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -name "*${PKGEXT}" -mtime +${CLEANUP_KEEP} -printf '%f\n')) +old_pkgs=($(find "${CLEANUP_DESTDIR}" -type f -name "*${PKGEXT}" -mtime +"${CLEANUP_KEEP}" -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from the cleanup directory..." - for old_pkg in ${old_pkgs[@]}; do + for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" - if ! ${CLEANUP_DRYRUN}; then + if ! "${CLEANUP_DRYRUN}"; then rm -f "${CLEANUP_DESTDIR}/${old_pkg}" rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig" fi @@ -82,7 +89,7 @@ fi for repo in "${PKGREPOS[@]}"; do for arch in "${ARCHES[@]}"; do - repo_unlock ${repo} ${arch} + repo_unlock "${repo}" "${arch}" done done diff --git a/cron-jobs/integrity-check b/cron-jobs/integrity-check index 86a8f1d..33a4eb6 100755 --- a/cron-jobs/integrity-check +++ b/cron-jobs/integrity-check @@ -13,12 +13,12 @@ fi mailto=$1 check() { - ${dirname}/check_archlinux/check_packages.py \ + "${dirname}"/check_archlinux/check_packages.py \ --repos="${repos}" \ --abs-tree="/srv/abs/rsync/${arch},/srv/abs/rsync/any" \ --repo-dir="${FTP_BASE}" \ --arch="${arch}" \ - 2>&1 | ${dirname}/devlist-mailer "Integrity Check ${arch}: ${repos}" "${mailto}" + 2>&1 | "${dirname}"/devlist-mailer "Integrity Check ${arch}: ${repos}" "${mailto}" } repos='core,extra,community' diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 9d351df..8b0758f 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -41,8 +41,9 @@ for _repo in "${PKGREPOS[@]}"; do )) # Compares them, whatever is on repos but not on abs should be removed - remove=($(comm -13 <(echo ${on_abs[@]} | tr ' ' "\n" | sort -u) \ - <(echo ${on_repo[@]} | tr ' ' "\n" | sort -u))) + remove=($(comm -13 \ + <(printf '%s\n' "${on_abs[@]}" | sort -u) \ + <(printf '%s\n' "${on_repo[@]}" | sort -u) )) # Remove them from databases, ftpdir-cleanup will take care of the rest find ${FTP_BASE}/${_repo} -name "*.db.tar.?z" -exec \ diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index 8171980..2c11de2 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -9,7 +9,7 @@ script_lock for repo in "${PKGREPOS[@]}"; do for arch in "${ARCHES[@]}"; do - repo_lock ${repo} ${arch} || exit 1 + repo_lock "${repo}" "${arch}" || exit 1 done done @@ -41,7 +41,7 @@ done for repo in "${PKGREPOS[@]}"; do for arch in "${ARCHES[@]}"; do - repo_unlock ${repo} ${arch} + repo_unlock "${repo}" "${arch}" done done @@ -74,19 +74,14 @@ for repo in "${PKGREPOS[@]}"; do # Build the source package if its not already there if ! grep -Fqx "${pkgbase}-${pkgver}${SRCEXT}" "${WORKDIR}/available-src-pkgs"; then # Check if we had failed before - if in_array "${pkgbase}-${pkgver}${SRCEXT}" ${failedpkgs[@]}; then + if in_array "${pkgbase}-${pkgver}${SRCEXT}" "${failedpkgs[@]}"; then continue fi - # Get the sources from svn - mkdir -p "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" - #svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}" \ - # "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 - - # If it's on official repos, nor [libre], nor [libre-testing] - cp -r "${SVNREPO}/$repo/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 || \ - cp -r "${SVNREPO}/libre-testing/${pkgbase}" "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/" >/dev/null 2>&1 + # Get the sources from xbs + mkdir -p -m0770 "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}" + cp -a "$(xbs releasepath "${pkgbase}" "${repo}" "${pkgarch}")" \ + "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null 2>&1 if [ $? -ge 1 ]; then failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}") continue @@ -94,14 +89,15 @@ for repo in "${PKGREPOS[@]}"; do # Build the actual source package pushd "${WORKDIR}/pkgbuilds/${repo}-${pkgarch}/${pkgbase}" >/dev/null - makepkg --nocolor --allsource --ignorearch # >/dev/null 2>&1 + SRCPKGDEST=. makepkg --nocolor --allsource --ignorearch --skippgpcheck >"${WORKDIR}/${pkgbase}.log" 2>&1 if [ $? -eq 0 ] && [ -f "${pkgbase}-${pkgver}${SRCEXT}" ]; then - mv "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}" + mv_acl "${pkgbase}-${pkgver}${SRCEXT}" "${FTP_BASE}/${SRCPOOL}/${pkgbase}-${pkgver}${SRCEXT}" # Avoid creating the same source package for every arch echo "${pkgbase}-${pkgver}${SRCEXT}" >> "${WORKDIR}/available-src-pkgs" newpkgs[${#newpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" else - failedpkgs[${#failedpkgs[*]}]="${pkgbase}-${pkgver}${SRCEXT}" + failedpkgs+=("${pkgbase}-${pkgver}${SRCEXT}") + cat "${WORKDIR}/${pkgbase}.log" >> "${WORKDIR}/makepkg-fail.log" fi popd >/dev/null fi @@ -128,23 +124,28 @@ old_pkgs=($(comm -23 "${WORKDIR}/available-src-pkgs.sort" "${WORKDIR}/expected-s if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages..." - ${SOURCE_CLEANUP_DRYRUN} && warning 'dry run mode is active' + "${SOURCE_CLEANUP_DRYRUN}" && warning 'dry run mode is active' for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" - if ! ${SOURCE_CLEANUP_DRYRUN}; then - mv "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}" + if ! "${SOURCE_CLEANUP_DRYRUN}"; then + mv_acl "$FTP_BASE/${SRCPOOL}/${old_pkg}" "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" touch "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" fi done fi -old_pkgs=($(find ${SOURCE_CLEANUP_DESTDIR} -type f -name "*${SRCEXT}" -mtime +${SOURCE_CLEANUP_KEEP} -printf '%f\n')) +old_pkgs=($(find "${SOURCE_CLEANUP_DESTDIR}" -type f -name "*${SRCEXT}" -mtime +"${SOURCE_CLEANUP_KEEP}" -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old source packages from the cleanup directory..." for old_pkg in "${old_pkgs[@]}"; do msg2 "${old_pkg}" - ${SOURCE_CLEANUP_DRYRUN} || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" + "${SOURCE_CLEANUP_DRYRUN}" || rm -f "${SOURCE_CLEANUP_DESTDIR}/${old_pkg}" done fi +if [ -f "${WORKDIR}/makepkg-fail.log" ]; then + msg "Log of failed packages" + cat "${WORKDIR}/makepkg-fail.log" +fi + script_unlock diff --git a/cron-jobs/sourceballs.skip b/cron-jobs/sourceballs.skip index 14d6f4b..0e1731c 100644 --- a/cron-jobs/sourceballs.skip +++ b/cron-jobs/sourceballs.skip @@ -1,14 +1,28 @@ -nexuiz-data +0ad-data +alienarena-data +blobwars-data +btanks-data +dangerdeep-data +egoboo-data +fillets-ng-data +flightgear-data +frogatto-data +gcompris-data +naev-data +openarena-data +rocksndiamonds-data +smc-data +speed-dreams-data torcs-data tremulous-data ufoai-data -frogatto-data vdrift-data -naev-data -btanks-data +warmux-data wesnoth-data -texlive-bin +widelands-data +xonotic-data texlive-bibtexextra +texlive-bin texlive-core texlive-fontsextra texlive-formatsextra diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2 index 2a26e6a..64bae4a 100755 --- a/cron-jobs/sourceballs2 +++ b/cron-jobs/sourceballs2 @@ -13,7 +13,7 @@ pushd "${WORKDIR}" >/dev/null script_lock -#adjust the nice level to run at a lower priority +# Adjust the nice level to run at a lower priority renice +10 -p $$ > /dev/null # Create a list of all available source package file names @@ -22,41 +22,41 @@ find "${FTP_BASE}/${SRCPOOL}" -xtype f -name "*${SRCEXT}" -printf '%f\n' | sort pushd "${SVNREPO}" >/dev/null for repo in "${PKGREPOS[@]}"; do - msg "Sourceballing [${repo}]" + msg "Sourceballing [${repo}]" - pushd $repo >/dev/null - find -maxdepth 1 -type d | while read pkg; do - pushd "${SVNREPO}/$repo/$pkg" >/dev/null + pushd "$repo" >/dev/null + find -maxdepth 1 -type d | while read pkg; do + pushd "${SVNREPO}/$repo/$pkg" >/dev/null - [[ ! -e PKGBUILD ]] && { - warning "$repo/$pkg is not a package" - continue - } + [[ ! -e ./PKGBUILD ]] && { + warning "$repo/$pkg is not a package" + continue + } -# Unset the previous data - unset pkgbase pkgname pkgver pkgrel - source PKGBUILD + # Unset the previous data + unset pkgbase pkgname pkgver pkgrel + source PKGBUILD - unset build package url pkgdesc source md5sums depends makedepends \ - optdepends license arch options check mksource + unset build package url pkgdesc source md5sums depends makedepends \ + optdepends license arch options check mksource - for _pkg in "${pkgname[@]}"; do - unset package_${_pkg} >/dev/null 2>&1 - done + for _pkg in "${pkgname[@]}"; do + unset "package_${_pkg}" >/dev/null 2>&1 + done - pkgbase=${pkgbase:-$pkgname} - srcfile="${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" + pkgbase=${pkgbase:-$pkgname} + srcfile="${pkgbase}-${pkgver}-${pkgrel}${SRCEXT}" echo "${srcfile}" >> "${WORKDIR}/expected-src-pkgs" - # Skip already sourceballed - [ -e "${SRCPKGDEST}/${srcfile}" ] && continue + # Skip already sourceballed + [[ -e "${SRCPKGDEST}/${srcfile}" ]] && continue - makepkg --allsource --ignorearch -c >/dev/null 2>&1 + makepkg --allsource --ignorearch -c >/dev/null 2>&1 - [ $? -ne 0 ] && plain ${srcfile} + [[ $? -ne 0 ]] && plain "${srcfile}" - done # end find pkgs - popd >/dev/null + done # end find pkgs + popd >/dev/null done # end repos diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db index 713e75e..ec9d255 100755 --- a/cron-jobs/update-web-db +++ b/cron-jobs/update-web-db @@ -43,26 +43,26 @@ case "$cmd" in esac # Lock the repos and get a copy of the db files to work on -for repo in ${REPOS[@]}; do - for arch in ${ARCHES[@]}; do - repo_lock ${repo} ${arch} || exit 1 +for repo in "${REPOS[@]}"; do + for arch in "${ARCHES[@]}"; do + repo_lock "${repo}" "${arch}" || exit 1 dbfile="/srv/ftp/${repo}/os/${arch}/${repo}${dbfileext}" if [ -f "${dbfile}" ]; then mkdir -p "${WORKDIR}/${repo}/${arch}" cp "${dbfile}" "${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}" fi - repo_unlock ${repo} ${arch} + repo_unlock "${repo}" "${arch}" done done # Run reporead on our db copy -pushd $SPATH >/dev/null -for repo in ${REPOS[@]}; do - for arch in ${ARCHES[@]}; do +pushd "$SPATH" >/dev/null +for repo in "${REPOS[@]}"; do + for arch in "${ARCHES[@]}"; do dbcopy="${WORKDIR}/${repo}/${arch}/${repo}${dbfileext}" if [ -f "${dbcopy}" ]; then echo "Updating ${repo}-${arch}" >> "${LOGOUT}" - ./manage.py reporead ${flags} ${arch} "${dbcopy}" >> "${LOGOUT}" 2>&1 + ./manage.py reporead "${flags}" "${arch}" "${dbcopy}" >> "${LOGOUT}" 2>&1 echo "" >> "${LOGOUT}" fi done |