diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-01-03 21:01:02 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2021-01-03 21:01:02 (EST) |
commit | 6a65dc27b229fc99b55a5b7e68e155bf261de9f1 (patch) | |
tree | 063a594f7bb63f88b74a0cb4f002dfdd0b5c57f7 | |
parent | ceca66e390d6ff479721485e3160e913e97761c1 (diff) |
package_get_name_and_version(): New function
-rw-r--r-- | src/package.sh | 5 | ||||
-rw-r--r-- | src/package/2.sh | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/package.sh b/src/package.sh index 34ca81d..f869eef 100644 --- a/src/package.sh +++ b/src/package.sh @@ -45,6 +45,11 @@ package_init() return 0 } +package_get_name_and_version() +{ + "package_${_package_format}_get_name_and_version" +} + package_get_build_deps() { local arch="${1}" diff --git a/src/package/2.sh b/src/package/2.sh index 2a856d3..18e5a85 100644 --- a/src/package/2.sh +++ b/src/package/2.sh @@ -20,6 +20,15 @@ _package_2_build_deps= +_package_2_get_name_and_version() +{ + # The first line is all we need to parse. + sed '1{ s/^\([^ ][^ ]*\) (\([^)][^)]*\)).*$/\1 \2/; q; };' \ + "${package_dir}/changelog" + + return 0 +} + _package_2_build_deps_field_cb() { local name="${1}" |