From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lpp01m010-f47.google.com ([209.85.215.47]) by linuxtogo.org with esmtp (Exim 4.72) (envelope-from ) id 1RcQHC-0006rp-43 for openembedded-core@lists.openembedded.org; Mon, 19 Dec 2011 00:36:18 +0100 Received: by lami14 with SMTP id i14so1976899lam.6 for ; Sun, 18 Dec 2011 15:29:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WDEmhQE43S5sT6Gd9hVD8hOrJmE2ZxZmA068NWIueP8=; b=C6846eXbV7OtKbflpQ7oQJuPHc3gsKgNeKqb2iQ+9lLfIBqsgXrpQb9pAh7P0HBwxe Lt00RCrUr417nURFXSnbk54KXTuCx33GWo0DGI8elCM252C+Kc2FMWiozzh3n61ZZQDH PvZUK1mV4pYdEX9CWFKx93i0JxlbVc9PqenWs= MIME-Version: 1.0 Received: by 10.152.104.103 with SMTP id gd7mr14363852lab.34.1324250955655; Sun, 18 Dec 2011 15:29:15 -0800 (PST) Received: by 10.152.36.198 with HTTP; Sun, 18 Dec 2011 15:29:15 -0800 (PST) In-Reply-To: <1324237652-15618-2-git-send-email-dbaryshkov@gmail.com> References: <1324237652-15618-1-git-send-email-dbaryshkov@gmail.com> <1324237652-15618-2-git-send-email-dbaryshkov@gmail.com> Date: Sun, 18 Dec 2011 15:29:15 -0800 Message-ID: From: Khem Raj To: Patches and discussions about the oe-core layer Subject: Re: [PATCH 2/5] Move check that all installed files are shipped into insane.bbclass X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: Patches and discussions about the oe-core layer List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 23:36:18 -0000 Content-Type: multipart/alternative; boundary=f46d04088e85ce2a9b04b4663342 --f46d04088e85ce2a9b04b4663342 Content-Type: text/plain; charset=UTF-8 On Sunday, December 18, 2011, Dmitry Eremin-Solenikov wrote: > Checking that all installed files are shipped is in reality a QA check. > It would benefit from mechanisms like ERROR_QA/WARNING_QA. So move it > into insane.bbclass. If some of the files are installed but should not > be shipped for some reasons, one can add them to the variable > IGNORE_UNSHIPPED_FILES. > This needs to be documented somewhere too and may be added to sample.conf.extended > Signed-off-by: Dmitry Eremin-Solenikov > --- > meta/classes/insane.bbclass | 50 ++++++++++++++++++++++++++++++++++++++++- > meta/classes/package.bbclass | 15 ------------ > 2 files changed, 48 insertions(+), 17 deletions(-) > > diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass > index 5726e69..41b815c 100644 > --- a/meta/classes/insane.bbclass > +++ b/meta/classes/insane.bbclass > @@ -100,7 +100,7 @@ def package_qa_get_machine_dict(): > > > # Currently not being used by default "desktop" > -WARN_QA ?= "ldflags useless-rpaths rpaths" > +WARN_QA ?= "ldflags useless-rpaths rpaths unshipped" > ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms" > > def package_qa_clean_path(path,d): > @@ -485,6 +485,49 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d): > > return sane > > +IGNORE_UNSHIPPED_FILES ??= "" > + > +def packages_qa_unshipped_files(d): > + warn = (d.getVar('WARN_QA', True) or "").split() > + err = (d.getVar('ERROR_QA', True) or "").split() > + if not "unshipped" in warn + err: > + return True > + > + seen = d.getVar('IGNORE_UNSHIPPED_FILES', True).split() > + unshipped = [] > + dvar = d.getVar('PKGD', True) > + destvar = d.getVar('PKGDEST', True) > + packages = d.getVar('PACKAGES', True).split() > + for p in packages: > + pdir = os.path.join(destvar, p) > + for root, dirs, files in os.walk(pdir): > + dir = root[len(pdir):] > + if not dir: > + dir = os.sep > + for f in (files + dirs): > + path = os.path.join(dir, f) > + if path not in seen > + seen.append(path) > + > + for root, dirs, files in os.walk(dvar): > + dir = root[len(dvar):] > + if not dir: > + dir = os.sep > + for f in (files + dirs): > + path = os.path.join(dir, f) > + if path not in seen: > + unshipped.append(path) > + > + pn = d.getVar('PN', True) > + > + if unshipped == []: > + return True > + > + ret = package_qa_handle_error("unshipped", "For recipe %s, the following files/directories were installed but not shipped in any package:" % pn, d) > + for f in unshipped: > + package_qa_handle_error("unshipped", f, d) > + return ret > + > # The PACKAGE FUNC to scan each package > python do_package_qa () { > bb.note("DO PACKAGE QA") > @@ -522,6 +565,7 @@ python do_package_qa () { > g = globals() > walk_sane = True > rdepends_sane = True > + shipped_sane = True > for package in packages.split(): > skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split() > if skip: > @@ -546,8 +590,10 @@ python do_package_qa () { > if not package_qa_check_rdepends(package, pkgdest, skip, d): > rdepends_sane = False > > + if not packages_qa_unshipped_files(d): > + shipped_sane = False > > - if not walk_sane or not rdepends_sane: > + if not walk_sane or not rdepends_sane or not shipped_sane: > bb.fatal("QA run found fatal errors. Please consider fixing them.") > bb.note("DONE with PACKAGE QA") > } > diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass > index 39c1d4b..fbea9c6 100644 > --- a/meta/classes/package.bbclass > +++ b/meta/classes/package.bbclass > @@ -957,21 +957,6 @@ python populate_packages () { > del localdata > os.chdir(workdir) > > - unshipped = [] > - for root, dirs, files in os.walk(dvar): > - dir = root[len(dvar):] > - if not dir: > - dir = os.sep > - for f in (files + dirs): > - path = os.path.join(dir, f) > - if ('.' + path) not in seen: > - unshipped.append(path) > - > - if unshipped != []: > - bb.warn("For recipe %s, the following files/directories were installed but not shipped in any package:" % pn) > - for f in unshipped: > - bb.warn(" " + f) > - > bb.build.exec_func("package_name_hook", d) > > for pkg in package_list: > -- > 1.7.7.3 > > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core > --f46d04088e85ce2a9b04b4663342 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Sunday, December 18, 2011, Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> wrote:
>= ; Checking that all installed files are shipped is in reality a QA check. > It would benefit from mechanisms like ERROR_QA/WARNING_QA. So move it<= br>> into insane.bbclass. If some of the files are installed but should = not
> be shipped for some reasons, one can add them to the variable > IGNORE_UNSHIPPED_FILES.
>

