diff options
author | niko.mauno@vaisala.com <niko.mauno@vaisala.com> | 2019-11-19 08:46:42 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-11-19 23:33:03 -0800 |
commit | e2c5249680cc7638b9f9a07fdddc3dca7894ad86 (patch) | |
tree | 29672a0248d9973879dc946496ec67778959458a /meta-oe | |
parent | 6e3ba47f8cf3e89977fe8288ecdbb1c79896272b (diff) | |
download | meta-openembedded-e2c5249680cc7638b9f9a07fdddc3dca7894ad86.tar.gz |
gitpkgv.bbclass: Support also lightweight tags
When checking for commit specific tags during GITPKGVTAG resolution, use
additional '--tags' and '--exact-match' options for 'git describe'
command.
This changes the behaviour so that in case an annotated tag does not
exist for the particular commit, then the latest lightweight
(non-annotated) tag is used instead, in case that commit has at least
one such tag.
Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r-- | meta-oe/classes/gitpkgv.bbclass | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/meta-oe/classes/gitpkgv.bbclass b/meta-oe/classes/gitpkgv.bbclass index 22609f584..ab591bd45 100644 --- a/meta-oe/classes/gitpkgv.bbclass +++ b/meta-oe/classes/gitpkgv.bbclass | |||
@@ -7,8 +7,8 @@ | |||
7 | # NN equals the total number of revs up to SRCREV | 7 | # NN equals the total number of revs up to SRCREV |
8 | # GITHASH is SRCREV's (full) hash | 8 | # GITHASH is SRCREV's (full) hash |
9 | # | 9 | # |
10 | # - GITPKGVTAG which is the output of 'git describe' allowing for | 10 | # - GITPKGVTAG which is the output of 'git describe --tags --exact-match' |
11 | # automatic versioning | 11 | # allowing for automatic versioning |
12 | # | 12 | # |
13 | # gitpkgv.bbclass assumes the git repository has been cloned, and | 13 | # gitpkgv.bbclass assumes the git repository has been cloned, and |
14 | # contains SRCREV. So ${GITPKGV} and ${GITPKGVTAG} should never be | 14 | # contains SRCREV. So ${GITPKGV} and ${GITPKGVTAG} should never be |
@@ -103,7 +103,7 @@ def get_git_pkgv(d, use_tags): | |||
103 | if use_tags: | 103 | if use_tags: |
104 | try: | 104 | try: |
105 | output = bb.fetch2.runfetchcmd( | 105 | output = bb.fetch2.runfetchcmd( |
106 | "git --git-dir=%(repodir)s describe %(rev)s 2>/dev/null" | 106 | "git --git-dir=%(repodir)s describe %(rev)s --tags --exact-match 2>/dev/null" |
107 | % vars, d, quiet=True).strip() | 107 | % vars, d, quiet=True).strip() |
108 | ver = gitpkgv_drop_tag_prefix(output) | 108 | ver = gitpkgv_drop_tag_prefix(output) |
109 | except Exception: | 109 | except Exception: |