Hsin-Yu Chao | 919aec2 | 2018-08-07 15:27:24 +0800 | [diff] [blame] | 1 | # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | |
| 4 | # @ECLASS: libchrome-version.eclass |
| 5 | # @MAINTAINER: |
| 6 | # ChromiumOS Build Team |
| 7 | # @BUGREPORTS: |
| 8 | # Please report bugs via http://crbug.com/new (with label Build) |
| 9 | # @VCSURL: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/master/eclass/@ECLASS@ |
| 10 | # @BLURB: helper eclass for managing libchrome version |
| 11 | # @DESCRIPTION: |
| 12 | # This eclass manages the libchrome version. |
| 13 | |
Qijiang Fan | 1056732 | 2020-06-25 20:01:48 +0900 | [diff] [blame] | 14 | # @FUNCTION: libchrome_ver |
| 15 | # @DESCRIPTION: |
| 16 | # Output current libchrome BASE_VER, from SYSROOT-installed BASE_VER file. |
| 17 | # IS_LIBCHROME or LIBCHROME_SYSROOT can be set. |
| 18 | # If IS_LIBCHROME is set, it read ${S}/BASE_VER instead. |
| 19 | # If LIBCHROME_SYSROOT is set, it read $LIBCHROME_SYSROOT-installed BASE_VER |
| 20 | # file. |
| 21 | libchrome_ver() { |
| 22 | local basever_file="${SYSROOT}/usr/share/libchrome/BASE_VER" |
| 23 | if [[ -n "${IS_LIBCHROME}" ]]; then |
| 24 | basever_file="${S}/BASE_VER" |
| 25 | fi |
| 26 | if [[ -n "${LIBCHROME_SYSROOT}" ]]; then |
| 27 | basever_file="${LIBCHROME_SYSROOT}/usr/share/libchrome/BASE_VER" |
| 28 | fi |
| 29 | cat "${basever_file}" || die "cat ${basever_file} error. Please depends on libchrome if you use it." |
| 30 | } |