summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xreplicate-db21
-rwxr-xr-xupdate-archlinux32-package152
-rwxr-xr-xwatch-versions3
3 files changed, 99 insertions, 77 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 bcb2768..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'
@@ -341,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 | \
@@ -349,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.'
@@ -385,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 "$(
@@ -413,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
@@ -427,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'
@@ -436,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
' < \
@@ -463,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'
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}"