diff options
author | Erich Eckner <git@eckner.net> | 2018-02-15 14:57:35 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-02-15 14:57:35 +0100 |
commit | 33322fbda73861befb4b56299a23915b7d72bbe5 (patch) | |
tree | 0f65a3e08cbbeec2930d46a93b3a24d7b77a8346 /bin | |
parent | b89e738fb2d34d1efa48f20a8cb13644b371378e (diff) | |
download | builder-33322fbda73861befb4b56299a23915b7d72bbe5.tar.xz |
bin/mysql-functions: separate checkdependencies from makedependencies
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bootstrap-mysql | 2 | ||||
-rwxr-xr-x | bin/mysql-functions | 41 |
2 files changed, 32 insertions, 11 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index c965319..322e0a1 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -458,7 +458,7 @@ fi printf 'INSERT IGNORE INTO `dependency_types` (`name`,`relevant_for_building`,`relevant_for_binary_packages`) VALUES' { printf '\n ("%s",%s,%s),' \ - 'build' '1' '0' \ + 'make' '1' '0' \ 'check' '0' '0' \ 'link' '0' '1' \ 'run' '1' '1' diff --git a/bin/mysql-functions b/bin/mysql-functions index 78728c0..0a8e3d3 100755 --- a/bin/mysql-functions +++ b/bin/mysql-functions @@ -407,8 +407,14 @@ mysql_generate_package_metadata() { sed 's/[<>=].*$//' | \ base64_encode_each ) - builddepends=$( - grep '^\(checkdepends\|makedepends\) = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ + makedepends=$( + grep '^makedepends = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ + cut -d' ' -f3 | \ + sed 's/[<>=].*$//' | \ + base64_encode_each + ) + checkdepends=$( + grep '^checkdepends = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ cut -d' ' -f3 | \ sed 's/[<>=].*$//' | \ base64_encode_each @@ -514,7 +520,8 @@ mysql_generate_package_metadata() { { printf 'CREATE TEMPORARY TABLE `%s` (`name` VARCHAR(64));\n' \ 'provides' \ - 'builddepends' \ + 'makedepends' \ + 'checkdepends' \ 'rundepends' printf 'INSERT INTO `provides` VALUES\n' @@ -538,8 +545,19 @@ mysql_generate_package_metadata() { ' printf ' ("base");\n' - printf 'INSERT INTO `builddepends` VALUES\n' - echo "${builddepends}" | \ + echo "${checkdepends}" | \ + sort -u | \ + grep -vxF '' | \ + sed ' + 1 s/^/INSERT INTO `checkdepends` VALUES \n/ + s|^| (from_base64("| + s|$|")),| + $ s/,$/;/ + ' + printf ' ("base-devel");\n' + + printf 'INSERT INTO `makedepends` VALUES\n' + echo "${makedepends}" | \ sort -u | \ grep -vxF '' | \ sed ' @@ -551,17 +569,18 @@ mysql_generate_package_metadata() { printf 'INSERT IGNORE INTO `install_targets` (`name`)' printf ' SELECT (`name`) FROM `%s` UNION' \ 'provides' \ - 'builddepends' \ + 'makedepends' \ + 'checkdepends' \ 'rundepends' | \ sed 's| UNION$|;\n|' - for link in 'provides' 'builddepends' 'rundepends'; do + for link in 'provides' 'makedepends' 'checkdepends' 'rundepends'; do case "${link}" in 'provides') printf 'INSERT IGNORE INTO `install_target_providers` (`package`,`install_target`) SELECT' printf ' `binary_packages`.`id`,`install_targets`.`id` FROM' ;; - 'builddepends'|'rundepends') + 'makedepends'|'checkdepends'|'rundepends') printf 'INSERT IGNORE INTO `dependencies` (`dependent`,`depending_on`,`dependency_type`) SELECT' printf ' `binary_packages`.`id`,`install_targets`.`id`,`dependency_types`.`id` FROM' printf ' `dependency_types` JOIN' @@ -574,7 +593,8 @@ mysql_generate_package_metadata() { printf ' JOIN `%s`' "${link}" printf ' ON `%s`.`name` = `install_targets`.`name`' "${link}" printf ' WHERE' - if [ "${link}" = 'builddepends' ] || \ + if [ "${link}" = 'makedepends' ] || \ + [ "${link}" = 'checkdepends' ] || \ [ "${link}" = 'rundepends' ]; then printf ' `dependency_types`.`name` = "%s" AND' \ "${link%depends}" @@ -598,7 +618,8 @@ mysql_generate_package_metadata() { printf 'DROP TABLE `%s`;\n' \ 'provides' \ - 'builddepends' \ + 'makedepends' \ + 'checkdepends' \ 'rundepends' } >> \ "${temp_dir}/add-install-targets-command" |