From 4df0d6adcaae5382009c356d750e7909a44284f6 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 17 Nov 2010 15:40:51 +0100 Subject: fetch: be more pythonic no functional changes (Bitbake rev: e88834fb7c6821cc29c12d296f2edd51f6eb3746) Signed-off-by: Bernhard Reutner-Fischer Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch/repo.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'bitbake/lib/bb/fetch/repo.py') diff --git a/bitbake/lib/bb/fetch/repo.py b/bitbake/lib/bb/fetch/repo.py index bafdb2a17..e5132a14f 100644 --- a/bitbake/lib/bb/fetch/repo.py +++ b/bitbake/lib/bb/fetch/repo.py @@ -45,24 +45,11 @@ class Repo(Fetch): "master". """ - if "protocol" in ud.parm: - ud.proto = ud.parm["protocol"] - else: - ud.proto = "git" - - if "branch" in ud.parm: - ud.branch = ud.parm["branch"] - else: - ud.branch = "master" - - if "manifest" in ud.parm: - manifest = ud.parm["manifest"] - if manifest.endswith(".xml"): - ud.manifest = manifest - else: - ud.manifest = manifest + ".xml" - else: - ud.manifest = "default.xml" + ud.proto = ud.parm.get('protocol', 'git') + ud.branch = ud.parm.get('branch', 'master') + ud.manifest = ud.parm.get('manifest', 'default.xml') + if not ud.manifest.endswith('.xml'): + ud.manifest += '.xml' ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d) -- cgit v1.2.3