index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-07-15 14:38:28 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-07-15 14:38:28 +0200 |
commit | 5201163ec2b6dacd904bf3c994b2aaf7bef41a51 (patch) | |
tree | fd37139f471d178fdc6caea3f71f1114bfc562c0 /lib | |
parent | 2bbdac8e051f2e55d664623e6a67361bc39aeb65 (diff) |
-rwxr-xr-x | lib/common-functions | 39 |
diff --git a/lib/common-functions b/lib/common-functions index 421fe50..f2f1243 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -1045,3 +1045,42 @@ update_blocked_packages_count() { mysql_run_query 'unimportant' ) } + +# extract_dependencies_from_package $pkgfile $depfile +# extract make-, run- and check-depends from $pkgfile into $depfile +# format: deptype install_target version_relation epoch version +extract_dependencies_from_package() { + mysql_load_min_and_max_versions + { + bsdtar -Oxf "$1" '.PKGINFO' \ + | sed ' + s/^checkdepend = /check / + t + s/^depend = /run / + t + s/^makedepend = /make / + t + d + ' \ + | sed ' + s/\(=\|[<>]=\?\)\([^-]\+\)\(-[^-]\+\)\?$/ \1 \2/ + t + s/$/ >= '"${min_version}"'/ + ' \ + | sed ' + s/:\(\S\+\)$/ \1/ + t + s/ \(\S\+\)$/ 0 \1/ + ' + # inject base & base-devel + printf ' >= %s\n' \ + "${min_version}" \ + | tr ':' ' ' \ + | sed ' + s/^.*$/run base\0\nmake base-devel\0/ + ' + } \ + | tr '[:upper:]' '[:lower:]' \ + | sort -u \ + > "$2" +} |