On Fri, Dec 10, 2010 at 08:06:03AM +0100, Martin Jansa wrote:
> Hi,
> 
> I've just noticed merging few fetcher patches from poky in
> http://git.openembedded.org/cgit.cgi/bitbake/commit/?id=3aaddb8c434d0ea839c0b52de5a56be1be4641dd
> one of them is:
> bitbake/git.py: Make sure different branches can have different revisions 
> without triggering build count increases
> 
> But I don't see anything for conversion from "old" format without branch
> to "new" with branch in the end. So if I understand it right all git
> build numbers will start from 0 and will break upgradeable path unless
> someone bump PE in all those recipes in OE.
> 
> I agree that having branch in that key is good thing, but please advise
> how to migrate peristent database to get upgradeable paths (not even
> talking about switching bitbake version 1.10 and master back and forth.
> 
> BTW: if there is ie _branch prefix then it would be easier to prepare
> sql script updating values from keys without "branch.[^_]*_" to key with
> branch specified for conversion, but as every builder has to convert, it
> would be better to do something like:
> 
> add "def generate_revision_old_key(self, url, ud, d):" with old behavior
> 
> key = self.generate_revision_key(url, ud, d)
> last_rev = pd.getValue("BB_URI_LOCALCOUNT", key + "_rev")
> uselocalcount = bb.data.getVar("BB_LOCALCOUNT_OVERRIDE", d, True) or False
> 
> if last_rev is None
>   oldkey = self.generate_revision_old_key(url, ud, d)
>   last_rev = pd.getValue("BB_URI_LOCALCOUNT", oldkey + "_rev")
> 
> ...
> 
> if count is None:
>   count = pd.getValue("BB_URI_LOCALCOUNT", key + "_count")
>   if count is None:
>     count = pd.getValue("BB_URI_LOCALCOUNT", oldkey + "_count")
> 
> Regards,

That patch was reverted few minutes ago.. so for someone as lucky as I
was to rebuild from scratch in that timeslot with that patch applied,
here is how I've "downgraded" my persistent db to old revision keys:

sqlite3 bb_persist_data.sqlite3 "select * from BB_URI_LOCALCOUNT where key like 
'%master-%';" >> master.sql
check master.sql for false positives (ie if your branch or PN had
master- in it)

create updates (I did it in vim after checking false positives)
:%s/^\(.*\)master-\(.*\)$/UPDATE BB_URI_LOCALCOUNT set key='\1\2' where 
key='\1master-\2';/gc

cat master.sql| sqlite3 bb_persist_data.sqlite3

cd oe/recipes;
git grep 'git://.*branch=' | grep -v branch=master > branch.list
and do the same for other branch names you care about

-- 
Martin 'JaMa' Jansa     jabber: [email protected]
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev

Reply via email to