index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/build-packages | 13 | ||||
-rwxr-xr-x | bin/common-functions | 60 |
diff --git a/bin/build-packages b/bin/build-packages index 2fc602b..c54f34e 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -149,18 +149,7 @@ while [ ${count} -ne 0 ]; do tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" trap bail_out EXIT - if [ -n "${PKGBUILD}" ]; then - eval 'git -C "'"$(printf '${repo_paths__%s}' "${git_repo}")"'"'" archive '${git_revision}' -- '${PKGBUILD%/*}'" | \ - tar -x --strip-components=3 -C "${tmp_dir}" - fi - if [ -n "${PKGBUILD_mod}" ]; then - git -C "${repo_paths__archlinux32}" archive "${mod_git_revision}" -- "${PKGBUILD_mod%/*}" | \ - tar -x --overwrite --exclude 'PKGBUILD' --strip-components=2 -C "${tmp_dir}" - git -C "${repo_paths__archlinux32}" archive "${mod_git_revision}" -- "${PKGBUILD_mod}" | \ - tar -Ox "${PKGBUILD_mod}" >> \ - "${tmp_dir}/PKGBUILD" - append_architectures "${tmp_dir}/PKGBUILD" - fi + extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" cd "${tmp_dir}" success=false diff --git a/bin/common-functions b/bin/common-functions index bab3757..6ea3702 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -438,7 +438,6 @@ make_source_info() { local git_repo local PKGBUILD local PKGBUILD_mod - local tmp_file git_repo="$(find_repository_with_commit "${git_revision}")" @@ -448,29 +447,20 @@ make_source_info() { find_pkgbuilds "${package}" "${repository}" "${git_repo}" "${git_revision}" "${mod_git_revision}" - tmp_file="$(mktemp "${work_dir}/tmp.XXXXXX")" - - if [ -n "${PKGBUILD}" ]; then - eval git -C "$(printf '"${repo_paths__%s}"' "${git_repo}")" 'archive "${git_revision}" -- "${PKGBUILD}"' | \ - tar -Ox >> \ - "${tmp_file}" - fi + ( - if [ -n "${PKGBUILD_mod}" ]; then - git -C "${repo_paths__archlinux32}" archive "${mod_git_revision}" -- "${PKGBUILD_mod}" | \ - tar -Ox >> \ - "${tmp_file}" - fi + tmp_dir="$(mktemp -d "${work_dir}/tmp.XXXXXX")" + trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT - sed -i '/^\$Id\$$/d' "${tmp_file}" + extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" - ( - cd "${tmp_file%/*}" - makepkg -p "${tmp_file}" --printsrcinfo - ) > \ - "${output}" + ( + cd "${tmp_dir}" + makepkg --printsrcinfo + ) > \ + "${output}" - rm -f "${tmp_file}" + ) } @@ -619,3 +609,33 @@ find_package_repository_to_package() { echo "${repo}" } + +# extract_source_directory $git_repo $rev $mod_rev $output +# extract files found in the svn/git source directories +# $PKGBUILD and $PKGBUILD_mod are expected to be set correctly + +extract_source_directory() { + + local git_repo="$1" + local rev="$2" + local mod_rev="$3" + local output="$4" + + if [ -n "${PKGBUILD}" ]; then + eval 'git -C "${repo_paths__'"${git_repo}"'}" archive "${rev}" -- "${PKGBUILD%/*}"' | \ + tar -x --strip-components=3 -C "${output}" + fi + + if [ -n "${PKGBUILD_mod}" ]; then + git -C "${repo_paths__archlinux32}" archive "${mod_rev}" -- "${PKGBUILD_mod%/*}" | \ + tar -x --overwrite --exclude 'PKGBUILD' --strip-components=2 -C "${output}" 2> /dev/null || \ + true + git -C "${repo_paths__archlinux32}" archive "${mod_rev}" -- "${PKGBUILD_mod}" | \ + tar -Ox "${PKGBUILD_mod}" >> \ + "${output}/PKGBUILD" + append_architectures "${output}/PKGBUILD" + fi + + sed -i '/^\$Id\$$/d' "${output}/PKGBUILD" + +} |