diff options
-rwxr-xr-x | bin/build-packages | 14 | ||||
-rwxr-xr-x | bin/common-functions | 19 |
2 files changed, 26 insertions, 7 deletions
diff --git a/bin/build-packages b/bin/build-packages index bb1a5be..4f455b3 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -180,12 +180,22 @@ while [ "${count}" -ne 0 ]; do 0) [ ${count} -gt 0 ] && \ count=$((count-1)) + sub_pkgrel="${package##* }" + package="${package% *}" repository="${package##* }" package="${package% *}" mod_git_revision="${package##* }" package="${package% *}" git_revision="${package##* }" - package="${package% *}" + if [ "${git_revision}" = "${package}" ]; then + # build master did not tell us a sub_pkgrel + git_revision="${mod_git_revision}" + mod_git_revision="${repository}" + repository="${sub_pkgrel}" + sub_pkgrel='0' + else + package="${package% *}" + fi if [ "${git_revision##*-}" = 'HEAD' ]; then git_revision=$( @@ -233,7 +243,7 @@ while [ "${count}" -ne 0 ]; do tmp_dir=$(mktemp -d "${work_dir}/tmp.XXXXXX") trap bail_out EXIT - extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" + extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" "${sub_pkgrel}" cd "${tmp_dir}" success=false diff --git a/bin/common-functions b/bin/common-functions index 6f6db96..b25335b 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -635,7 +635,7 @@ make_source_info() { 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}" + extract_source_directory "${git_repo}" "${git_revision}" "${mod_git_revision}" "${tmp_dir}" '0' { cd "${tmp_dir}" @@ -675,15 +675,23 @@ recursively_umount_and_rm() { rm -rf --one-file-system "${dir}" } -# append_architectures $PKGBUILD +# mangle_pkgbuild $PKGBUILD [$sub_pkgrel] # mangle $arch in PKBUILDs to contain i486, i586, i686 +# append $sub_pkgrel to the pkgrel -append_architectures() { +mangle_pkgbuild() { local PKGBUILD="$1" + local sub_pkgrel="$2" + + if [ -n "${sub_pkgrel}" ]; then + sub_pkgrel=".${sub_pkgrel}" + fi + sed -i ' /^arch=[^#]*any/!{ /^arch=(/s/(/(i686 / } + s/^\(\s*pkgrel=\)['"'"'"]\?\([0-9.]\+\)['"'"'"]\?\s*\(#.*\)\?$/\1"\2'"${sub_pkgrel}"'"/ ' "${PKGBUILD}" } @@ -770,7 +778,7 @@ find_package_repository_to_package() { } -# extract_source_directory $git_repo $rev $mod_rev $output +# extract_source_directory $git_repo $rev $mod_rev $output $sub_pkgrel # extract files found in the svn/git source directories # $PKGBUILD and $PKGBUILD_mod are expected to be set correctly @@ -780,6 +788,7 @@ extract_source_directory() { local rev="$2" local mod_rev="$3" local output="$4" + local sub_pkgrel="$5" if [ -n "${PKGBUILD}" ]; then eval 'git -C "${repo_paths__'"${git_repo}"'}" archive "${rev}" -- "${PKGBUILD%/*}"' | \ @@ -795,7 +804,7 @@ extract_source_directory() { "${output}/PKGBUILD" fi - append_architectures "${output}/PKGBUILD" + mangle_pkgbuild "${output}/PKGBUILD" "${sub_pkgrel}" # shellcheck disable=SC2016 sed -i '/^\$Id\$$/d' "${output}/PKGBUILD" |