This needs to be documented som= ewhere too and may be added to sample.conf.extended

> Signed-off-= by: Dmitry Eremin-Solenikov <dba= ryshkov@gmail.com>
> ---
> =C2=A0meta/classes/insane.bbclass =C2=A0| =C2=A0 50 ++++++= ++++++++++++++++++++++++++++++++++-
> =C2=A0meta/classes/package.bbcl= ass | =C2=A0 15 ------------
> =C2=A02 files changed, 48 insertions(+= ), 17 deletions(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass=
> index 5726e69..41b815c 100644
> --- a/meta/classes/insane.bb= class
> +++ b/meta/classes/insane.bbclass
> @@ -100,7 +100,7 @@= def package_qa_get_machine_dict():
>
>
> =C2=A0# Currently not being used by default "desk= top"
> -WARN_QA ?=3D "ldflags useless-rpaths rpaths"> +WARN_QA ?=3D "ldflags useless-rpaths rpaths unshipped"> =C2=A0ERROR_QA ?=3D "dev-so debug-deps dev-deps debug-files arch= la2 pkgconfig la perms"
>
> =C2=A0def package_qa_clean_path(path,d):
> @@ -485,6 +48= 5,49 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
>
&g= t; =C2=A0 =C2=A0 return sane
>
> +IGNORE_UNSHIPPED_FILES ??=3D = ""
> +
> +def packages_qa_unshipped_files(d):
> + =C2=A0 =C2=A0= warn =3D (d.getVar('WARN_QA', True) or "").split()
>= ; + =C2=A0 =C2=A0err =3D (d.getVar('ERROR_QA', True) or ""= ;).split()
> + =C2=A0 =C2=A0if not "unshipped" in warn + er= r:
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0return True
> +
> + =C2=A0 = =C2=A0seen =3D d.getVar('IGNORE_UNSHIPPED_FILES', True).split()
= > + =C2=A0 =C2=A0unshipped =3D []
> + =C2=A0 =C2=A0dvar =3D d.getV= ar('PKGD', True)
> + =C2=A0 =C2=A0destvar =3D d.getVar('P= KGDEST', True)
> + =C2=A0 =C2=A0packages =3D d.getVar('PACKAGES', True).split()=
> + =C2=A0 =C2=A0for p in packages:
> + =C2=A0 =C2=A0 =C2=A0 = =C2=A0pdir =3D os.path.join(destvar, p)
> + =C2=A0 =C2=A0 =C2=A0 =C2= =A0for root, dirs, files in os.walk(pdir):
> + =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0dir =3D root[len(pdir):]
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not dir:
> + =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dir =3D os.sep
> = + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for f in (files + dirs):
>= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0path =3D os.path.= join(dir, f)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0if path not in seen
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0seen.append(path)
> +
> + =C2=A0 =C2=A0for root, dirs, files in os.walk(dvar):
&g= t; + =C2=A0 =C2=A0 =C2=A0 =C2=A0dir =3D root[len(dvar):]
> + =C2=A0 = =C2=A0 =C2=A0 =C2=A0if not dir:
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0dir =3D os.sep
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0for f in (fil= es + dirs):
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0path =3D os.= path.join(dir, f)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if path not in seen:
>= ; + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unshipped.append= (path)
> +
> + =C2=A0 =C2=A0pn =3D d.getVar('PN', True)=
> +
> + =C2=A0 =C2=A0if unshipped =3D=3D []:
> + =C2=A0 = =C2=A0 =C2=A0 =C2=A0return True
> +
> + =C2=A0 =C2=A0ret =3D package_qa_handle_error("unshipped", = "For recipe %s, the following files/directories were installed but not= shipped in any package:" % pn, d)
> + =C2=A0 =C2=A0for f in uns= hipped:
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0package_qa_handle_error("= unshipped", f, d)
> + =C2=A0 =C2=A0return ret
> +
> =C2=A0# The PACKAGE FUNC t= o scan each package
> =C2=A0python do_package_qa () {
> =C2=A0 = =C2=A0 bb.note("DO PACKAGE QA")
> @@ -522,6 +565,7 @@ pytho= n do_package_qa () {
> =C2=A0 =C2=A0 g =3D globals()
> =C2=A0 =C2=A0 walk_sane =3D True
> =C2=A0 =C2=A0 rdepends_sane = =3D True
> + =C2=A0 =C2=A0shipped_sane =3D True
> =C2=A0 =C2=A0= for package in packages.split():
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 skip = =3D (d.getVar('INSANE_SKIP_' + package, True) or "").spli= t()
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if skip:
> @@ -546,8 +590,10 @@ pyth= on do_package_qa () {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not package_qa= _check_rdepends(package, pkgdest, skip, d):
> =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 rdepends_sane =3D False
>
> + =C2=A0 =C2= =A0if not packages_qa_unshipped_files(d):
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0shipped_sane =3D False
>
> - = =C2=A0 =C2=A0if not walk_sane or not rdepends_sane:
> + =C2=A0 =C2=A0= if not walk_sane or not rdepends_sane or not shipped_sane:
> =C2=A0 = =C2=A0 =C2=A0 =C2=A0 bb.fatal("QA run found fatal errors. Please consi= der fixing them.")
> =C2=A0 =C2=A0 bb.note("DONE with PACKAGE QA")
> =C2=A0= }
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.= bbclass
> index 39c1d4b..fbea9c6 100644
> --- a/meta/classes/pa= ckage.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -957,21 +957,6 @@ python= populate_packages () {
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0del localdata
> =C2=A0 =C2=A0 =C2=A0 =C2=A0os.chdir(work= dir)
>
> - =C2=A0 =C2=A0 =C2=A0 unshipped =3D []
> - =C2= =A0 =C2=A0 =C2=A0 for root, dirs, files in os.walk(dvar):
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dir =3D root[len(dv= ar):]
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if not dir= :
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 dir =3D os.sep
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 for f in (files + dirs):
> - =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 path =3D os.path.join(= dir, f)
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 if ('.' + path) not in seen:
> - =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 unshipped.append(path)
> -
> - =C2=A0 =C2=A0 =C2= =A0 if unshipped !=3D []:
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 bb.warn("For recipe %s, the following files/directories wer= e installed but not shipped in any package:" % pn)
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 for f in unshipped:=
> - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 bb.warn(" =C2=A0" + f)
> -
> =C2=A0 =C2= =A0 =C2=A0 =C2=A0bb.build.exec_func("package_name_hook", d)
&g= t;
> =C2=A0 =C2=A0 =C2=A0 =C2=A0for pkg in package_list:
> --
> 1.7.7.3
>
>
> ___________________________= ____________________
> Openembedded-core mailing list
> Openembedded-core@list= s.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedde= d-core
> --f46d04088e85ce2a9b04b4663342--