aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorniko.mauno@vaisala.com <niko.mauno@vaisala.com>2019-11-23 15:43:21 +0200
committerArmin Kuster <akuster808@gmail.com>2019-11-24 11:52:28 -0800
commit81e1ae4657bde1cd843a219f99be4024b8b96f16 (patch)
tree87833e3c05030555448c74de00147831419060cb
parent3eb4c7a0825bd750dfb71fc5ff1e738daf9adcdf (diff)
downloadmeta-openembedded-contrib-81e1ae4657bde1cd843a219f99be4024b8b96f16.tar.gz
meta-openembedded-contrib-81e1ae4657bde1cd843a219f99be4024b8b96f16.tar.bz2
meta-openembedded-contrib-81e1ae4657bde1cd843a219f99be4024b8b96f16.zip
gitpkgv.bbclass: Use --git-dir option
Avoid redundant shell working directory change by resorting to '--git-dir' option for git command instead. Signed-off-by: Niko Mauno <niko.mauno@vaisala.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/classes/gitpkgv.bbclass11
1 files changed, 4 insertions, 7 deletions
diff --git a/meta-oe/classes/gitpkgv.bbclass b/meta-oe/classes/gitpkgv.bbclass
index 2d9680a35c..22609f584f 100644
--- a/meta-oe/classes/gitpkgv.bbclass
+++ b/meta-oe/classes/gitpkgv.bbclass
@@ -87,10 +87,8 @@ def get_git_pkgv(d, use_tags):
if not os.path.exists(rev_file) or os.path.getsize(rev_file)==0:
commits = bb.fetch2.runfetchcmd(
- "cd %(repodir)s && "
- "git rev-list %(rev)s -- 2> /dev/null "
- "| wc -l" % vars,
- d, quiet=True).strip().lstrip('0')
+ "git --git-dir=%(repodir)s rev-list %(rev)s -- 2>/dev/null | wc -l"
+ % vars, d, quiet=True).strip().lstrip('0')
if commits != "":
oe.path.remove(rev_file, recurse=False)
@@ -105,9 +103,8 @@ def get_git_pkgv(d, use_tags):
if use_tags:
try:
output = bb.fetch2.runfetchcmd(
- "cd %(repodir)s && "
- "git describe %(rev)s 2>/dev/null" % vars,
- d, quiet=True).strip()
+ "git --git-dir=%(repodir)s describe %(rev)s 2>/dev/null"
+ % vars, d, quiet=True).strip()
ver = gitpkgv_drop_tag_prefix(output)
except Exception:
ver = "0.0-%s-g%s" % (commits, vars['rev'][:7])