mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-12 05:11:59 +00:00
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>
This commit is contained in:
committed by
Khem Raj
parent
c3cf73c621
commit
6e3ba47f8c
@@ -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:
|
if not os.path.exists(rev_file) or os.path.getsize(rev_file)==0:
|
||||||
commits = bb.fetch2.runfetchcmd(
|
commits = bb.fetch2.runfetchcmd(
|
||||||
"cd %(repodir)s && "
|
"git --git-dir=%(repodir)s rev-list %(rev)s -- 2>/dev/null | wc -l"
|
||||||
"git rev-list %(rev)s -- 2> /dev/null "
|
% vars, d, quiet=True).strip().lstrip('0')
|
||||||
"| wc -l" % vars,
|
|
||||||
d, quiet=True).strip().lstrip('0')
|
|
||||||
|
|
||||||
if commits != "":
|
if commits != "":
|
||||||
oe.path.remove(rev_file, recurse=False)
|
oe.path.remove(rev_file, recurse=False)
|
||||||
@@ -105,9 +103,8 @@ def get_git_pkgv(d, use_tags):
|
|||||||
if use_tags:
|
if use_tags:
|
||||||
try:
|
try:
|
||||||
output = bb.fetch2.runfetchcmd(
|
output = bb.fetch2.runfetchcmd(
|
||||||
"cd %(repodir)s && "
|
"git --git-dir=%(repodir)s describe %(rev)s 2>/dev/null"
|
||||||
"git describe %(rev)s 2>/dev/null" % vars,
|
% vars, d, quiet=True).strip()
|
||||||
d, quiet=True).strip()
|
|
||||||
ver = gitpkgv_drop_tag_prefix(output)
|
ver = gitpkgv_drop_tag_prefix(output)
|
||||||
except Exception:
|
except Exception:
|
||||||
ver = "0.0-%s-g%s" % (commits, vars['rev'][:7])
|
ver = "0.0-%s-g%s" % (commits, vars['rev'][:7])
|
||||||
|
|||||||
Reference in New Issue
Block a user