From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pd0-f176.google.com ([209.85.192.176]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1Ue35C-00007h-7T for bitbake-devel@lists.openembedded.org; Sun, 19 May 2013 14:51:45 +0200 Received: by mail-pd0-f176.google.com with SMTP id r11so1314157pdi.35 for ; Sun, 19 May 2013 05:33:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=MYqglPog0ib5D6UDuYEPOeYsvSA09xAGaJAy4HzEQhE=; b=yzKlogT8Nuqr2CSlGLCvil7HDfKVGL/ewWsT/SUmm2bR7ZnFi2kl9Fm0e0nvXdr6+G a74SpNLRofLX/m0SWtjFdEmbgETzWN8ujqkhiLH4hp6eUqyBi//RYODGN0uspV+lNbKw 6bEOsOpRJgmq9v9HaJjFYTeSBBXLYd3t/7pFBLnSewv77Sp13NgMty1P5IO8DK8sTZBw 9UL5H/BzWJSpL1UjPkpKutDEnif0or4VP6t/KSMvEnh/qa8UiatZ2mB+cUPEUclfDMcK dtyI4OBw3advlInF/NSw0+h3d97ydTNpMh4/TN1KhJ/INjDOrIOiZFFxp77bIJFkXFxh ypYg== X-Received: by 10.68.219.70 with SMTP id pm6mr52074527pbc.154.1368966786872; Sun, 19 May 2013 05:33:06 -0700 (PDT) Received: from localhost (ip-62-24-80-145.net.upcbroadband.cz. [62.24.80.145]) by mx.google.com with ESMTPSA id qh4sm21052843pac.8.2013.05.19.05.33.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 19 May 2013 05:33:05 -0700 (PDT) Date: Sun, 19 May 2013 14:32:55 +0200 From: Martin Jansa To: Richard Purdie Message-ID: <20130519123255.GG3196@jama> References: <1368958915.32727.96.camel@ted> MIME-Version: 1.0 In-Reply-To: <1368958915.32727.96.camel@ted> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Ashfield, Bruce" , "Hart, Darren" , Koen Kooi , bitbake-devel Subject: Re: [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 12:51:46 -0000 X-Groupsio-MsgNum: 3460 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="B8ONY/mu/bqBak9m" Content-Disposition: inline --B8ONY/mu/bqBak9m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 19, 2013 at 01:21:55PM +0300, Richard Purdie wrote: > 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 fet= cher > and other scms using a similar revision mechanism. >=20 > 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. >=20 > This patch therefore truncates the revisions to 10 characters maximum. What about 7 characters like git log --oneline is using? SRCREVs in recipes are still supposed to be 40 characters for git, right? Because otherwise this part needs to be changed too: lib/bb/fetch2/git.py # Ensure anything that doesn't look like a sha256 # checksum/revision is translated into one if not ud.revisions[name] or len(ud.revisions[name]) !=3D 40 or= (False in [c in "abcdef0123456789" for c in ud.revisions[name]]): Cheers, > 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). >=20 > 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. >=20 > 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): > =20 > if len(scms) =3D=3D 1 and len(urldata[scms[0]].names) =3D=3D 1: > autoinc, rev =3D urldata[scms[0]].method.sortable_revision(scms[= 0], urldata[scms[0]], d, urldata[scms[0]].names[0]) > + if len(rev) > 10: > + rev =3D rev[:10] > if autoinc: > return "AUTOINC+" + rev > return rev > @@ -633,6 +635,8 @@ def get_srcrev(d): > ud =3D urldata[scm] > for name in ud.names: > autoinc, rev =3D ud.method.sortable_revision(scm, ud, d, nam= e) > + if len(rev) > 10: > + rev =3D rev[:10] > if autoinc and not seenautoinc: > rev =3D "AUTOINC+" + rev > seenautoinc >=20 >=20 --=20 Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com --B8ONY/mu/bqBak9m Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iEYEARECAAYFAlGYxncACgkQN1Ujt2V2gBy/XwCdFWDGOGuvl6ZIif5nfqVJu0Jp qAQAnRPrb0imr/zKurML9Beb0SVwehFB =yLWP -----END PGP SIGNATURE----- --B8ONY/mu/bqBak9m--