summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/seed-build-list25
1 files changed, 23 insertions, 2 deletions
diff --git a/bin/seed-build-list b/bin/seed-build-list
index d49722a..ac3ac32 100755
--- a/bin/seed-build-list
+++ b/bin/seed-build-list
@@ -25,6 +25,8 @@ usage() {
>&2 echo ' Show this help and exit.'
>&2 echo ' -i|--ignore $pkgbase:'
>&2 echo ' Do not update the given package.'
+ >&2 echo ' -j|--jostle'
+ >&2 echo ' Give new build assignments the highest priority.'
>&2 echo ' -m|--mirror $url:'
>&2 echo ' Schedule all packages, that are newer on the given'
>&2 echo ' x86_64 mirror - except packages in'
@@ -48,11 +50,12 @@ tmp_dir=$(mktemp -d 'tmp.seed-build-list.XXXXXXXXXX' --tmpdir)
trap "rm -rf --one-file-system '${tmp_dir:?}'" EXIT
eval set -- "$(
- getopt -o afhi:m:np:u:w \
+ getopt -o afhi:jm:np:u:w \
--long auto \
--long force \
--long help \
--long ignore: \
+ --long jostle \
--long mirror: \
--long no-action \
--long package: \
@@ -63,9 +66,10 @@ eval set -- "$(
)"
auto=false
+ignore_mysql_generate_package_metadata_errors=false
+jostle=false
update=true
wait_for_lock='-n'
-ignore_mysql_generate_package_metadata_errors=false
if [ -r "${base_dir}/conf/seed-ignore-packages" ]; then
sed 's/^/2\t/' "${base_dir}/conf/seed-ignore-packages" >> \
@@ -89,6 +93,9 @@ do
printf '3\t%s\n' "$1" >> \
"${tmp_dir}/ignore-packages"
;;
+ -j|--jostle)
+ jostle=true
+ ;;
-m|--mirror)
shift
printf '%s\n' "$1" >> \
@@ -683,6 +690,20 @@ if ${update}; then
mysql_join_binary_packages_binary_packages_in_repositories 'a_bp' 'a_bpir'
printf ' AND `a_bpir`.`repository`=%s;\n' \
"${repository_ids__any_build_list}"
+
+ if ${jostle}; then
+ printf 'SET @`max_priority`=('
+ printf 'SELECT'
+ printf ' MAX(`build_assignments`.`priority`)+1'
+ printf ' FROM `build_assignments`'
+ printf ');\n'
+ printf 'UPDATE `build_assignments`'
+ mysql_join_build_assignments_package_sources
+ printf ' JOIN `pkgbases`'
+ printf ' ON `pkgbases`.`pkgbase`=`package_sources`.`pkgbase`'
+ printf ' SET `build_assignments`.`priority`=@`max_priority`'
+ printf ';\n'
+ fi
} | \
mysql_run_query