index : devops | |
Archlinux32 devs' convenience-scripts | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | update-archlinux32-package | 118 |
diff --git a/update-archlinux32-package b/update-archlinux32-package index 891cdf7..c9481f0 100755 --- a/update-archlinux32-package +++ b/update-archlinux32-package @@ -115,6 +115,65 @@ fi ssh arch32-test 'rm -rf --one-file-system "'"${pkgname}"'"' case ${update_path} in + 'archlinuxewe') + archlinuxewe_PKGBUILD=$( + git -C "${archlinuxewe_git_path}" archive HEAD -- "${pkgname}32/PKGBUILD" | \ + tar -Ox + ) + repo_arch=$( + printf '%s\n' "${archlinuxewe_PKGBUILD}" | \ + grep '^arch=' | \ + cut -d'=' -f2 | \ + tr '()"'"'" '\n' | \ + grep -xF 'x86_64' || \ + echo any + ) + old_pkgver=$( + grep '^pkgver=' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" | \ + cut -d'=' -f2 + ) + if [ "${old_pkgver}" = "${new_pkgver}" ]; then + >&2 echo 'nothing to do' + exit + fi + new_pkgver=$( + printf '%s\n' "${archlinuxewe_PKGBUILD}" | \ + grep '^pkgver=' | \ + cut -d'=' -f2 + ) + sha512sums=$( + cd "${archlinuxewe_git_path}/${pkgname}32" + makepkg -g | \ + sed ' + s/^/\\1/ + $! s/$/\\n/ + ' | \ + tr -d '\n' + ) + sed -i ' + s/^pkgver=.*/pkgver='"${new_pkgver}"'/ + s/^pkgrel=.*/pkgrel=1/ + /^\s*sha512sums=(/ { + :sum_loop + $b + N + s/^\(\s*\)sha512sums=(.*)/'"${sha512sums}"'/ + T sum_loop + } + ' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" + scp -r "${upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \ + "arch32-test:${pkgname}" + if ! ssh arch32-test ' + cd "'"${pkgname}"'" + cat >> PKGBUILD + makepkg --verifysource + ' < \ + "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"; then + >&2 echo 'something went wrong' + exit 1 + fi + git -C "${git_repo_path}" commit "${repo}/${pkgname}/PKGBUILD" -m "${repo}/${pkgname}: ${old_pkgver} -> ${new_pkgver}" + ;; 'kernel without upstream') infos=$( "${base_dir}/watch-versions" "${pkgname}" @@ -301,65 +360,6 @@ case ${update_path} in )" "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" git -C "${git_repo_path}/${repo}/${pkgname}" commit PKGBUILD ${config_names} -m "${repo}/${pkgname}: new version => new config => new checksum" ;; - 'archlinuxewe') - archlinuxewe_PKGBUILD=$( - git -C "${archlinuxewe_git_path}" archive HEAD -- "${pkgname}32/PKGBUILD" | \ - tar -Ox - ) - repo_arch=$( - printf '%s\n' "${archlinuxewe_PKGBUILD}" | \ - grep '^arch=' | \ - cut -d'=' -f2 | \ - tr '()"'"'" '\n' | \ - grep -xF 'x86_64' || \ - echo any - ) - old_pkgver=$( - grep '^pkgver=' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" | \ - cut -d'=' -f2 - ) - if [ "${old_pkgver}" = "${new_pkgver}" ]; then - >&2 echo 'nothing to do' - exit - fi - new_pkgver=$( - printf '%s\n' "${archlinuxewe_PKGBUILD}" | \ - grep '^pkgver=' | \ - cut -d'=' -f2 - ) - sha512sums=$( - cd "${archlinuxewe_git_path}/${pkgname}32" - makepkg -g | \ - sed ' - s/^/\\1/ - $! s/$/\\n/ - ' | \ - tr -d '\n' - ) - sed -i ' - s/^pkgver=.*/pkgver='"${new_pkgver}"'/ - s/^pkgrel=.*/pkgrel=1/ - /^\s*sha512sums=(/ { - :sum_loop - $b - N - s/^\(\s*\)sha512sums=(.*)/'"${sha512sums}"'/ - T sum_loop - } - ' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" - scp -r "${upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \ - "arch32-test:${pkgname}" - if ! ssh arch32-test ' - cd "'"${pkgname}"'" - cat >> PKGBUILD - makepkg --verifysource - ' < \ - "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"; then - >&2 echo 'something went wrong' - exit 1 - fi - git -C "${git_repo_path}" commit "${repo}/${pkgname}/PKGBUILD" -m "${repo}/${pkgname}: ${old_pkgver} -> ${new_pkgver}" - ;; *) >&2 printf 'Whoops, I thought I knew how to update %s, but apparently I don'"'"'t.\n' \ "${update_path}" |