Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] archiver.bbclass: fix some errors for do_ar_original and do_ar_recipe
@ 2016-12-07  1:57 Dengke Du
  2016-12-07  1:57 ` [PATCH 1/2] archiver.bbclass: fix do_ar_original error for matchbox-desktop Dengke Du
  2016-12-07  1:57 ` [PATCH 2/2] archiver.bbclass: fix do_ar_recipe error for bonnie++ and libsigc++-2.0 Dengke Du
  0 siblings, 2 replies; 3+ messages in thread
From: Dengke Du @ 2016-12-07  1:57 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 9e63f81c78e284c9b325fe04a1b59e61c7ad8a1a:

  bitbake: ast: remove BBVERSIONS support (2016-11-30 15:48:10 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ddk/fix-some-error-for-archiver-bbclass
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ddk/fix-some-error-for-archiver-bbclass

Dengke Du (2):
  archiver.bbclass: fix do_ar_original error for matchbox-desktop
  archiver.bbclass: fix do_ar_recipe error for bonnie++ and
    libsigc++-2.0

 meta/classes/archiver.bbclass | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

-- 
2.7.4



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] archiver.bbclass: fix do_ar_original error for matchbox-desktop
  2016-12-07  1:57 [PATCH 0/2] archiver.bbclass: fix some errors for do_ar_original and do_ar_recipe Dengke Du
@ 2016-12-07  1:57 ` Dengke Du
  2016-12-07  1:57 ` [PATCH 2/2] archiver.bbclass: fix do_ar_recipe error for bonnie++ and libsigc++-2.0 Dengke Du
  1 sibling, 0 replies; 3+ messages in thread
From: Dengke Du @ 2016-12-07  1:57 UTC (permalink / raw)
  To: openembedded-core

Error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR: matchbox-desktop-2.1-r0 do_ar_original: Can not determine archive names
for original source because 'name' URL parameter is unset in more than one URL.
Add it to at least one of these: git://git.yoctoproject.org/matchbox-desktop-2
file://vfolders/%2A

ERROR: matchbox-desktop-2.1-r0 do_ar_original: Function failed: do_ar_original
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In function do_ar_original, when recipes have more than one source, it added the
"name" URL parameter as suffix to identify the created tarball.

But the URL type "file://" that we always used to represent a series of patches,
it didn't have "name" parameter, so it failed.

So set "name" to the folder name to identify the created tarball, for example:

In matchbox-desktop bb file, the SRC_URI contains:

	file://vfloders/*

We set "name" to "vfolders" to identify the created tarball.

In connman-gnome bb file, the SRC_URI contains:

	file://images/*

We set "name" to "images" to identify the created tarball.

Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
 meta/classes/archiver.bbclass | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 9239983..fe8877b 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -166,12 +166,18 @@ python do_ar_original() {
             # to be set when using the git fetcher, otherwise SRCREV cannot
             # be set separately for each URL.
             params = bb.fetch2.decodeurl(url)[5]
+            type = bb.fetch2.decodeurl(url)[0]
+            location = bb.fetch2.decodeurl(url)[2]
             name = params.get('name', '')
-            if name in tarball_suffix:
-                if not name:
-                    bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
-                else:
-                    bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
+            if type.lower() == 'file':
+                name_tmp = location.rstrip("*").rstrip("/")
+                name = os.path.basename(name_tmp)
+            else:
+                if name in tarball_suffix:
+                    if not name:
+                        bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url))
+                    else:
+                        bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url))
             tarball_suffix[name] = url
             create_tarball(d, tmpdir + '/.', name, ar_outdir)
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] archiver.bbclass: fix do_ar_recipe error for bonnie++ and libsigc++-2.0
  2016-12-07  1:57 [PATCH 0/2] archiver.bbclass: fix some errors for do_ar_original and do_ar_recipe Dengke Du
  2016-12-07  1:57 ` [PATCH 1/2] archiver.bbclass: fix do_ar_original error for matchbox-desktop Dengke Du
@ 2016-12-07  1:57 ` Dengke Du
  1 sibling, 0 replies; 3+ messages in thread
From: Dengke Du @ 2016-12-07  1:57 UTC (permalink / raw)
  To: openembedded-core

When recipes name contains regular expression special characters, such as "++",
in this case, the re.compile function in do_ar_recipe can't recognize it, so we
should associate with re.escape to recognize the special characters in pattern.

Signed-off-by: Dengke Du <dengke.du@windriver.com>
---
 meta/classes/archiver.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index fe8877b..7d89e44 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -359,8 +359,9 @@ python do_ar_recipe () {
     bbappend_files = d.getVar('BBINCLUDED', True).split()
     # If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
     # Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
-    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" %pn)
-    bbappend_re1 = re.compile( r".*/%s\.bbappend$" %pn)
+    # If the "pn" contains regular expression special characters, we should use re.escape to recognize it.
+    bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
+    bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
     for file in bbappend_files:
         if bbappend_re.match(file) or bbappend_re1.match(file):
             shutil.copy(file, outdir)
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-07  1:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07  1:57 [PATCH 0/2] archiver.bbclass: fix some errors for do_ar_original and do_ar_recipe Dengke Du
2016-12-07  1:57 ` [PATCH 1/2] archiver.bbclass: fix do_ar_original error for matchbox-desktop Dengke Du
2016-12-07  1:57 ` [PATCH 2/2] archiver.bbclass: fix do_ar_recipe error for bonnie++ and libsigc++-2.0 Dengke Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox