summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xreplicate-db21
-rwxr-xr-xupdate-archlinux32-package198
-rwxr-xr-xwatch-versions3
3 files changed, 116 insertions, 106 deletions
diff --git a/replicate-db b/replicate-db
index 431b70f..8244ff7 100755
--- a/replicate-db
+++ b/replicate-db
@@ -38,10 +38,23 @@ printf '\n\n\n%s\n%s\n\n\n\n\n' "${root_pw}" "${root_pw}" | \
tmp_file=$(mktemp)
trap 'rm "${tmp_file}"' EXIT
-ssh master@10.100.10.1 '
- cd /data/backup/mysql;
- ls -t | grep -m1 '"'"'^database-.*\.xz$'"'"' | xargs pv
-' > "${tmp_file}"
+database_dump=$(
+ ssh master@10.100.10.1 '
+ cd /data/backup/mysql;
+ ls -t
+ ' \
+ | grep -xm1 'database-.*\.xz'
+)
+
+find /tmp \
+ -maxdepth 1 \
+ -type f \
+ -name "${database_dump}" \
+ -exec rsync -avP {} "${tmp_file}" \;
+
+rsync -avP \
+ "master@10.100.10.1:/data/backup/mysql/${database_dump}" \
+ "${tmp_file}"
{
printf 'SHOW SLAVE STATUS;\n'
diff --git a/update-archlinux32-package b/update-archlinux32-package
index 75e8dbb..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,12 +22,8 @@
# 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'
-vagrant_path=$(
- readlink -f ~/"virtual-boxes/archlinux32-test"
-)
base_dir=$(
dirname "$(
readlink -f "$0"
@@ -37,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
@@ -116,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'
@@ -127,18 +123,10 @@ case "${pkgname}" in
;;
esac
-if ssh -o ConnectTimeout=1 arch32-test true; then
- vm_is_running=true
-else
- vm_is_running=false
-fi
-
-if ! ${vm_is_running}; then
- cd "${vagrant_path}"
- vagrant up
+if ! ssh arch32-test 'rm -rf --one-file-system "'"${pkgname}"'"'; then
+ >&2 echo 'arch32-test vm is not running'
fi
-ssh arch32-test 'rm -rf --one-file-system "'"${pkgname}"'"'
case ${update_path} in
'archlinuxewe')
@@ -187,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
' < \
@@ -201,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
@@ -305,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'
@@ -314,7 +302,7 @@ case ${update_path} in
ssh arch32-test '
cd '"${pkgname}"'
sed -i '"'"'
- /make oldconfig/ s/^\s*#//
+ /make \(old\|prepare\)/ i make olddefconfig
s/^}$/return 1\n\0/
'"'"' PKGBUILD
makepkg -fcrs --asdeps --noconfirm
@@ -331,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')
@@ -346,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 | \
@@ -354,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.'
@@ -390,37 +393,40 @@ 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 "$(
+ printf '%s\n' \
+ 'PKGBUILD' \
+ ${config_names}
+ )" \
+ | xargs -r git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD --
for config_name in ${config_names}; do
tar -c -C "${git_repo_path}/${repo}/${pkgname}" "${config_name}"
done
- git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD -- $(
- git -C "${git_repo_path}/${repo}/${pkgname}" archive HEAD \
- | tar -t \
- | grep -v '^config' \
- | grep -vxF 'PKGBUILD'
- )
- } | \
- 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
@@ -430,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'
@@ -439,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
' < \
@@ -466,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'
@@ -486,12 +491,3 @@ case ${update_path} in
esac
ssh arch32-test 'rm -rf --one-file-system '"${pkgname}"
-
-if ! ${vm_is_running}; then
- ssh arch32-test 'sudo poweroff'
- err=$?
- if [ ${err} -eq 255 ]; then
- err=0
- fi
- exit ${err}
-fi
diff --git a/watch-versions b/watch-versions
index 99eff3d..6c01f81 100755
--- a/watch-versions
+++ b/watch-versions
@@ -97,7 +97,8 @@ case "${pkgbase}" in
*)
# It might be a (slightly modified) copy of an upstream package:
# Then we simply take the upstream pkgver.
- if [ "${pkgbase}" = 'linux-olpc-xo1' ]; then
+ if [ "${pkgbase}" = 'linux-olpc-xo1' ] \
+ || [ "${pkgbase}" = 'linux-galileo-gen2' ]; then
_pkgbase='linux'
else
_pkgbase="${pkgbase}"