From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dan.rpsys.net (dan.rpsys.net [93.97.175.187]) by mail.openembedded.org (Postfix) with ESMTP id 2019D6A8B4 for ; Fri, 7 Jun 2013 17:10:48 +0000 (UTC) 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 r57HFsLv001873 for ; Fri, 7 Jun 2013 18:15:54 +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 vmX2kQaRQNDa for ; Fri, 7 Jun 2013 18:15:54 +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 r57HFoZ0001869 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NOT) for ; Fri, 7 Jun 2013 18:15:52 +0100 Message-ID: <1370625036.6864.50.camel@ted> From: Richard Purdie To: bitbake-devel Date: Fri, 07 Jun 2013 18:10:36 +0100 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Subject: [PATCH] fetch2: Fix AUTOINC handling X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jun 2013 17:10:50 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit AUTOINC was meant to appear once at the start of the version string. The list of names may not be sorted meaning it could get inserted in the middle. This patch simplifies the code and ensures it appears at the start. Include cache version bump to ensure the cache picks up these changes. Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py index eee83b7..fb0f40c 100644 --- a/bitbake/lib/bb/cache.py +++ b/bitbake/lib/bb/cache.py @@ -43,7 +43,7 @@ except ImportError: logger.info("Importing cPickle failed. " "Falling back to a very slow implementation.") -__cache_version__ = "145" +__cache_version__ = "146" def getCacheFile(path, filename, data_hash): return os.path.join(path, filename + "." + data_hash) diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 1988dc7..1365335 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py @@ -638,12 +638,12 @@ def get_srcrev(d): ud = urldata[scm] for name in ud.names: autoinc, rev = ud.method.sortable_revision(scm, ud, d, name) + seenautoinc = seenautoinc or autoinc if len(rev) > 10: rev = rev[:10] - if autoinc and not seenautoinc: - rev = "AUTOINC+" + rev - seenautoinc = True format = format.replace(name, rev) + if seenautoinc: + format = "AUTOINC+" + format return format