All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] insane.bbclass: Remove copy and paste confusion when using OVERRIDES
Date: Tue, 02 Oct 2012 01:04:46 +0100	[thread overview]
Message-ID: <1349136286.15753.118.camel@ted> (raw)



People keep copying this code and its confusing and unnecessary. Remove the
bad examples to try and stop this happening.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 17d887a..dddcd66 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -628,33 +628,20 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
 
     sane = True
     if not "-dbg" in pkg and not "packagegroup-" in pkg and not "-image" in pkg:
-        # Copied from package_ipk.bbclass
-        # boiler plate to update the data
         localdata = bb.data.createCopy(d)
-        root = "%s/%s" % (pkgdest, pkg)
-
-        localdata.setVar('ROOT', '') 
-        localdata.setVar('ROOT_%s' % pkg, root)
-        pkgname = localdata.getVar('PKG_%s' % pkg, True)
-        if not pkgname:
-            pkgname = pkg
-        localdata.setVar('PKG', pkgname)
-
         localdata.setVar('OVERRIDES', pkg)
-
         bb.data.update_data(localdata)
 
         # Now check the RDEPENDS
         rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS', True) or "")
 
-
         # Now do the sanity check!!!
         for rdepend in rdepends:
             if "-dbg" in rdepend and "debug-deps" not in skip:
-                error_msg = "%s rdepends on %s" % (pkgname,rdepend)
+                error_msg = "%s rdepends on %s" % (pkg,rdepend)
                 sane = package_qa_handle_error("debug-deps", error_msg, d)
             if (not "-dev" in pkg and not "-staticdev" in pkg) and rdepend.endswith("-dev") and "dev-deps" not in skip:
-                error_msg = "%s rdepends on %s" % (pkgname, rdepend)
+                error_msg = "%s rdepends on %s" % (pkg, rdepend)
                 sane = package_qa_handle_error("dev-deps", error_msg, d)
 
     return sane
@@ -662,20 +649,8 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, d):
 def package_qa_check_deps(pkg, pkgdest, skip, d):
     sane = True
 
-    # Copied from package_ipk.bbclass
-    # boiler plate to update the data
     localdata = bb.data.createCopy(d)
-    root = "%s/%s" % (pkgdest, pkg)
-
-    localdata.setVar('ROOT', '') 
-    localdata.setVar('ROOT_%s' % pkg, root)
-    pkgname = localdata.getVar('PKG_%s' % pkg, True)
-    if not pkgname:
-        pkgname = pkg
-    localdata.setVar('PKG', pkgname)
-
     localdata.setVar('OVERRIDES', pkg)
-
     bb.data.update_data(localdata)
 
     def check_valid_deps(var):
@@ -683,11 +658,11 @@ def package_qa_check_deps(pkg, pkgdest, skip, d):
         try:
             rvar = bb.utils.explode_dep_versions(localdata.getVar(var, True) or "")
         except ValueError as e:
-            bb.fatal("%s_%s: %s" % (var, pkgname, e))
+            bb.fatal("%s_%s: %s" % (var, pkg, e))
             raise e
         for dep in rvar:
             if rvar[dep] and not rvar[dep].startswith(('< ', '= ', '> ', '<= ', '>=')):
-                error_msg = "%s_%s is invalid: %s (%s)   only comparisons <, =, >, <=, and >= are allowed" % (var, pkgname, dep, rvar[dep])
+                error_msg = "%s_%s is invalid: %s (%s)   only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, rvar[dep])
                 sane = package_qa_handle_error("dep-cmp", error_msg, d)
         return sane
 





                 reply	other threads:[~2012-10-02  0:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349136286.15753.118.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.