From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id A5CADE00D8F; Fri, 17 Jun 2016 04:19:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no * trust * [157.55.234.145 listed in list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from emea01-db3-obe.outbound.protection.outlook.com (mail-db3on0145.outbound.protection.outlook.com [157.55.234.145]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id F0CA9E00A6D for ; Fri, 17 Jun 2016 04:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tecniplastgroup.onmicrosoft.com; s=selector1-Tecniplast-it; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wMfNd0N5cxyEs6/DUUvx397lWKYZAajUk2cKA244vZI=; b=DJdySUNILQcx263loHJl0OMVIzbzo+Wbg+b7DRO6yST/aQXL694W7pRwZOegXexOeKeGHWeWFykOKRVScS7693suVvNlgl6ZBzJp9Fgu0yYg8sA+2UE4xzkL4KBoq5vZgHX5EELUCBrr9S9R5zwOMXsyWLkSs2BFWCCHb8wzneU= Received: from AM2PR07MB0594.eurprd07.prod.outlook.com (10.160.33.16) by AM2PR07MB0593.eurprd07.prod.outlook.com (10.160.33.156) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 11:03:38 +0000 Received: from AM2PR07MB0594.eurprd07.prod.outlook.com ([10.160.33.16]) by AM2PR07MB0594.eurprd07.prod.outlook.com ([10.160.33.16]) with mapi id 15.01.0517.014; Fri, 17 Jun 2016 11:03:38 +0000 From: Marco Garzola To: Christopher Larson Thread-Topic: [yocto] Dynamic PV version in recipe Thread-Index: AQHRx+D0Y22Q2tx2UEuJqdtW/wr225/sgS0AgAADrcuAAPnsyIAAACy0 Date: Fri, 17 Jun 2016 11:03:37 +0000 Message-ID: References: , , , In-Reply-To: Accept-Language: it-IT, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=marco.garzola@tecniplast.it; x-originating-ip: [25.160.207.4] x-ms-office365-filtering-correlation-id: 0df38e69-bfca-4e34-8d57-08d3969f08d9 x-microsoft-exchange-diagnostics: 1; AM2PR07MB0593; 6:J5HoZV76uSQUtV347TCUlLJBHBUMkiQIJsubzLdu8yafEH7r84a/3G6RaDzD8DSQa623ZUtVLEFGvpchuVuQWY7abRU2euiBG4GFiE+1e4sV0MfR63vwMrznn3V5ewjseWHTzmldUcTNzaJFzsArsU86PuaxDxsyVFY97Hs5mgZwGPQ0v+yHnjzUAnqqaNyfDwz8QOSlupIcm3c0pCj+oaNAKrJpVUk0CFmEBDdQMVquR/km7Aiqux3oZ7y9w+yvS43ixOtEvseV7Gcpel/9wwy0VbXzIziXhGJVH9j8fYg=; 5:UFwt20sK8gE2xoSshjUk3BO8YBmxpZWgU1z86emeuc3TpbOJ5Y6NMq5Rl9QQfVcGpnB6f+EOwpqPbHUcsIeY7XLlTgrPwRfF3p6U0ahXqckeuewA586iije8meXn1PMLrgcVMd8C/bK8Swrv/GvfvQ==; 24:hLm7dNrsiUz+myrj3nczPyvB3ikuUeW9MnM8+qacs2Tt413bKvtVtaphvBciyf6wOJWiUTn2BDL1EvyI5V5TdY4029TlQbJ/Wz3O3VTfJ6c=; 7:2tUzcOrJ7cRTjCvbk6OclXWrdZ3mm8eHPwvB6PdS37zQeMhrapLkXvEuu8u5IfK3wh7nDC8GIV2bJgYBALmGyaq0WrTm2tsSPBCDntaj3wovZTrxM7W/Ouu1XGrq9dkkaISfnKhaBY2iy6hdmPGoxQDBVdcoG1XylVNKIr63F05fc/WjrYoWxkwWoNIFMpXGQnVq9c0BEX4ndapq1AIudA== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AM2PR07MB0593; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:AM2PR07MB0593; BCL:0; PCL:0; RULEID:; SRVR:AM2PR07MB0593; x-forefront-prvs: 09760A0505 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(7916002)(24454002)(189002)(199003)(51884002)(377454003)(8936002)(74482002)(33656002)(5008740100001)(97736004)(5003600100002)(19580395003)(8676002)(106116001)(105586002)(19627405001)(92566002)(81156014)(106356001)(10400500002)(68736007)(74316001)(3280700002)(3660700001)(2906002)(110136002)(19580405001)(9686002)(4326007)(81166006)(189998001)(5002640100001)(76576001)(87936001)(5004730100002)(586003)(11100500001)(6116002)(102836003)(122556002)(86362001)(2900100001)(76176999)(50986999)(101416001)(16236675004)(54356999)(93886004)(2950100001)(66066001)(77096005)(3846002)(19625215002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM2PR07MB0593; H:AM2PR07MB0594.eurprd07.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:3; A:1; CAT:NONE; LANG:en; CAT:NONE; received-spf: None (protection.outlook.com: tecniplast.it does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Tecniplast.it X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2016 11:03:37.9771 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 1a6dc2a1-fc45-40bf-915c-346e96a2837b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR07MB0593 Cc: "yocto@yoctoproject.org" Subject: Re: Dynamic PV version in recipe X-BeenThere: yocto@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Discussion of all things Yocto Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2016 11:19:54 -0000 Content-Language: it-IT Content-Type: multipart/alternative; boundary="_000_AM2PR07MB0594FF1FD297059DE5E3986EF6570AM2PR07MB0594eurp_" --_000_AM2PR07MB0594FF1FD297059DE5E3986EF6570AM2PR07MB0594eurp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello , sorry for previous mail. I tried with python do_package_prepend() { d.setVar('PKGV', d.getVar("JENKINS_VERSION", True)) } and in do_compile : { .... VERSION=3D get from bash parsing. "${@d.setVar("JENKINS_VERSION","$VERSION"}" } but doesn't work... it only work if i put a static string in version. any help? thanks ________________________________ Da: Marco Garzola Inviato: venerd=EC 17 giugno 2016 12.59.32 A: Christopher Larson Cc: yocto@yoctoproject.org Oggetto: Re: [yocto] Dynamic PV version in recipe hello again, I tried adding : python do_package_prepend() { d.setVar('PKGV', d.getVar("JENKINS_VERSION", True)) print d.getVar('PKGV',T= rue) ________________________________ Da: yocto-bounces@yoctoproject.org per con= to di Marco Garzola Inviato: gioved=EC 16 giugno 2016 22.11.25 A: Christopher Larson Cc: yocto@yoctoproject.org Oggetto: Re: [yocto] Dynamic PV version in recipe Hi Christopher, PKGV seems very interesting to me. is there out there any example to follow= ? if I add something like that at the end of do_compile task should it work? do_compile(){ #..... do stuff and get in myVersion the revision {@setVar("PKGV","${myVersion}")} } Thanks . Marco ________________________________ Da: kergoth@gmail.com per conto di Christopher Larson <= clarson@kergoth.com> Inviato: gioved=EC 16 giugno 2016 21.51.26 A: Marco Garzola Cc: yocto@yoctoproject.org Oggetto: Re: [yocto] Dynamic PV version in recipe On Thu, Jun 16, 2016 at 8:11 AM, Marco Garzola > wrote: I got a problem, maybe someone could help me.I have a recipe that takes fro= m a jenkins server via json API a binary file with a version that i know on= ly after do_compile task. the question is : is there any way to tell bitbak= e that $PV should change dynamically , maybe in do_install task ? My goal = is to create the package with the revision read from jenkins. PV has to be set at parse time, up front, so bitbake can use it in stamps t= o help determine when tasks need to be run, as well as including it in WORK= DIR and whatnot. If all you want is to change the version in the emitted binary packages, yo= u can dynamically set PKGV, i.e. add a prefunc before do_package which read= s the PKGV. Of course, making sure it re-runs the appropriate tasks when th= at value changes is rather less trivial, since bitbake generates signatures= /checksums at parse time. Alternatively, would it be possible to contact the server via the json API = at parse time as long as BB_NO_NETWORK isn't set? Of course, unless there's= a way to support the BB_NO_NETWORK case, that would be problematic as well= . -- Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics --_000_AM2PR07MB0594FF1FD297059DE5E3986EF6570AM2PR07MB0594eurp_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hello , sorry for previous mail.


I tried with

python do_package_prepend() {

  d.setVar('PKGV', d.getVar("JENKINS_VERSION", True= ))

}


and in do_compile :


{

  ....

  VERSION=3D get from bash parsing.

  "${@d.setVar("JENKINS_VERSION","$VERSIO= N"}"


}



but doesn't work... it only work if  i put a static string in versi= on.


any help?


thanks



Da: Marco Garzola
Inviato: venerd=EC 17 giugno 2016 12.59.32
A: Christopher Larson
Cc: yocto@yoctoproject.org
Oggetto: Re: [yocto] Dynamic PV version in recipe
 

hello again,


I tried adding :



python do_package_prepend() {

d.setVar('PKGV', d.getVar("JENKINS_VERSION", True)) prin= t d.getVar('PKGV',True)


Da: yocto-bounces@yoctoproj= ect.org <yocto-bounces@yoctoproject.org> per conto di Marco Garzola &= lt;marco.garzola@tecniplast.it>
Inviato: gioved=EC 16 giugno 2016 22.11.25
A: Christopher Larson
Cc: yocto@yoctoproject.org
Oggetto: Re: [yocto] Dynamic PV version in recipe
 

Hi Chris= topher,

PKGV seems very interesting to me. is there out there any example= to follow ?

if I add something like that at the end of do_compile task should it w= ork?

do_compile(){
#..... do stuff and get in myVersion the revision 

{@setVar("PKGV","${myVersion}")}

}


Thanks .

Marco

Da: kergoth@gmail.com <k= ergoth@gmail.com> per conto di Christopher Larson <clarson@kergoth.co= m>
Inviato: gioved=EC 16 giugno 2016 21.51.26
A: Marco Garzola
Cc: yocto@yoctoproject.org
Oggetto: Re: [yocto] Dynamic PV version in recipe
 
On Thu, Jun 16, 2016 at 8:11 AM, Marco Garzola <= span dir=3D"ltr"> <marco.= garzola@tecniplast.it> wrote:
I got a problem, maybe someone could help me.I have a recipe that takes fro= m a jenkins server via json API a binary file with a version that i know on= ly after do_compile task. the question is : is there any way to tell bitbak= e that $PV should change dynamically  , maybe in do_install task ? My goal is  to create the package with&n= bsp; the revision read from jenkins.

PV has to be set at parse time, up front, so bitbake can use it in sta= mps to help determine when tasks need to be run, as well as including it in= WORKDIR and whatnot.

If all you want is to change the version in the emitted binary package= s, you can dynamically set PKGV, i.e. add a prefunc before do_package which= reads the PKGV. Of course, making sure it re-runs the appropriate tasks wh= en that value changes is rather less trivial, since bitbake generates signatures/checksums at parse time.<= /div>

Alternatively, would it be possible to contact the server via the json= API at parse time as long as BB_NO_NETWORK isn't set? Of course, unless th= ere's a way to support the BB_NO_NETWORK case, that would be problematic as= well.
--
Christoph= er Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
--_000_AM2PR07MB0594FF1FD297059DE5E3986EF6570AM2PR07MB0594eurp_--