From f3e0af1f8ca3f9f94ad6bd1a7185b0b4ffeb6613 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 20 Dec 2018 13:00:43 +0100 Subject: update-archlinux32-package: checksum updates should be possible for [community] packages, too --- update-archlinux32-package | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'update-archlinux32-package') diff --git a/update-archlinux32-package b/update-archlinux32-package index e8a1d98..c41075e 100755 --- a/update-archlinux32-package +++ b/update-archlinux32-package @@ -9,6 +9,7 @@ git_repo_path='/usr/src/archlinux32/packages' upstream_git_path='/usr/src/archlinux/packages' +upstream_community_git_path='/usr/src/archlinux/community' archlinuxewe_git_path=~erich/'eigeneSkripte/archPackages' vagrant_path=$( readlink -f ~/"virtual-boxes/archlinux32-test" @@ -24,6 +25,7 @@ if [ "x$1" = "x-" ]; then else if ! git -C "${git_repo_path}" pull --ff-only || \ ! git -C "${upstream_git_path}" pull --ff-only || \ + ! git -C "${upstream_community_git_path}" pull --ff-only || \ ! git -C "${archlinuxewe_git_path}" pull --ff-only; then >&2 echo 'Your git repos cannot cleanly be updated' exit 1 @@ -86,7 +88,7 @@ case "${pkgname}" in # upstream, though) update_path='archlinuxewe' ;; - 'flashplugin') + 'eclipse'|'flashplugin') # an upstream package which is updated by solely updating its checksum update_path='checksum' ;; @@ -179,13 +181,23 @@ case ${update_path} in git -C "${git_repo_path}" commit "${repo}/${pkgname}/PKGBUILD" -m "${repo}/${pkgname}: ${old_pkgver} -> ${new_pkgver}" ;; 'checksum') + used_upstream_git_path="${upstream_git_path}" repo_arch=$( - git -C "${upstream_git_path}/${pkgname}/repos" archive HEAD -- | \ - tar -t | \ + git -C "${used_upstream_git_path}/${pkgname}/repos" archive HEAD -- 2>/dev/null | \ + tar -t 2>/dev/null | \ sed 's/^'"${repo}-"'//;t;d' | \ head -n1 ) - scp -r "${upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \ + if [ -z "${repo_arch}" ]; then + used_upstream_git_path="${upstream_community_git_path}" + repo_arch=$( + git -C "${used_upstream_git_path}/${pkgname}/repos" archive HEAD -- | \ + tar -t | \ + sed 's/^'"${repo}-"'//;t;d' | \ + head -n1 + ) + fi + scp -r "${used_upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \ "arch32-test:${pkgname}" sums=$( ssh arch32-test ' @@ -201,14 +213,14 @@ case ${update_path} in ) echo "'$sums'" sed -i ' - /^\S\+sums=(/{ + /^\S\+sums\(_[^=]\+\)\?=(/{ :a $b N - s/^\S\+sums=(.*)/'"${sums}"'/ + s/^\S\+sums[^=]*=(.*)/'"${sums}"'/ } ' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" - if ! cat "${upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}/PKGBUILD" "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" \ + if ! cat "${used_upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}/PKGBUILD" "${git_repo_path}/${repo}/${pkgname}/PKGBUILD" \ | ssh arch32-test ' cd "'"${pkgname}"'" cat > PKGBUILD -- cgit v1.2.3-70-g09d2