Patchwork migrate_localcount.bbclass: use PRAUTOINX instead of PN & PV

login
register
mail settings
Submitter Constantin Musca
Date Jan. 28, 2013, 9:01 a.m.
Message ID <1359363680-4588-1-git-send-email-constantinx.musca@intel.com>
Download mbox | patch
Permalink /patch/43487/
State Accepted
Commit ec81b985bb29a8562366f5343171e68a1f9cc4e9
Headers show

Comments

Constantin Musca - Jan. 28, 2013, 9:01 a.m.
- we need to use PRAUTOINX (it covers all cases)
- it addresses bumped PE issues

[YOCTO #3071]

Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
---
 meta/classes/migrate_localcount.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
Martin Jansa - Jan. 28, 2013, 12:56 p.m.
On Mon, Jan 28, 2013 at 11:01:20AM +0200, Constantin Musca wrote:
> - we need to use PRAUTOINX (it covers all cases)
> - it addresses bumped PE issues

Build is still runing, but entries in prserv db look correct now,
thanks!

Cheers,

> 
> [YOCTO #3071]
> 
> Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
> ---
>  meta/classes/migrate_localcount.bbclass | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/meta/classes/migrate_localcount.bbclass b/meta/classes/migrate_localcount.bbclass
> index 59f14e8..3916ad4 100644
> --- a/meta/classes/migrate_localcount.bbclass
> +++ b/meta/classes/migrate_localcount.bbclass
> @@ -18,14 +18,13 @@ python migrate_localcount_handler () {
>          if not revs or not counts:
>              return
>  
> -        srcrev = bb.fetch2.get_srcrev(e.data)
> -        bpv = pv[:pv.find(srcrev)]
> -
>          if len(revs) != len(counts):
>              bb.warn("The number of revs and localcounts don't match in %s" % pn)
>              return
>  
> -        version = 'AUTOINC-%s-%s' % (pn, bpv)
> +        version = e.data.getVar('PRAUTOINX', True)
> +        srcrev = bb.fetch2.get_srcrev(e.data)
> +        base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
>          pkgarch = e.data.getVar('PACKAGE_ARCH', True)
>          value = max(int(count) for count in counts)
>  
> @@ -40,7 +39,7 @@ python migrate_localcount_handler () {
>          flock = bb.utils.lockfile("%s.lock" % df)
>          with open(df, 'a') as fd:
>              fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
> -                    (version, pkgarch, srcrev, str(value)))
> +                    (base_ver, pkgarch, srcrev, str(value)))
>          bb.utils.unlockfile(flock)
>  }
>  
> -- 
> 1.7.11.7
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Martin Jansa - Jan. 28, 2013, 2:35 p.m.
On Mon, Jan 28, 2013 at 01:56:37PM +0100, Martin Jansa wrote:
> On Mon, Jan 28, 2013 at 11:01:20AM +0200, Constantin Musca wrote:
> > - we need to use PRAUTOINX (it covers all cases)
> > - it addresses bumped PE issues
> 
> Build is still runing, but entries in prserv db look correct now,
> thanks!

It's already too late for my local build, but maybe it would be
interesting for people still using OEBasic (instead of default
OEBasicHash) to use PRSERV _only_ as LOCALCOUNT replacement as that was
removed completely.

Now I see all packages are upgraded on target because of extra .0 
in PR.

And it will stay constant .0 with OEBasic if I understood RP's answer
correctly.

"The service works with both OEBasic and OEBasicHash
generators, with the understanding that PR bumps happen when the
checksum changes and the different generator mechanisms change
signatures under different circumstances."

Only manual PE/PV/PR bump will change OEBasic signature, but also use 
different key in PRMAIN_nohist, so again with '.0'.

Cheers,

> 
> Cheers,
> 
> > 
> > [YOCTO #3071]
> > 
> > Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
> > ---
> >  meta/classes/migrate_localcount.bbclass | 9 ++++-----
> >  1 file changed, 4 insertions(+), 5 deletions(-)
> > 
> > diff --git a/meta/classes/migrate_localcount.bbclass b/meta/classes/migrate_localcount.bbclass
> > index 59f14e8..3916ad4 100644
> > --- a/meta/classes/migrate_localcount.bbclass
> > +++ b/meta/classes/migrate_localcount.bbclass
> > @@ -18,14 +18,13 @@ python migrate_localcount_handler () {
> >          if not revs or not counts:
> >              return
> >  
> > -        srcrev = bb.fetch2.get_srcrev(e.data)
> > -        bpv = pv[:pv.find(srcrev)]
> > -
> >          if len(revs) != len(counts):
> >              bb.warn("The number of revs and localcounts don't match in %s" % pn)
> >              return
> >  
> > -        version = 'AUTOINC-%s-%s' % (pn, bpv)
> > +        version = e.data.getVar('PRAUTOINX', True)
> > +        srcrev = bb.fetch2.get_srcrev(e.data)
> > +        base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
> >          pkgarch = e.data.getVar('PACKAGE_ARCH', True)
> >          value = max(int(count) for count in counts)
> >  
> > @@ -40,7 +39,7 @@ python migrate_localcount_handler () {
> >          flock = bb.utils.lockfile("%s.lock" % df)
> >          with open(df, 'a') as fd:
> >              fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
> > -                    (version, pkgarch, srcrev, str(value)))
> > +                    (base_ver, pkgarch, srcrev, str(value)))
> >          bb.utils.unlockfile(flock)
> >  }
> >  
> > -- 
> > 1.7.11.7
> > 
> > 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> -- 
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

Patch

diff --git a/meta/classes/migrate_localcount.bbclass b/meta/classes/migrate_localcount.bbclass
index 59f14e8..3916ad4 100644
--- a/meta/classes/migrate_localcount.bbclass
+++ b/meta/classes/migrate_localcount.bbclass
@@ -18,14 +18,13 @@  python migrate_localcount_handler () {
         if not revs or not counts:
             return
 
-        srcrev = bb.fetch2.get_srcrev(e.data)
-        bpv = pv[:pv.find(srcrev)]
-
         if len(revs) != len(counts):
             bb.warn("The number of revs and localcounts don't match in %s" % pn)
             return
 
-        version = 'AUTOINC-%s-%s' % (pn, bpv)
+        version = e.data.getVar('PRAUTOINX', True)
+        srcrev = bb.fetch2.get_srcrev(e.data)
+        base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
         pkgarch = e.data.getVar('PACKAGE_ARCH', True)
         value = max(int(count) for count in counts)
 
@@ -40,7 +39,7 @@  python migrate_localcount_handler () {
         flock = bb.utils.lockfile("%s.lock" % df)
         with open(df, 'a') as fd:
             fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
-                    (version, pkgarch, srcrev, str(value)))
+                    (base_ver, pkgarch, srcrev, str(value)))
         bb.utils.unlockfile(flock)
 }