Skip to contentSkip to conversation

A few misc fixes for `recipetool appendsrcfile`

PATCH New Christopher Larson 1 participant 4 messages Jul 17, 2015

lore
Share & tools
lore
#0 lore raw

cover A few misc fixes for `recipetool appendsrcfile`

From: Christopher Larson <[email protected]>

The following changes since commit ff384c084678dab33bbd7eb82ece21a2baa13dfb:

qemu: upgrade to 2.4.0-rc0 (2015-07-16 20:40:00 +0100)

are available in the git repository at:

[email protected]:kergoth/openembedded-core recipetool-appendsrcfile-fixes

for you to fetch changes up to 927dba1917b9fa5e2d526b0994d959fc8465800c:

recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIR (2015-07-17 10:12:10 -0700)

----------------------------------------------------------------
Christopher Larson (3):
recipetool: appendsrcfile: fix duplicate SRC_URI check
recipetool: appendsrcfile: use -D, not -d for destdir
recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIR

 scripts/lib/recipetool/append.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
Signature · 1 line
2.2.1
#1 lore raw

PATCH 1/3 recipetool: appendsrcfile: fix duplicate SRC_URI check

From: Christopher Larson <[email protected]>

---
 scripts/lib/recipetool/append.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
scripts/lib/recipetool/append.py +5 -4
index a2133f7..0997f82 100644
@@ -349,7 +349,7 @@ def appendsrc(args, files, rd):
     for uri in src_uri:
         simple_uri = bb.fetch.URI(uri)
         simple_uri.params = {}
-        simplified[simple_uri] = uri
+        simplified[str(simple_uri)] = uri
 
     copyfiles = {}
     extralines = []
@@ -365,9 +365,10 @@ def appendsrc(args, files, rd):
 
         simple = bb.fetch.URI(source_uri)
         simple.params = {}
-        if simple in simplified:
-            existing = simplified[simple]
-            if uri != existing:
+        simple_str = str(simple)
+        if simple_str in simplified:
+            existing = simplified[simple_str]
+            if source_uri != existing:
                 logger.warn('{0!r} is already in SRC_URI, with different parameters: {1!r}, not adding'.format(source_uri, existing))
             else:
                 logger.warn('{0!r} is already in SRC_URI, not adding'.format(source_uri))
Signature · 1 line
2.2.1
#2 lore raw

PATCH 2/3 recipetool: appendsrcfile: use -D, not -d for destdir

From: Christopher Larson <[email protected]>

-d is already taken for --debug.

---
 scripts/lib/recipetool/append.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/recipetool/append.py +1 -1
index 0997f82..ed4af20 100644
@@ -456,7 +456,7 @@ def register_command(subparsers):
                                    parents=[common_src],
                                    help='Create/update a bbappend to add or replace source files',
                                    description='Creates a bbappend (or updates an existing one) to add or replace the specified file in the recipe sources, either those in WORKDIR or those in the source tree. This command lets you specify multiple files with a destination directory, so cannot specify the destination filename. See the `appendsrcfile` command for the other behavior.')
-    parser.add_argument('-d', '--destdir', help='Destination directory (relative to S or WORKDIR, defaults to ".")', default='', type=destination_path)
+    parser.add_argument('-D', '--destdir', help='Destination directory (relative to S or WORKDIR, defaults to ".")', default='', type=destination_path)
     parser.add_argument('files', nargs='+', metavar='FILE', help='File(s) to be added to the recipe sources (WORKDIR or S)', type=existing_path)
     parser.set_defaults(func=lambda a: appendsrcfiles(parser, a), parserecipes=True)
 
Signature · 1 line
2.2.1
#3 lore raw

PATCH 3/3 recipetool: appendsrcfile: handle S == STAGING_KERNEL_DIR

In reply to Christopher Larson

From: Christopher Larson <[email protected]>

When determining the path from WORKDIR to the extracted sources, we're using S, but if S is in work-shared, that's problematic and won't give us good results, so assume 'git' for that case, warning when appropriate.

---
 scripts/lib/recipetool/append.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/lib/recipetool/append.py +4 -0
index ed4af20..3f2f9a4 100644
@@ -356,6 +356,10 @@ def appendsrc(args, files, rd):
     for newfile, srcfile in files.iteritems():
         src_destdir = os.path.dirname(srcfile)
         if not args.use_workdir:
+            if rd.getVar('S', True) == rd.getVar('STAGING_KERNEL_DIR', True):
+                srcdir = os.path.join(workdir, 'git')
+                if not bb.data.inherits_class('kernel-yocto', rd):
+                    logger.warn('S == STAGING_KERNEL_DIR and non-kernel-yocto, unable to determine path to srcdir, defaulting to ${WORKDIR}/git')
             src_destdir = os.path.join(os.path.relpath(srcdir, workdir), src_destdir)
         src_destdir = os.path.normpath(src_destdir)
 
Signature · 1 line
2.2.1