[oe-commits] [meta-openembedded] 04/16: gitpkgv.bbclass: Use --git-dir option
git at git.openembedded.org
git at git.openembedded.org
Sun Dec 8 16:15:05 UTC 2019
This is an automated email from the git hooks/post-receive script.
armin_kuster pushed a commit to branch zeus-next
in repository meta-openembedded.
commit 81e1ae4657bde1cd843a219f99be4024b8b96f16
Author: niko.mauno at vaisala.com <niko.mauno at vaisala.com>
AuthorDate: Sat Nov 23 15:43:21 2019 +0200
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 at vaisala.com>
Signed-off-by: Khem Raj <raj.khem at gmail.com>
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
meta-oe/classes/gitpkgv.bbclass | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/meta-oe/classes/gitpkgv.bbclass b/meta-oe/classes/gitpkgv.bbclass
index 2d9680a..22609f5 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])
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list