aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-19 13:21:55 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-22 12:10:13 +0100
commit77fc40a0f843e2488b356d90b64ef436c11c9973 (patch)
tree5b16be71d801eba028b452475f34fe5757979aba /bitbake/lib/bb/fetch2/__init__.py
parentd228f9d938ecde959621d03fdd6c70ea467b5f39 (diff)
downloadopenembedded-core-contrib-77fc40a0f843e2488b356d90b64ef436c11c9973.tar.gz
bitbake: fetch2: Shorten long srcrevs
The long srcrevs are mainly used or the workdir construction as well as the package version. The long entries are hashes generated by the git fetcher and other scms using a similar revision mechanism. We need these to change when the package changes however collisions are unlikely to happen within the domains we care about. The long revisions have generated negative user feedback due to the use in path and file names. This patch therefore truncates the revisions to 10 characters maximum. This should be safe in the contexts where these revisions are used as the chances of spatially close collisions is very low (distant collisions are not a major issue in the way we use these). (Bitbake rev: 43a8319cda7fae37862dae323eeb24cb39ca21b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/__init__.py')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 6443303ca2..376ac9b1e1 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -620,6 +620,8 @@ def get_srcrev(d):
if len(scms) == 1 and len(urldata[scms[0]].names) == 1:
autoinc, rev = urldata[scms[0]].method.sortable_revision(scms[0], urldata[scms[0]], d, urldata[scms[0]].names[0])
+ if len(rev) > 10:
+ rev = rev[:10]
if autoinc:
return "AUTOINC+" + rev
return rev
@@ -636,6 +638,8 @@ def get_srcrev(d):
ud = urldata[scm]
for name in ud.names:
autoinc, rev = ud.method.sortable_revision(scm, ud, d, name)
+ if len(rev) > 10:
+ rev = rev[:10]
if autoinc and not seenautoinc:
rev = "AUTOINC+" + rev
seenautoinc