summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-01 09:05:51 +0100
committerErich Eckner <git@eckner.net>2018-03-01 09:05:51 +0100
commit496c571cd233a8646351ba241c3119ceaf2b8063 (patch)
tree3018e0a5a4ed78158c57a5b09d4b9e87fd3246d5 /lib
parent6047f2686cfe623e08fbaf4eae0a552ded731eb1 (diff)
downloadbuilder-496c571cd233a8646351ba241c3119ceaf2b8063.tar.xz
use "mysql -N" instead of cumbersome sedding
Diffstat (limited to 'lib')
-rwxr-xr-xlib/common-functions7
-rwxr-xr-xlib/mysql-functions19
2 files changed, 8 insertions, 18 deletions
diff --git a/lib/common-functions b/lib/common-functions
index 740c266..ba434ad 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -501,11 +501,8 @@ remove_old_package_versions() {
"$(printf '%s' "${repository}" | base64 -w0)"
printf ';\n'
} | \
- mysql_run_query --raw --batch | \
- sed '
- /^\S\+\sCONCAT(/d
- y/\t/ /
- ' | \
+ mysql_run_query -N --raw --batch | \
+ tr '\t' ' ' | \
expand_version 4 | \
sort -k4V,4 -k3r,3 | \
shrink_version 4 | \
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 6cbc502..3e7e19f 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -668,9 +668,8 @@ mysql_sanity_check() {
'a' 'b'
printf ';\n'
} | \
- mysql_run_query --raw --batch | \
+ mysql_run_query -N --raw --batch | \
sed '
- /^CONCAT("/d
s,^,<font color="#FF0000">,
s,$,</font>,
'
@@ -699,9 +698,8 @@ mysql_sanity_check() {
mysql_join_binary_packages_repositories
printf ' WHERE `repositories`.`is_on_master_mirror`'
} | \
- mysql_run_query --batch | \
+ mysql_run_query -N --raw --batch | \
sed '
- 1d
s,\t,/,
s,\t,-,
s,\t,:,
@@ -730,11 +728,8 @@ mysql_find_build_assignment_loops() {
mysql_join_binary_packages_repositories 'packages_dependent' 'repositories_dependent'
printf ' WHERE `repositories_dependent`.`name`="build-list" AND `repositories_dependency`.`name`="build-list"'
} | \
- mysql_run_query --raw --batch | \
- sed '
- 1d
- y/\t/ /
- ' | \
+ mysql_run_query -N --raw --batch | \
+ tr '\t' ' ' | \
tsort 2>&1 >/dev/null | \
sed 's/^tsort:\s*//' | \
{
@@ -910,8 +905,7 @@ mysql_repair_binary_packages_without_build_assignment() {
mysql_join_binary_packages_architectures
printf ' WHERE `binary_packages`.`build_assignment`<0'
} | \
- mysql_run_query --raw --batch | \
- sed '1d' | \
+ mysql_run_query -N --raw --batch | \
while read -r id pkgname arch; do
pkgname=$(
printf '%s' "${pkgname}" | \
@@ -939,8 +933,7 @@ mysql_repair_binary_packages_without_build_assignment() {
printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \
"$(printf '%s' "${pkgname}" | base64 -w0)"
} | \
- mysql_run_query --raw --batch | \
- sed '1d' | \
+ mysql_run_query -N --raw --batch | \
grep -qvxF '0'; then
pkgbase="${pkgname}"
fi