summaryrefslogtreecommitdiff
path: root/update-archlinux32-package
diff options
context:
space:
mode:
Diffstat (limited to 'update-archlinux32-package')
-rwxr-xr-xupdate-archlinux32-package160
1 files changed, 87 insertions, 73 deletions
diff --git a/update-archlinux32-package b/update-archlinux32-package
index b488ec6..44b0693 100755
--- a/update-archlinux32-package
+++ b/update-archlinux32-package
@@ -13,6 +13,7 @@
# flashplugin
# freebasic
# linux
+# linux-galileo-gen2
# linux-lts
# linux-olpc-xo1 (no upstream)
# linux-pae (no upstream)
@@ -21,8 +22,7 @@
# teamspeak3-server
git_repo_path='/usr/src/archlinux32/packages'
-upstream_git_path='/usr/src/archlinux/packages'
-upstream_community_git_path='/usr/src/archlinux/community'
+state_repo_path='/usr/src/archlinux/state'
archlinuxewe_git_path=~erich/'archlinuxewe'
base_dir=$(
dirname "$(
@@ -34,8 +34,7 @@ if [ "x$1" = "x-" ]; then
shift
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 "${state_repo_path}" pull --ff-only || \
! git -C "${archlinuxewe_git_path}" pull --ff-only; then
>&2 echo 'Your git repos cannot cleanly be updated'
exit 1
@@ -113,7 +112,7 @@ case "${pkgname}" in
# a kernel which exists upstream -> different config and checksums
update_path='kernel with upstream'
;;
- 'linux-olpc-xo1'|'linux-pae')
+ 'linux-galileo-gen2'|'linux-olpc-xo1'|'linux-pae')
# a kernel which does not exist upstream -> complete package sources
# in our repository
update_path='kernel without upstream'
@@ -176,10 +175,15 @@ case ${update_path} in
T sum_loop
}
' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"
- scp -r "${upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \
- "arch32-test:${pkgname}"
+ commit=$(
+ git -C "${state_repo_path}" archive HEAD -- "${repo}-${repo_arch}/${pkgname}" \
+ | tar -Ox \
+ | cut -d' ' -f4
+ )
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${commit}"'.tar.gz' \
+ | ssh 'arch32-test' 'tar -xz'
if ! ssh arch32-test '
- cd "'"${pkgname}"'"
+ cd "'"${pkgname}"'-'"${commit}"'"
cat >> PKGBUILD
makepkg --verifysource
' < \
@@ -190,44 +194,39 @@ 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 "${used_upstream_git_path}/${pkgname}/repos" archive HEAD -- 2>/dev/null | \
- tar -t 2>/dev/null | \
- sed -n '
- s/^'"${repo}-"'//
- T
- s@/$@@
- p
- ' | \
- head -n1
+ git -C "${state_repo_dir}" archive HEAD \
+ | tar -t --wildcard "${repo}"'-*/'"${pkgname}" \
+ | sed -n '
+ s@^'"${repo}"'-@@
+ T
+ s@/.*$@@
+ T
+ p
+ ' \
+ | head -n1
)
- 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 -n '
- s/^'"${repo}-"'//
- T
- s@/$@@
- p
- ' | \
- head -n1
- )
- fi
- scp -r "${used_upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}" \
- "arch32-test:${pkgname}"
+ commit=$(
+ git -C "${state_repo_dir}" archive HEAD -- "${repo}-${repo_arch}/${pkgname}" \
+ | tar -Ox \
+ | cut -d' ' -f4
+ )
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${commit}"'.tar.gz' \
+ | ssh 'arch32-test' 'tar -xz'
ssh arch32-test '
- cd "'"${pkgname}"'"
+ cd "'"${pkgname}-${commit}"'"
cat >> PKGBUILD
echo '"'"'[ "${arch[0]}" = any ] || arch+=(i686 pentium4)'"'"' >> PKGBUILD
' < "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"
update_checksum
- scp "${used_upstream_git_path}/${pkgname}/repos/${repo}-${repo_arch}/PKGBUILD" \
- "arch32-test:${pkgname}/"
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${commit}"'.tar.gz' \
+ | tar -Oxz "${pkgname}-${commit}"'/PKGBUILD' \
+ | ssh 'arch32-test' '
+ cd "'"${pkgname}-${commit}"'"
+ cat > "PKGBUILD"
+ '
if ! ssh arch32-test '
- cd "'"${pkgname}"'"
+ cd "'"${pkgname}-${commit}"'"
cat >> PKGBUILD
echo '"'"'[ "${arch[0]}" = any ] || arch+=(i686 pentium4)'"'"' >> PKGBUILD
makepkg --verifysource
@@ -294,7 +293,7 @@ case ${update_path} in
update_checksum
case "${pkgname}" in
- 'linux-olpc-xo1'|'linux-pae')
+ 'linux-galileo-gen2'|'linux-olpc-xo1'|'linux-pae')
config_name=$(
ls "${git_repo_path}/${repo}/${pkgname}" \
| grep '^config'
@@ -303,7 +302,7 @@ case ${update_path} in
ssh arch32-test '
cd '"${pkgname}"'
sed -i '"'"'
- /make \(old\|prepare\)/ i make alldefconfig
+ /make \(old\|prepare\)/ i make olddefconfig
s/^}$/return 1\n\0/
'"'"' PKGBUILD
makepkg -fcrs --asdeps --noconfirm
@@ -320,6 +319,12 @@ case ${update_path} in
;;
esac
+ if ! grep -qwF sha256sums "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"; then
+ >&2 printf 'Something went wrong: %s has no checksum\nDid you run out of disk space again, deep42thought?\n' \
+ "${git_repo_path}/${repo}/${pkgname}"
+ exit 1
+ fi
+
git -C "${git_repo_path}" commit -m "${repo}/${pkgname}: ${old_pkgver} -> ${new_pkgver}"
;;
'kernel with upstream')
@@ -335,6 +340,15 @@ case ${update_path} in
>&2 echo '"# upstream git revision: ..." line is missing.'
exit 1
fi
+ new_revision=$(
+ git -C "${state_repo_path}" archive HEAD -- "${repo}-x86_64/${pkgname}" \
+ | tar -Ox \
+ | cut -d' ' -f4
+ )
+ if [ "${old_revision}" = "${new_revision}" ]; then
+ >&2 printf 'Old and new revision are both %s. Nothing to do.\n' "${old_revision}"
+ exit 0
+ fi
config_names=$(
git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD -- | \
tar -t | \
@@ -343,17 +357,17 @@ case ${update_path} in
)
diff=$(
diff -u <(
- git -C "${upstream_git_path}/${pkgname}/repos/${repo}-x86_64" archive "${old_revision}" -- config | \
- tar -Ox | \
- sort
- ) \
- <(
- git -C "${upstream_git_path}/${pkgname}/repos/${repo}-x86_64" archive HEAD -- config | \
- tar -Ox | \
- sort
- ) | \
- grep '^[+-].' | \
- grep -v '^+++\|^---'
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${old_revision}"'.tar.gz' \
+ | tar -Oxz "${pkgname}-${old_revision}/config" \
+ | sort
+ ) \
+ <(
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${new_revision}"'.tar.gz' \
+ | tar -Oxz "${pkgname}-${new_revision}/config" \
+ | sort
+ ) \
+ | grep '^[+-].' \
+ | grep -v '^+++\|^---'
)
if [ -z "${diff}" ]; then
>&2 echo 'nothing changed.'
@@ -379,23 +393,22 @@ case ${update_path} in
sponge "${git_repo_path}/${repo}/${pkgname}/${config_name}"
done
sed -i '
- 1 s/^#.*$/# upstream git revision: '"$(
- git -C "${upstream_git_path}" rev-parse HEAD
- )"'/
+ 1 s/^#.*$/# upstream git revision: '"${new_revision}"'/
s/'"$(
- git -C "${upstream_git_path}/${pkgname}/repos/${repo}-x86_64" archive "${old_revision}" -- config | \
- tar -Ox | \
- sha256sum | \
- awk '{print $1}'
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${old_revision}"'.tar.gz' \
+ | tar -Oxz "${pkgname}-${old_revision}/config" \
+ | b2sum \
+ | awk '{print $1}'
)"'/'"$(
- git -C "${upstream_git_path}/${pkgname}/repos/${repo}-x86_64" archive HEAD -- config | \
- tar -Ox | \
- sha256sum | \
- awk '{print $1}'
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${new_revision}"'.tar.gz' \
+ | tar -Oxz "${pkgname}-${new_revision}/config" \
+ | b2sum \
+ | awk '{print $1}'
)"'/g
' "${git_repo_path}/${repo}/${pkgname}/PKGBUILD"
{
- git -C "${upstream_git_path}/${pkgname}/repos/${repo}-x86_64" archive HEAD --
+ curl -LSs 'https://buildmaster.archlinux32.org/upstream-packages/'"${pkgname}"'-'"${new_revision}"'.tar.gz' \
+ | zcat
git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD \
| tar -tf - \
| grep -vxF "$(
@@ -407,11 +420,13 @@ case ${update_path} in
for config_name in ${config_names}; do
tar -c -C "${git_repo_path}/${repo}/${pkgname}" "${config_name}"
done
- } | \
- ssh arch32-test '
- mkdir "'"${pkgname}"'"
- tar -xiC "'"${pkgname}"'"
- '
+ } \
+ | ssh arch32-test '
+ mkdir "'"${pkgname}"'"
+ tar -xiC "'"${pkgname}"'"
+ mv "'"${pkgname}/${pkgname}-${new_revision}"'"/* "'"${pkgname}"'/" || exit $?
+ rmdir "'"${pkgname}/${pkgname}-${new_revision}"'" || exit $?
+ ' || exit $?
ssh arch32-test '
cd "'"${pkgname}"'"
cat >> PKGBUILD
@@ -421,7 +436,7 @@ case ${update_path} in
printf 's/'
git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD -- "${config_name}" | \
tar -Ox | \
- sha256sum | \
+ b2sum | \
awk '{print $1}' | \
tr -d '\n'
printf '/SKIP/g\n'
@@ -430,8 +445,7 @@ case ${update_path} in
/^arch=[^#]*any/!{
/^arch=(/s/(/(i486 i686 pentium4 /
}
- /^\s*cp .\+ \.config\s*$/ a make olddefconfig
- /^}$/ i mv .config .processed-config \
+ /^\s*_make olddefconfig$/ a mv .config .processed-config \
return 1
'"'"' PKGBUILD
' < \
@@ -457,11 +471,11 @@ case ${update_path} in
printf 's/'
git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD -- "${config_name}" | \
tar -Ox | \
- sha256sum | \
+ b2sum | \
awk '{print $1}' | \
tr -d '\n'
printf '/'
- sha256sum "${git_repo_path}/${repo}/${pkgname}/${config_name}" | \
+ b2sum "${git_repo_path}/${repo}/${pkgname}/${config_name}" | \
awk '{print $1}' | \
tr -d '\n'
printf '/g\n'