aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/metadata_scm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-11 17:33:43 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-07-19 10:17:30 +0100
commit604d46c686d06d62d5a07b9c7f4fa170f99307d8 (patch)
tree67cdf024737b2248d5ea5d01ca001249f06a8792 /meta/classes/metadata_scm.bbclass
parent28715eff6dff3415b1d7b0be8cbb465c417e307f (diff)
downloadopenembedded-core-contrib-604d46c686d06d62d5a07b9c7f4fa170f99307d8.tar.gz
Convert tab indentation in python functions into four-space
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r--meta/classes/metadata_scm.bbclass102
1 files changed, 51 insertions, 51 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 62650be675b..502d400cbb6 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -2,76 +2,76 @@ METADATA_BRANCH ?= "${@base_detect_branch(d)}"
METADATA_REVISION ?= "${@base_detect_revision(d)}"
def base_detect_revision(d):
- path = base_get_scmbasepath(d)
+ path = base_get_scmbasepath(d)
- scms = [base_get_metadata_git_revision, \
- base_get_metadata_svn_revision]
+ scms = [base_get_metadata_git_revision, \
+ base_get_metadata_svn_revision]
- for scm in scms:
- rev = scm(path, d)
- if rev <> "<unknown>":
- return rev
+ for scm in scms:
+ rev = scm(path, d)
+ if rev <> "<unknown>":
+ return rev
- return "<unknown>"
+ return "<unknown>"
def base_detect_branch(d):
- path = base_get_scmbasepath(d)
+ path = base_get_scmbasepath(d)
- scms = [base_get_metadata_git_branch]
+ scms = [base_get_metadata_git_branch]
- for scm in scms:
- rev = scm(path, d)
- if rev <> "<unknown>":
- return rev.strip()
+ for scm in scms:
+ rev = scm(path, d)
+ if rev <> "<unknown>":
+ return rev.strip()
- return "<unknown>"
+ return "<unknown>"
def base_get_scmbasepath(d):
- return d.getVar( 'COREBASE', True)
+ return d.getVar( 'COREBASE', True)
def base_get_metadata_monotone_branch(path, d):
- monotone_branch = "<unknown>"
- try:
- monotone_branch = file( "%s/_MTN/options" % path ).read().strip()
- if monotone_branch.startswith( "database" ):
- monotone_branch_words = monotone_branch.split()
- monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
- except:
- pass
- return monotone_branch
+ monotone_branch = "<unknown>"
+ try:
+ monotone_branch = file( "%s/_MTN/options" % path ).read().strip()
+ if monotone_branch.startswith( "database" ):
+ monotone_branch_words = monotone_branch.split()
+ monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
+ except:
+ pass
+ return monotone_branch
def base_get_metadata_monotone_revision(path, d):
- monotone_revision = "<unknown>"
- try:
- monotone_revision = file( "%s/_MTN/revision" % path ).read().strip()
- if monotone_revision.startswith( "format_version" ):
- monotone_revision_words = monotone_revision.split()
- monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
- except IOError:
- pass
- return monotone_revision
+ monotone_revision = "<unknown>"
+ try:
+ monotone_revision = file( "%s/_MTN/revision" % path ).read().strip()
+ if monotone_revision.startswith( "format_version" ):
+ monotone_revision_words = monotone_revision.split()
+ monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
+ except IOError:
+ pass
+ return monotone_revision
def base_get_metadata_svn_revision(path, d):
- revision = "<unknown>"
- try:
- revision = file( "%s/.svn/entries" % path ).readlines()[3].strip()
- except IOError:
- pass
- return revision
+ revision = "<unknown>"
+ try:
+ revision = file( "%s/.svn/entries" % path ).readlines()[3].strip()
+ except IOError:
+ pass
+ return revision
def base_get_metadata_git_branch(path, d):
- branch = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read()
+ branch = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read()
- if len(branch) != 0:
- return branch
- return "<unknown>"
+ if len(branch) != 0:
+ return branch
+ return "<unknown>"
def base_get_metadata_git_revision(path, d):
- f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path)
- data = f.read()
- if f.close() is None:
- rev = data.split(" ")[0]
- if len(rev) != 0:
- return rev
- return "<unknown>"
+ f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path)
+ data = f.read()
+ if f.close() is None:
+ rev = data.split(" ")[0]
+ if len(rev) != 0:
+ return rev
+ return "<unknown>"