Patchwork [05/17] package: Rename splitfile functions to something more descriptive

login
register
mail settings
Submitter Richard Purdie
Date Jan. 30, 2013, 2 p.m.
Message ID <a01e2cc12bb2cdd316aafe59315a8b75d543a829.1359554291.git.richard.purdie@linuxfoundation.org>
Download mbox | patch
Permalink /patch/43717/
State Accepted
Commit bc6f7085b42d8137957795e800e8b46d2f1eddac
Headers show

Comments

Richard Purdie - Jan. 30, 2013, 2 p.m.
The splitfile and splitfile2 function names are confusing and the comments
are also misleading, hard to understand or plain incorrect. This tries to
improve things.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/package.bbclass |   21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 71c6179..0be84ed 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -223,13 +223,12 @@  python () {
         d.setVar("PACKAGERDEPTASK", "")
 }
 
-def splitfile(file, debugfile, debugsrcdir, d):
-    # Function to split a single file, called from split_and_strip_files below
-    # A working 'file' (one which works on the target architecture)
-    # is split and the split off portions go to debugfile.
+def splitdebuginfo(file, debugfile, debugsrcdir, d):
+    # Function to split a single file into two components, one is the stripped
+    # target system binary, the other contains any debugging information. The
+    # two files are linked to reference each other.
     #
-    # The debug information is then processed for src references.  These
-    # references are copied to debugsrcdir, if defined.
+    # sourcefile is also generated containing a list of debugsources
 
     import commands, stat, subprocess
 
@@ -267,10 +266,8 @@  def splitfile(file, debugfile, debugsrcdir, d):
 
     return 0
 
-def splitfile2(debugsrcdir, d):
-    # Function to split a single file, called from split_and_strip_files below
-    #
-    # The debug src information processed in the splitfile2 is further procecessed
+def copydebugsources(debugsrcdir, d):
+    # The debug src information written out to sourcefile is further procecessed
     # and copied to the destination here.
 
     import commands, stat, subprocess
@@ -875,7 +872,7 @@  python split_and_strip_files () {
                 bb.mkdirhier(os.path.dirname(fpath))
                 #bb.note("Split %s -> %s" % (file, fpath))
                 # Only store off the hard link reference if we successfully split!
-                if splitfile(file, fpath, debugsrcdir, d) == 0 and file_reference != "":
+                if splitdebuginfo(file, fpath, debugsrcdir, d) == 0 and file_reference != "":
                     file_links[file_reference] = file
 
         # The above may have generated dangling symlinks, remove them!
@@ -899,7 +896,7 @@  python split_and_strip_files () {
 
         # Process the debugsrcdir if requested...
         # This copies and places the referenced sources for later debugging...
-        splitfile2(debugsrcdir, d)
+        copydebugsources(debugsrcdir, d)
     #
     # End of debug splitting
     #