From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dan.rpsys.net ([93.97.175.187]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1Ue12a-0008Hp-Qd for bitbake-devel@lists.openembedded.org; Sun, 19 May 2013 12:41:21 +0200 Received: from localhost (dan.rpsys.net [127.0.0.1]) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r4JAPT51032525; Sun, 19 May 2013 11:25:29 +0100 X-Virus-Scanned: Debian amavisd-new at dan.rpsys.net Received: from dan.rpsys.net ([127.0.0.1]) by localhost (dan.rpsys.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id PH1OOvVBwC9H; Sun, 19 May 2013 11:25:29 +0100 (BST) Received: from [192.168.3.10] (rpvlan0 [192.168.3.10]) (authenticated bits=0) by dan.rpsys.net (8.14.4/8.14.4/Debian-2.1ubuntu1) with ESMTP id r4JAPOSk032521 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT); Sun, 19 May 2013 11:25:25 +0100 Message-ID: <1368958915.32727.96.camel@ted> From: Richard Purdie To: bitbake-devel Date: Sun, 19 May 2013 13:21:55 +0300 X-Mailer: Evolution 3.6.2-0ubuntu0.1 Mime-Version: 1.0 Cc: "Ashfield, Bruce" , "Hart, Darren" , Koen Kooi , Martin Jansa Subject: [PATCH] fetch2: Shorten long srcrevs X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 10:41:31 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit 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). Signed-off-by: Richard Purdie --- CC'd various people who I believe might have feelings about this. The patch depends on the sortable_revisions patch I just sent out. diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index f8f8244..402329d 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -617,6 +617,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 @@ -633,6 +635,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