index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/build-master-status | 42 | ||||
-rwxr-xr-x | bin/build-packages | 12 | ||||
-rwxr-xr-x | bin/clean-cache | 6 | ||||
-rwxr-xr-x | bin/common-functions | 46 | ||||
-rwxr-xr-x | bin/db-update | 48 | ||||
-rwxr-xr-x | bin/get-assignment | 8 | ||||
-rwxr-xr-x | bin/get-package-updates | 24 | ||||
-rwxr-xr-x | bin/return-assignment | 20 | ||||
-rwxr-xr-x | bin/sanity-check | 38 | ||||
-rwxr-xr-x | bin/seed-build-list | 8 | ||||
-rwxr-xr-x | bin/show-dependencies | 18 | ||||
-rwxr-xr-x | bin/why_dont_you | 48 | ||||
-rwxr-xr-x | conf/default.conf | 8 |
diff --git a/bin/build-master-status b/bin/build-master-status index 2522da7..55bbe0b 100755 --- a/bin/build-master-status +++ b/bin/build-master-status @@ -52,19 +52,19 @@ if [ $# -ne 0 ]; then usage fi -stable="$( +stable=$( ls_master_mirror 'i686' | \ grep -v 'testing$\|staging$\|-unstable$' | \ while read -r dir; do ls_master_mirror "i686/${dir}" done | \ grep -c '\.pkg\.tar\.xz$' - )" -tasks="$( +) +tasks=$( grep -c '^\S\+ \S\+ \S\+ \S\+$' \ "${work_dir}/build-list" - )" || true -pending_packages="$( +) || true +pending_packages=$( grep '^\S\+ \S\+ \S\+ \S\+$' "${work_dir}/build-list" | \ tr ' ' '.' | \ while read -r package; do @@ -72,49 +72,49 @@ pending_packages="$( cat "${work_dir}/package-infos/${package}.packages" done | wc -l -)" -staging="$( +) +staging=$( ls_master_mirror 'i686' | \ grep 'staging$' | \ while read -r dir; do ls_master_mirror "i686/${dir}" done | \ grep -c '\.pkg\.tar\.xz$' - )" -testing="$( + ) +testing=$( ls_master_mirror 'i686' | \ grep 'testing$' | \ while read -r dir; do ls_master_mirror "i686/${dir}" done | \ grep -c '\.pkg\.tar\.xz$' - )" -broken="$( + ) +broken=$( ls "${work_dir}/package-states/" | \ grep -c '\.broken$' - )" || true -blocked="$( + ) || true +blocked=$( ls "${work_dir}/package-states/" | \ grep -c '\.blocked$' - )" || true -locked="$( + ) || true +locked=$( ls "${work_dir}/package-states/" | \ grep -c '\.locked$' - )" || true -loops="$( + ) || true +loops=$( ls "${work_dir}/build-list.loops" | \ grep -c '^loop_[0-9]\+$' - )" || true -looped_packages="$( + ) || true +looped_packages=$( ls "${work_dir}/build-list.loops" | \ grep '^loop_[0-9]\+$' | \ sed "s|^|${work_dir}/build-list.loops/|" | \ xargs -r cat | \ sort -u | \ wc -l - )" + ) -tmp_dir="$(mktemp -d)" +tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT printf 'The mirror master contains %d stable packages (vs. ca. %d planned).\n' \ diff --git a/bin/build-packages b/bin/build-packages index c54f34e..fc3a205 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -105,13 +105,13 @@ while [ ${count} -ne 0 ]; do fi err=0 - package="$( + package=$( ssh \ -i "${master_build_server_identity}" \ -p "${master_build_server_port}" \ "${master_build_server_user}@${master_build_server}" \ 'get-assignment' - )" || err=$? + ) || err=$? case ${err} in @@ -133,7 +133,7 @@ while [ ${count} -ne 0 ]; do git -C "${repo_path}" fetch done - git_repo="$(find_repository_with_commit "${git_revision}")" + git_repo=$(find_repository_with_commit "${git_revision}") find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}" @@ -146,7 +146,7 @@ while [ ${count} -ne 0 ]; do recursively_umount_and_rm "${tmp_dir}" exit ${err} } - tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" + tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") trap bail_out EXIT extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" @@ -159,7 +159,7 @@ while [ ${count} -ne 0 ]; do grep -qF ':mirrored_source:'; then # maybe a missing source is/was the problem? # try to download them from sources.archlinux.org/sources/$repo/$source - source_name="$( + source_name=$( makepkg --printsrcinfo | \ sed -n ' /^\s*\(epoch\|pkg\(base\|ver\|rel\)\) = /{s|^\s\+||;p} @@ -179,7 +179,7 @@ while [ ${count} -ne 0 ]; do s|\n[0-9] || ta ' - )" + ) if ! wget -nc -nd "https://sources.archlinux.org/sources/${git_repo}/${source_name}"; then # we can't improve anything continue diff --git a/bin/clean-cache b/bin/clean-cache index 726fd2e..83657b6 100755 --- a/bin/clean-cache +++ b/bin/clean-cache @@ -15,13 +15,13 @@ fi repos='build-support community-staging community-testing community core extra gnome-unstable kde-unstable staging testing' -mirror="$( +mirror"$( grep -m1 '^Server = ' '/etc/pacman.d/mirrorlist32' | \ cut -d= -f2 | \ sed 's|^\s*||' -)" +) -tmp_dir="$(mktemp -d)" +tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT for repo in ${repos}; do diff --git a/bin/common-functions b/bin/common-functions index 923fbb0..08fe9ab 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -14,7 +14,7 @@ find_pkgbuilds() { local git_revision="$4" local mod_git_revision="$5" - PKGBUILD="$( + PKGBUILD=$( eval git -C "$(printf '"${repo_paths__%s}"' "${git_repository}")" 'archive "${git_revision}" -- "${package}/repos/"' 2> /dev/null | \ tar -t 2> /dev/null | \ grep "^$(str_to_regex "${package}/repos/${repository}")"'-.*/PKGBUILD$' | \ @@ -22,12 +22,12 @@ find_pkgbuilds() { grep -v -- '[-/]\(staging\|testing\|unstable\)-[^/]\+/PKGBUILD$' | \ sort | \ tail -n1 - )" + ) - PKGBUILD_mod="$( + PKGBUILD_mod=$( git -C "${repo_paths__archlinux32}" archive "${mod_git_revision}" 2> /dev/null | \ tar -t "${repository}/${package}/PKGBUILD" 2> /dev/null - )" || true + ) || true if [ -z "${PKGBUILD}" ] && \ [ -z "${PKGBUILD_mod}" ]; then @@ -206,14 +206,14 @@ delete_old_metadata() { local current_metadata - current_metadata="$( + current_metadata=$( ls "${work_dir}/package-infos" | \ sed ' s|\.[^.]\+$|| s|\.\([^.]\+\)\.\([^.]\+\)\.\([^.]\+\)$| \1 \2 \3| ' | \ sort -u - )" + ) ( # what we have @@ -230,7 +230,7 @@ delete_old_metadata() { # build-list items should stay sed 'p' "${work_dir}/build-list" - tmp_dir="$(mktemp -d)" + tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT echo "${current_metadata}" | \ @@ -294,14 +294,14 @@ delete_old_metadata() { opkg='' continue fi - revs="$( + revs=$( printf '%s\n' ${revs} ${rev} | \ sort -u - )" - mod_revs="$( + ) + mod_revs=$( printf '%s\n' ${mod_revs} ${mod_rev} | \ sort -u - )" + ) orepo="${repo}" opkg="${pkg}" done @@ -348,7 +348,7 @@ repository_of_package() { official_or_community() { local prepo - prepo="$(repository_of_package "$1")" + prepo=$(repository_of_package "$1") if [ "${prepo}" = 'community' ]; then echo 'community-'"$2" @@ -410,11 +410,11 @@ wait_some_time() { diff=30 fi - random="$( + random=$( dd if='/dev/urandom' count=1 2> /dev/null | \ cksum | \ cut -d' ' -f1 - )" + ) sleep $((${minimum} + ${random} % ${diff})) } @@ -442,7 +442,7 @@ make_source_info() { local PKGBUILD local PKGBUILD_mod - git_repo="$(find_repository_with_commit "${git_revision}")" + git_repo=$(find_repository_with_commit "${git_revision}") if [ -z "${git_repo}" ]; then return 1 @@ -452,7 +452,7 @@ make_source_info() { ( - tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" + tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" @@ -495,14 +495,14 @@ insert_break_loops_orders() { local looped_packages local line - looped_packages="$( + looped_packages=$( ls "${work_dir}/build-list.loops" | \ grep '^loop_[0-9]\+$' | \ sed "s|^|${work_dir}/build-list.loops/|" | \ xargs -r cat | \ sort -u | \ wc -l - )" + ) ( while read -r line; do @@ -538,7 +538,7 @@ append_architectures() { find_newest_of_git_revisions() { local revisions local repo - revisions="$(cat)" + revisions=$(cat) if [ $( echo "${revisions}" | \ @@ -550,13 +550,13 @@ find_newest_of_git_revisions() { fi - repo="$( + repo=$( find_repository_with_commit \ "$( echo "${revisions}" | \ grep -xm1 '[0-9a-f]\{40\}' )" - )" + ) eval 'repo="${repo_paths__'"${repo}"'}"' @@ -587,7 +587,7 @@ find_package_repository_to_package() { eval 'repo_path="${repo_paths__'"${git_repository}"'}"' - repo="$( + repo=$( git -C "${repo_path}" archive "$(cat "${work_dir}/${git_repository}.revision")" -- "${package}/repos" 2> /dev/null | \ tar -t | \ cut -d/ -f3 | \ @@ -596,7 +596,7 @@ find_package_repository_to_package() { grep -v -- '-i686$' | \ sed 's|-[^-]\+$||' | \ sort -u - )" + ) if [ -z "${repo}" ]; then return 1 diff --git a/bin/db-update b/bin/db-update index af70c10..4f3cc38 100755 --- a/bin/db-update +++ b/bin/db-update @@ -160,10 +160,10 @@ move_packages() { mkdir -p "${tmp_dir}/${from_repo}" mkdir -p "${tmp_dir}/${to_repo}" - repos="$( + repos=$( printf '%s\n' "${from_repo}" "${to_repo}" $(cat "${tmp_dir}/repos") | \ sort -u - )" + ) echo "${repos}" > \ "${tmp_dir}/repos" @@ -289,12 +289,12 @@ move_packages() { # and update the state files - from_ending="$( + from_ending=$( cat "${tmp_dir}/${package}.from_ending" - )" - to_ending="$( + ) + to_ending=$( cat "${tmp_dir}/${package}.to_ending" - )" + ) if [ -z "${to_ending}" ]; then ${dummynator} rm \ @@ -370,11 +370,11 @@ do shift done -packages_to_stabilize="$( +packages_to_stabilize=$( printf '%s\n' \ ${packages_to_stabilize} \ ${@} -)" +) if ! "${base_dir}/bin/sanity-check" -r; then >&2 echo 'Build master is not sane.' @@ -403,7 +403,7 @@ if ! flock ${block_flag} 8; then exit 1 fi -tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" +tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") clean_up_lock_file() { rm -f "${package_database_lock_file}" "${build_list_lock_file}" @@ -459,11 +459,11 @@ ls "${work_dir}/package-states" | \ # remove packages not yet done from keep-packages list -keep_packages="$( +keep_packages=$( join -1 1 -2 1 -o 2.2 \ "${tmp_dir}/keep_packages" \ "${tmp_dir}/done_packages" -)" +) printf '%s\n' "${keep_packages}" | \ grep -vxF '' > \ "${tmp_dir}/keep_packages" || \ @@ -481,29 +481,29 @@ while [ -s "${tmp_dir}/new_keep_packages" ]; do generate_package_metadata "${package}" done < "${tmp_dir}/new_keep_packages" - keep_packages="$( + keep_packages=$( ( printf '%s\n' "${keep_packages}" cat "${tmp_dir}/new_keep_packages" ) | \ sort -u - )" + ) - new_keep_packages="$( + new_keep_packages=$( while read -r package; do cat "${work_dir}/package-infos/${package}.depends" done < \ "${tmp_dir}/new_keep_packages" | \ sort -u - )" + ) printf '%s\n' "${new_keep_packages}" > \ "${tmp_dir}/new_keep_packages" - new_keep_packages="$( + new_keep_packages=$( join -1 1 -2 1 -o 2.2 \ "${tmp_dir}/new_keep_packages" \ "${tmp_dir}/done_packages" - )" + ) # "new" is only what has not been there before printf '%s\n' "${keep_packages}" "${keep_packages}" "${new_keep_packages}" | \ @@ -513,15 +513,15 @@ while [ -s "${tmp_dir}/new_keep_packages" ]; do done -done_packages="$(cat "${tmp_dir}/done_packages")" +done_packages=$(cat "${tmp_dir}/done_packages") # if build list is empty, remember all entries of 'deletion-list' if grep -qvxF 'break_loops' "${work_dir}/build-list"; then delete_packages='' else - delete_packages="$( + delete_packages=$( cat "${work_dir}/deletion-list" - )" + ) fi if [ -z "${delete_packages}" ]; then @@ -540,18 +540,18 @@ fi # calculate unstageable packages from keep_packages and done_packages -done_packages="$( +done_packages=$( echo "${done_packages}" | \ cut -d' ' -f2 -)" +) -done_packages="$( +done_packages=$( ( printf '%s\n' "${done_packages}" "${keep_packages}" ) | \ sort | \ uniq -u -)" +) unset keep_packages diff --git a/bin/get-assignment b/bin/get-assignment index 1b2a00d..08c7be3 100755 --- a/bin/get-assignment +++ b/bin/get-assignment @@ -157,11 +157,11 @@ done # Find package (of all packages which are not locked and have been broken the least times) # which breaks the most unlocked loops -locked_packages="$( +locked_packages=$( ls "${work_dir}/package-states/" | \ grep '\(\.[0-9a-f]\{40\}\)\{2\}\.[^\.\]\+\.locked$' | \ sed 's|\(\.[0-9a-f]\{40\}\)\{2\}\.[^\.\]\+\.locked$||' -)" +) grep -vxF 'break_loops' "${work_dir}/build-list" | \ sort -k1,1 > \ @@ -189,10 +189,10 @@ for package in $( "${work_dir}/build-list.sorted-by-package" | \ while read -r count package git_revision git_mod_revision repository; do if [ -f "${work_dir}/package-states/${package}.${git_revision}.${git_mod_revision}.${repository}.broken" ]; then - trials="$( + trials=$( wc -l < \ "${work_dir}/package-states/${package}.${git_revision}.${git_mod_revision}.${repository}.broken" - )" + ) else trials='0' fi diff --git a/bin/get-package-updates b/bin/get-package-updates index b51d7c2..e91e471 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -227,7 +227,7 @@ echo 'apply blacklisting' # this is the first time when all the information is available and up to date black_listed='' -black_listed_new="$( +black_listed_new=$( ( git -C "${repo_paths__archlinux32}" archive "$(cat "${work_dir}/archlinux32.revision")" -- 'blacklist' | \ tar -Ox 'blacklist' @@ -237,7 +237,7 @@ black_listed_new="$( uniq ) | \ sort -u -)" +) ls "${work_dir}/package-infos/" | \ grep '\(\.[0-9a-f]\{40\}\)\{2\}\.[^.]\+\.builds$' | \ @@ -270,16 +270,16 @@ ls "${work_dir}/package-infos/" | \ mod_revs='' continue fi - revs="$( + revs=$( printf '%s\n' \ ${revs} \ "${rev}" - )" - mod_revs="$( + ) + mod_revs=$( printf '%s\n' \ ${mod_revs} \ "${mod_rev}" - )" + ) opkg="${pkg}" orepo="${repo}" done | \ @@ -308,11 +308,11 @@ sed " "${work_dir}/newest-dependencies" while [ -n "${black_listed_new}" ]; do - black_listed="$( + black_listed=$( printf '%s\n' ${black_listed} ${black_listed_new} | \ sort -u - )" - black_listed_new="$( + ) + black_listed_new=$( ( printf '%s\n' ${black_listed} | \ sort -k1,1 | \ @@ -354,12 +354,12 @@ while [ -n "${black_listed_new}" ]; do fi done | \ sort -u - )" - black_listed_new="$( + ) + black_listed_new=$( printf '%s\n' ${black_listed} ${black_listed} ${black_listed_new} | \ sort | \ uniq -u - )" + ) done echo "${black_listed}" | \ while read -r package; do diff --git a/bin/return-assignment b/bin/return-assignment index a057799..bfd4d5b 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -63,11 +63,11 @@ if [ "$5" = 'ERROR' ]; then # unlock every loop this package would have broken and which is not # broken by another locked package - locked_packages="$( + locked_packages=$( ls "${work_dir}/package-states/" | \ grep '\.locked$' | \ sed 's@^.*/\([^/]\+\)\.\([0-9a-f]\{40\}\.\)\{2\}[^.]\+\.locked$@\1@' - )" + ) grep -lxF "${1}" "${work_dir}/build-list.loops/loop_"* 2> /dev/null | \ while read -r loop; do if [ -z "$( @@ -121,7 +121,7 @@ clean_up_tmp_dir() { clean_up_lock_file } -tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" +tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") cd "${tmp_dir}" trap clean_up_tmp_dir EXIT @@ -133,14 +133,14 @@ tar -x \ '*.pkg.tar.xz.sig' # check if all packages are signed and all signatures belong to a package -signature_errors="$( +signature_errors=$( ls -1 *.pkg.tar.xz{,.sig} | \ sed 's|\.sig$||' | \ sort | \ uniq -c | \ grep -v '^\s*2\s' | \ awk '{print $2}' -)" +) if [ -n "${signature_errors}" ]; then >&2 echo 'The following packages lack a signature or vice versa:' @@ -149,11 +149,11 @@ if [ -n "${signature_errors}" ]; then fi # check if the sent packages are the expected ones -packages="$( +packages=$( ls -1 | \ grep '\.pkg\.tar\.xz$' -)" -package_errors="$( +) +package_errors=$( ( printf '%s\n' ${packages} | \ sed ' @@ -170,7 +170,7 @@ package_errors="$( ) | \ sort -k2 | \ uniq -u -f1 -)" +) if [ -n "${package_errors}" ]; then >&2 echo 'The following packages should have been built but are missing or vice versa:' @@ -179,7 +179,7 @@ if [ -n "${package_errors}" ]; then fi # move packages -destination="$(official_or_community "$1.$2.$3.$4" 'staging')" +destination=$(official_or_community "$1.$2.$3.$4" 'staging') ${master_mirror_rsync_command} \ "${master_mirror_rsync_directory}/i686/${destination}/${destination}.db."* \ diff --git a/bin/sanity-check b/bin/sanity-check index 36ac0eb..beb1206 100755 --- a/bin/sanity-check +++ b/bin/sanity-check @@ -50,7 +50,7 @@ do shift done -tmp_dir="$(mktemp -d)" +tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT if [ $# -eq 0 ]; then @@ -66,9 +66,9 @@ while [ $# -gt 0 ]; do [ ${silence} -gt 0 ] || \ >&2 printf 'checking build-list ...' - errors="$( + errors=$( grep -vn '^\S\+ [0-9a-f]\{40\} [0-9a-f]\{40\} \S\+$\|^break_loops$' "${work_dir}/build-list" - )" || true + ) || true if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -78,12 +78,12 @@ while [ $# -gt 0 ]; do exit 1 fi - errors="$( + errors=$( grep -vxF 'break_loops' "${work_dir}/build-list" | \ awk '{print $1}' | \ sort | \ uniq -d - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -93,7 +93,7 @@ while [ $# -gt 0 ]; do exit 1 fi - errors="$( + errors=$( ( grep -vxF 'break_loops' "${work_dir}/build-list" | \ awk '{print $1}' @@ -101,7 +101,7 @@ while [ $# -gt 0 ]; do ) | \ sort | \ uniq -d - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -123,7 +123,7 @@ while [ $# -gt 0 ]; do repos='build-support community-staging community-testing community core extra gnome-unstable kde-unstable staging testing' - errors="$( + errors=$( ( printf 'expected %s\n' ${repos} ls_master_mirror 'i686' | \ @@ -131,7 +131,7 @@ while [ $# -gt 0 ]; do ) | \ sort -k2 | \ uniq -uf1 - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -153,12 +153,12 @@ while [ $# -gt 0 ]; do [ ${silence} -gt 0 ] || \ >&2 printf 'checking consistency of repository "%s" on the master mirror ...' "${repo}" - packages="$( + packages=$( ls_master_mirror "i686/${repo}" | \ grep '\.pkg\.tar\.xz\(\.sig\)\?$' - )" || true + ) || true - errors="$( + errors=$( echo "${packages}" | \ grep '\S' | \ sed ' @@ -169,7 +169,7 @@ while [ $# -gt 0 ]; do uniq -cf1 | \ grep -v '^\s*2\s' | \ awk '{print $2 " " $3}' - )" || true + ) || true if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -184,7 +184,7 @@ while [ $# -gt 0 ]; do "${master_mirror_rsync_directory}/i686/${repo}/${repo}.files.tar.gz" \ "${tmp_dir}/" - errors="$( + errors=$( ( tar -tzf "${tmp_dir}/${repo}.db.tar.gz" | \ grep '/$' | \ @@ -202,7 +202,7 @@ while [ $# -gt 0 ]; do ) | \ sort -k2 | \ uniq -uf1 - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -212,7 +212,7 @@ while [ $# -gt 0 ]; do exit 1 fi - errors="$( + errors=$( ( tar -tzf "${tmp_dir}/${repo}.files.tar.gz" | \ grep '/$' | \ @@ -230,7 +230,7 @@ while [ $# -gt 0 ]; do ) | \ sort -k2 | \ uniq -uf1 - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo @@ -256,7 +256,7 @@ while [ $# -gt 0 ]; do [ ${silence} -gt 0 ] || \ >&2 printf 'checking state-files of "%s" ...' "${status%:*}" - errors="$( + errors=$( ( ls "${work_dir}/package-states" | \ grep "\.${status#*:}\$" | \ @@ -275,7 +275,7 @@ while [ $# -gt 0 ]; do uniq -cf1 | \ grep -v '^\s*2\s' | \ awk '{print $2 " " $3}' - )" + ) if [ -n "${errors}" ]; then if [ ${silence} -le 1 ]; then echo diff --git a/bin/seed-build-list b/bin/seed-build-list index 3a5c99b..d2e342b 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -25,7 +25,7 @@ usage() { [ -z "$1" ] && exit 1 || exit $1 } -tmp_dir="$(mktemp -d)" +tmp_dir=$(mktemp -d) trap "rm -rf --one-file-system '${tmp_dir}'" EXIT eval set -- "$( @@ -175,7 +175,7 @@ while read -r pkg; do fi success=false for arch in x86_64 any; do - pkgbase="$( + pkgbase=$( curl -sS "https://www.archlinux.org/packages/community/x86_64/${pkg}/" | \ sed -n ' /Base Package:/{ @@ -194,7 +194,7 @@ while read -r pkg; do s|/$|| s|^.*/|| ' - )" + ) if [ -n "${pkgbase}" ]; then echo "${pkgbase}" >> \ "${tmp_dir}/delta_pkgbases" @@ -230,7 +230,7 @@ rm "${tmp_dir}/delta_packages" # convert append_packages to build-list.new (add git hashes) while read -r pkg repo; do - git_repo="$(find_git_repository_to_package_repository "${repo}")" + git_repo=$(find_git_repository_to_package_repository "${repo}") printf '%s %s %s %s\n' \ "${pkg}" \ "$(cat "${work_dir}/${git_repo}.revision")" \ diff --git a/bin/show-dependencies b/bin/show-dependencies index e6eb070..4db1864 100755 --- a/bin/show-dependencies +++ b/bin/show-dependencies @@ -5,15 +5,15 @@ # Create a lock file. if [ $# -eq 0 ]; then - broken="$( + broken=$( ls "${work_dir}/package-states" | \ grep '\.broken$' - )" - broken="$( + ) + broken=$( echo "${broken}" | \ sed 's|\(\.[^.]\+\)\{4\}$||' | \ sort -u - )" + ) "$0" ${broken} || \ exit $? ( @@ -45,7 +45,7 @@ if ! flock -n 9; then exit fi -tmp_dir="$(mktemp -d)" +tmp_dir=$(mktemp -d) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT sort -u "${work_dir}/build-order" | \ @@ -97,7 +97,7 @@ for target_package in "$@"; do "${tmp_dir}/knots" last_sum='' - current_sum="$(sha512sum "${tmp_dir}/build-order")" + current_sum=$(sha512sum "${tmp_dir}/build-order") while ! [ "${last_sum}" = "${current_sum}" ]; do last_sum="${current_sum}" @@ -119,7 +119,7 @@ for target_package in "$@"; do sort -u "${tmp_dir}/build-order" | \ sponge "${tmp_dir}/build-order" - current_sum="$(sha512sum "${tmp_dir}/build-order")" + current_sum=$(sha512sum "${tmp_dir}/build-order") done @@ -226,10 +226,10 @@ for target_package in "$@"; do '}' >> \ "${tmp_dir}/input" - line_count="$(wc -l < "${tmp_dir}/input")" + line_count=$(wc -l < "${tmp_dir}/input") if [ "${line_count}" -gt 500 ]; then sed -i '/"base\(-devel\)\?"/d' "${tmp_dir}/input" - line_count="$(wc -l < "${tmp_dir}/input")" + line_count=$(wc -l < "${tmp_dir}/input") if [ "${line_count}" -gt 700 ]; then rm -f "${output}" >&2 printf 'Skipping graph for "%s" - would be too big (%d).\n' \ diff --git a/bin/why_dont_you b/bin/why_dont_you index 51f2e4a..04e717a 100755 --- a/bin/why_dont_you +++ b/bin/why_dont_you @@ -26,7 +26,7 @@ case "${action}" in continue fi - unmet_dependencies="$(find_dependencies_on_build_list "${package}" "${git_revision}" "${mod_git_revision}" "${repository}")" + unmet_dependencies=$(find_dependencies_on_build_list "${package}" "${git_revision}" "${mod_git_revision}" "${repository}") if [ -n "${unmet_dependencies}" ]; then printf '"%s" has unmet dependencies:\n' "${package}" echo "${unmet_dependencies}" | \ @@ -66,16 +66,16 @@ case "${action}" in continue fi - dependent_packages="$( + dependent_packages=$( grep -lxF "${pkg}" "${work_dir}/package-infos/"*".depends" | \ sed ' s|^.*/|| s|\.depends$|| ' - )" + ) - build_list_items_file="$(mktemp)" - dependent_packages_file="$(mktemp)" + build_list_items_file=$(mktemp) + dependent_packages_file=$(mktemp) grep -vxF 'break_loops' "${work_dir}/build-list" | \ awk '{print $1 "." $2 "." $3 "." $4}' | \ @@ -86,11 +86,11 @@ case "${action}" in sort -u > \ "${dependent_packages_file}" - dependent_still_on_build_list="$( + dependent_still_on_build_list=$( join -1 1 -2 1 -o 1.1 \ "${build_list_items_file}" \ "${dependent_packages_file}" - )" + ) rm -f \ "${build_list_items_file}" \ @@ -103,14 +103,14 @@ case "${action}" in continue fi - dependent_still_in_staging="$( + dependent_still_in_staging=$( echo "${dependent_packages}" | \ while read -r sf; do if [ -f "${work_dir}/package-states/${sf}.done" ]; then echo "${sf}" fi done - )" + ) if [ -n "${dependent_still_in_staging}" ]; then printf 'The following packages are dependent on "%s" and still in staging - maybe they cannot be unstaged:\n' "${pkg}" @@ -127,15 +127,15 @@ case "${action}" in 'keep') - tmp_file="$(mktemp)" + tmp_file=$(mktemp) trap 'rm -f "${tmp_file}"' EXIT while read -r pkg; do - if builds_file="$( + if builds_file=$( ls "${work_dir}/package-infos" | \ grep -m1 "^$(str_to_regex "${pkg}")\(\.[^.]\+\)\{3\}\.builds\$" - )"; then + ); then builds_file="${builds_file%.*}" prepo="${builds_file##*.}" @@ -147,23 +147,23 @@ case "${action}" in else found_PKGBUILD=false - mod_rev="$(cat "${work_dir}/archlinux32.revision")" + mod_rev=$(cat "${work_dir}/archlinux32.revision") for repo in ${repo_names}; do eval 'repo_path="${repo_paths__'"${repo}"'}"' - rev="$(cat "${work_dir}/${repo}.revision")" + rev=$(cat "${work_dir}/${repo}.revision") if [ "${repo}" = 'archlinux32' ]; then if git -C "${repo_path}" archive "${mod_rev}" | \ grep -q "^[^/]\+/$(str_to_regex "${pkg}")/PKGBUILD\$"; then - prepo="$( + prepo=$( git -C "${repo_path}" archive "${mod_rev}" | \ grep "^[^/]\+/$(str_to_regex "${pkg}")/PKGBUILD\$" | \ cut -d/ -f1 - )" + ) found_PKGBUILD=true break fi else - prepo="$( + prepo=$( git -C "${repo_path}" archive "${rev}" -- "${pkg}/repos" 2>/dev/null | \ tar -t 2> /dev/null | \ grep '^[^/]\+/repos/[^/]\+/PKGBUILD$' | \ @@ -173,7 +173,7 @@ case "${action}" in s|^[^/]\+/repos/\([^/]\+\)-[^/-]\+/PKGBUILD$|\1| ' | \ head -n1 - )" + ) if [ -n "${prepo}" ]; then found_PKGBUILD=true break @@ -216,21 +216,21 @@ case "${action}" in continue fi - if ! needs="$( + if ! needs=$( ls "${work_dir}/package-infos" | \ grep "^$(str_to_regex "${pkg}")\..*\.needs\$" - )"; then + ); then printf 'Package "%s" was deleted in the git repositories.\n' "${pkg}" continue fi - needs="$( + needs=$( printf "${work_dir}/package-infos/%s\n" ${needs} | \ xargs -r cat | \ sort -u - )" + ) - errors="$( + errors=$( ( printf '%s\n' ${needs} awk '{print $3}' "${tmp_file}" | \ @@ -239,7 +239,7 @@ case "${action}" in sort | \ uniq -d | \ join -1 1 -2 3 -o 2.1,2.2,2.3 - "${tmp_file}" - )" + ) if [ -n "${errors}" ]; then printf 'Package "%s" has dependencies on the deletion list:\n' "${pkg}" printf '%s %s %s\n' ${errors} diff --git a/conf/default.conf b/conf/default.conf index 730481d..bb39d8e 100755 --- a/conf/default.conf +++ b/conf/default.conf @@ -7,9 +7,9 @@ export LANG=C # dirty hack to get this stuff debugable from a bash if [ "x${0##*/}" = "x-bash" ] || [ "x${0##*/}" = "xbash" ] || [ "x${0##*/}" = "xdash" ]; then - base_dir="$(pwd)" + base_dir=$(pwd) else - base_dir="$(dirname "$(readlink -f "$0")")/.." + base_dir=$(printf '%s/..' "$(dirname "$(readlink -f "$0")")") fi . "${base_dir}/bin/common-functions" @@ -42,14 +42,14 @@ master_mirror_sftp_commend='sftp -b- user@mirror' build_log_directory='/srv/http/build-logs' # what should be tried in what order to somehow repair a broken build -straws_that_might_repair_failing_builds="$( +straws_that_might_repair_failing_builds=$( printf '%s\n' \ ':' \ ':clean_chroot:' \ ':mirrored_source:' \ ':with_build_support:' \ ':with_build_support:clean_chroot:' -)" +) # root directory of the webserver webserver_directory='/srv/http' |