From 9ff95b0b5b89d3b0b415e539035cb7876f6bac56 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 21 Jan 2018 21:11:34 +0100 Subject: bin/get-package-updates: update mysql database with new build-list packages --- bin/get-package-updates | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index cbe8b14..2666629 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -287,6 +287,7 @@ mkdir -p "${work_dir}/package-infos" while read -r package git_revision mod_git_revision repository; do generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" + myqsl_generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" done < "${work_dir}/build-list.new" -- cgit v1.2.3-54-g00ecf From ac158e4b3c459b615ecff930181d81f587d6a414 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 21 Jan 2018 21:37:46 +0100 Subject: bin/get-package-updates: accelleration and bugfix --- bin/get-package-updates | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 2666629..763d01a 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -7,6 +7,8 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" +. "${base_dir}/bin/mysql-functions" + # TODO: Find out, why sometimes package updates are missed. # shellcheck disable=SC2016 @@ -268,6 +270,7 @@ done | \ echo "${package} ${git_revision} ${new_repo_revisions__archlinux32} ${repository}" >> \ "${work_dir}/build-list.new" sed -i "/^$(str_to_regex "${package}")\$/d" "${work_dir}/deletion-list.new" + mysql_generate_package_metadata "${package}" "${git_revision}" "${new_repo_revisions__archlinux32}" "${repository}" continue fi @@ -287,7 +290,6 @@ mkdir -p "${work_dir}/package-infos" while read -r package git_revision mod_git_revision repository; do generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" - myqsl_generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" done < "${work_dir}/build-list.new" -- cgit v1.2.3-54-g00ecf From d384cd8395fb0a0e0686f3c1ddac883002563f9a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 10:27:41 +0100 Subject: source bin/mysql-functions in conf/default.conf - just like bin/common-functions - because it is now needed almost everywhere --- bin/bootstrap-mysql | 2 -- bin/build-master-status-from-mysql | 2 -- bin/db-update | 2 -- bin/get-package-updates | 2 -- conf/default.conf | 2 ++ 5 files changed, 2 insertions(+), 8 deletions(-) (limited to 'bin/get-package-updates') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 3069863..fcb2f7e 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -2,8 +2,6 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -# shellcheck source=bin/mysql-functions -. "${base_dir}/bin/mysql-functions" tmp_dir=$(mktemp -d 'tmp.bootstrap-mysql.XXXXXXXXXX' --tmpdir) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql index 85185b7..12278be 100755 --- a/bin/build-master-status-from-mysql +++ b/bin/build-master-status-from-mysql @@ -4,8 +4,6 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -# shellcheck source=bin/mysql-functions -. "${base_dir}/bin/mysql-functions" # shellcheck disable=SC2016 { diff --git a/bin/db-update b/bin/db-update index 1417820..5b32214 100755 --- a/bin/db-update +++ b/bin/db-update @@ -29,8 +29,6 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -. "${base_dir}/bin/mysql-functions" - # shellcheck disable=SC2016 usage() { >&2 echo '' diff --git a/bin/get-package-updates b/bin/get-package-updates index 763d01a..daa68a7 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -7,8 +7,6 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" -. "${base_dir}/bin/mysql-functions" - # TODO: Find out, why sometimes package updates are missed. # shellcheck disable=SC2016 diff --git a/conf/default.conf b/conf/default.conf index b2882ac..6ee991b 100755 --- a/conf/default.conf +++ b/conf/default.conf @@ -16,6 +16,8 @@ fi # shellcheck source=bin/common-functions . "${base_dir}/bin/common-functions" +# shellcheck source=bin/mysql-functions +. "${base_dir}/bin/mysql-functions" work_dir="${base_dir}/work" -- cgit v1.2.3-54-g00ecf From 0cc08099ad33ca13cbf4b7cbeb6e98bf89935b79 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 11:35:11 +0100 Subject: new todos --- bin/db-update | 3 +++ bin/delete-packages | 2 ++ bin/get-package-updates | 2 ++ bin/seed-build-list | 2 ++ 4 files changed, 9 insertions(+) (limited to 'bin/get-package-updates') diff --git a/bin/db-update b/bin/db-update index b11945c..fe45f41 100755 --- a/bin/db-update +++ b/bin/db-update @@ -23,6 +23,9 @@ # TODO: fully integrate database (in other scripts too) - e.g. rely on # info in db instead of state-files +# TODO: add possibility to manually clone a (binary) package (e.g. +# for build-support) - this should also be possible via email + # shellcheck disable=SC2039 # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" diff --git a/bin/delete-packages b/bin/delete-packages index a6e3f14..26d323a 100755 --- a/bin/delete-packages +++ b/bin/delete-packages @@ -13,6 +13,8 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" +# TODO: finish this + # shellcheck disable=SC2016 usage() { >&2 echo '' diff --git a/bin/get-package-updates b/bin/get-package-updates index daa68a7..2d113f1 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -9,6 +9,8 @@ # TODO: Find out, why sometimes package updates are missed. +# TODO: mark loops in mysql database + # shellcheck disable=SC2016 usage() { >&2 echo '' diff --git a/bin/seed-build-list b/bin/seed-build-list index feea704..78b29ba 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -5,6 +5,8 @@ # shellcheck source=conf/default.conf . "${0%/*}/../conf/default.conf" +# TODO: put new packages also in mysql database + # shellcheck disable=SC2016 usage() { >&2 echo '' -- cgit v1.2.3-54-g00ecf From b1bf479514f9b796169df90f6b8097b91600620a Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 20:14:36 +0100 Subject: bin/get-package-updates: mark packages as on deletion-list in mysql database --- bin/get-package-updates | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 2d113f1..cea1ec1 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -90,6 +90,20 @@ delete_package() { echo "$1" >> \ "${work_dir}/deletion-list.new" sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new" + # shellcheck disable=SC2016 + { + printf 'UPDATE `binary_packages`' + printf ' JOIN `%s` ON `%s`.`id`=`binary_packages`.`%s`' \ + 'repositories' 'repositories' 'repository' \ + 'build_assignments' 'build_assignments' 'build_assignment' + printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ + 'package_sources' 'package_sources' 'build_assignments' 'package_source' + printf ' WHERE `repositories`.`name`="build-list"' + printf ' AND `package_sources`.`pkgbase`=from_base64("%s")' \ + "$(printf '%s' "$1" | base64 -w0)" + printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list");' + } | \ + ${mysql_command} } # create tmp_dir and trap -- cgit v1.2.3-54-g00ecf From 170263108c8a6bf53fbfb22f8c7275bfff784edf Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 20:29:15 +0100 Subject: bin/get-package-updates: bugfix mysql expression --- bin/get-package-updates | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index cea1ec1..47c8824 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -98,10 +98,10 @@ delete_package() { 'build_assignments' 'build_assignments' 'build_assignment' printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ 'package_sources' 'package_sources' 'build_assignments' 'package_source' + printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list")' printf ' WHERE `repositories`.`name`="build-list"' - printf ' AND `package_sources`.`pkgbase`=from_base64("%s")' \ + printf ' AND `package_sources`.`pkgbase`=from_base64("%s");' \ "$(printf '%s' "$1" | base64 -w0)" - printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list");' } | \ ${mysql_command} } -- cgit v1.2.3-54-g00ecf From 9843dd27008a7ed749c4feffab76c7688035d49c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 08:42:04 +0100 Subject: bin/get-package-updates: fix typos --- bin/get-package-updates | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 47c8824..5b8bcea 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -11,6 +11,8 @@ # TODO: mark loops in mysql database +# TODO: test_exclusion does not yet cooperate with the database + # shellcheck disable=SC2016 usage() { >&2 echo '' @@ -56,7 +58,7 @@ do -x|--test-exclusion) shift if [ -n "${test_exclusion}" ]; then - >&2 printf 'I already have --test-exlusion=%s and you gave me another one.\n' "${test_exclusion}" + >&2 printf 'I already have --test-exclusion=%s and you gave me another one.\n' "${test_exclusion}" >&2 printf 'But I can only handle one exclusion test at a time.\n' exit 2 fi -- cgit v1.2.3-54-g00ecf From c4bb6a739aa4887525535cdbe38edfb93aac2edb Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 08:42:57 +0100 Subject: bin/get-package-updates: remove older versions of new build assignments from build- and deletion-list --- bin/get-package-updates | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 5b8bcea..7c57e03 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -286,6 +286,24 @@ done | \ echo "${package} ${git_revision} ${new_repo_revisions__archlinux32} ${repository}" >> \ "${work_dir}/build-list.new" sed -i "/^$(str_to_regex "${package}")\$/d" "${work_dir}/deletion-list.new" + # shellcheck disable=SC2016 + { + # delete old build assignment and associated binary packages + # which are not yet build or on the deletion list + printf 'DELETE `build_assignments`,`binary_pacakges`' + printf ' FROM `binary_packages`' + printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ + 'build_assignments' 'build_assignments' 'binary_packages' 'build_assignment' \ + 'package_sources' 'package_sources' 'build_assignments' 'package_source' \ + 'repositories' 'repositories' 'binary_packages' 'repository' + printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \ + "$( + printf '%s' "${package}" | \ + base64 -w0 + )" + printf ' AND (`repositories`.`name`="build-list" OR `repositories`.`name`="deletion-list");\n' + } | \ + ${mysql_command} mysql_generate_package_metadata "${package}" "${git_revision}" "${new_repo_revisions__archlinux32}" "${repository}" continue fi -- cgit v1.2.3-54-g00ecf From ac83a4dc2c5f4dbb3310eba3651dd35e06fbd5f2 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 23 Jan 2018 08:46:50 +0100 Subject: bin/get-package-updates: fix typo in mysql query --- bin/get-package-updates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 7c57e03..801aadd 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -290,7 +290,7 @@ done | \ { # delete old build assignment and associated binary packages # which are not yet build or on the deletion list - printf 'DELETE `build_assignments`,`binary_pacakges`' + printf 'DELETE `build_assignments`,`binary_packages`' printf ' FROM `binary_packages`' printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ 'build_assignments' 'build_assignments' 'binary_packages' 'build_assignment' \ -- cgit v1.2.3-54-g00ecf