All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] package_manager.py: Adjust error message order
@ 2016-09-15 22:47 Mark Hatle
  2016-09-15 22:47 ` [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC Mark Hatle
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Hatle @ 2016-09-15 22:47 UTC (permalink / raw)
  To: openembedded-core

Move the debug before the error (as it can take many pages.)  This makes it
much easier for the user to see the actual error message as it is still on
the screen.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/lib/oe/package_manager.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2802254..d609593 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -838,10 +838,10 @@ class RpmPM(PackageManager):
                     new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
                     if not new_pkg:
                         # Failed to translate, package not found!
-                        err_msg = '%s not found in the %s feeds (%s).\n' % \
+                        err_msg = '%s not found in the %s feeds (%s).' % \
                                   (pkg, mlib, " ".join(feed_archs))
                         if not attempt_only:
-                            err_msg += " ".join(self.fullpkglist)
+                            bb.error("List of available packages: " + " ".join(self.fullpkglist))
                             bb.fatal(err_msg)
                         bb.warn(err_msg)
                     else:
@@ -855,10 +855,10 @@ class RpmPM(PackageManager):
                 default_archs = self.ml_prefix_list['default']
                 new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
                 if not new_pkg:
-                    err_msg = '%s not found in the base feeds (%s).\n' % \
+                    err_msg = '%s not found in the feeds (%s).' % \
                               (pkg, ' '.join(default_archs))
                     if not attempt_only:
-                        err_msg += " ".join(self.fullpkglist)
+                        bb.error("List of available packages: " + " ".join(self.fullpkglist))
                         bb.fatal(err_msg)
                     bb.warn(err_msg)
                 else:
-- 
2.5.5



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

* [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC
  2016-09-15 22:47 [PATCH 1/2] package_manager.py: Adjust error message order Mark Hatle
@ 2016-09-15 22:47 ` Mark Hatle
  2016-09-15 23:08   ` Ulf Magnusson
  2016-09-16  2:30   ` Paul Eggleton
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Hatle @ 2016-09-15 22:47 UTC (permalink / raw)
  To: openembedded-core

Based on a discussion with IRC user: Ulfalizer

It was suggested that removing the diagnostic list, and replacing it with a
simple hint to what might be causing the problem was a better solution.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/lib/oe/package_manager.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index d609593..dc88f62 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -838,11 +838,13 @@ class RpmPM(PackageManager):
                     new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
                     if not new_pkg:
                         # Failed to translate, package not found!
-                        err_msg = '%s not found in the %s feeds (%s).' % \
-                                  (pkg, mlib, " ".join(feed_archs))
+                        err_msg = '%s not found in the %s feeds (%s) in %s.' % \
+                                  (pkg, mlib, " ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
                         if not attempt_only:
-                            bb.error("List of available packages: " + " ".join(self.fullpkglist))
-                            bb.fatal(err_msg)
+                            bb.error(err_msg)
+                            bb.fatal("This is often caused by an empty package declared " \
+                                     "in a recipe's PACKAGES variable. (Empty packages are " \
+                                     "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
                         bb.warn(err_msg)
                     else:
                         new_pkgs.append(new_pkg)
@@ -855,11 +857,13 @@ class RpmPM(PackageManager):
                 default_archs = self.ml_prefix_list['default']
                 new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
                 if not new_pkg:
-                    err_msg = '%s not found in the feeds (%s).' % \
-                              (pkg, ' '.join(default_archs))
+                    err_msg = '%s not found in the feeds (%s) in %s.' % \
+                                  (pkg, " ".join(default_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
                     if not attempt_only:
-                        bb.error("List of available packages: " + " ".join(self.fullpkglist))
-                        bb.fatal(err_msg)
+                        bb.error(err_msg)
+                        bb.fatal("This is often caused by an empty package declared " \
+                                 "in a recipe's PACKAGES variable. (Empty packages are " \
+                                 "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
                     bb.warn(err_msg)
                 else:
                     new_pkgs.append(new_pkg)
-- 
2.5.5



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

* Re: [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC
  2016-09-15 22:47 ` [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC Mark Hatle
@ 2016-09-15 23:08   ` Ulf Magnusson
  2016-09-16  2:30   ` Paul Eggleton
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Magnusson @ 2016-09-15 23:08 UTC (permalink / raw)
  To: Mark Hatle; +Cc: OE-core

On Fri, Sep 16, 2016 at 12:47 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
> Based on a discussion with IRC user: Ulfalizer
>
> It was suggested that removing the diagnostic list, and replacing it with a
> simple hint to what might be causing the problem was a better solution.
>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
>  meta/lib/oe/package_manager.py | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
> index d609593..dc88f62 100644
> --- a/meta/lib/oe/package_manager.py
> +++ b/meta/lib/oe/package_manager.py
> @@ -838,11 +838,13 @@ class RpmPM(PackageManager):
>                      new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
>                      if not new_pkg:
>                          # Failed to translate, package not found!
> -                        err_msg = '%s not found in the %s feeds (%s).' % \
> -                                  (pkg, mlib, " ".join(feed_archs))
> +                        err_msg = '%s not found in the %s feeds (%s) in %s.' % \
> +                                  (pkg, mlib, " ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
>                          if not attempt_only:
> -                            bb.error("List of available packages: " + " ".join(self.fullpkglist))
> -                            bb.fatal(err_msg)
> +                            bb.error(err_msg)
> +                            bb.fatal("This is often caused by an empty package declared " \
> +                                     "in a recipe's PACKAGES variable. (Empty packages are " \
> +                                     "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
>                          bb.warn(err_msg)
>                      else:
>                          new_pkgs.append(new_pkg)
> @@ -855,11 +857,13 @@ class RpmPM(PackageManager):
>                  default_archs = self.ml_prefix_list['default']
>                  new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
>                  if not new_pkg:
> -                    err_msg = '%s not found in the feeds (%s).' % \
> -                              (pkg, ' '.join(default_archs))
> +                    err_msg = '%s not found in the feeds (%s) in %s.' % \
> +                                  (pkg, " ".join(default_archs), self.d.getVar('DEPLOY_DIR_RPM', True))
>                      if not attempt_only:
> -                        bb.error("List of available packages: " + " ".join(self.fullpkglist))
> -                        bb.fatal(err_msg)
> +                        bb.error(err_msg)
> +                        bb.fatal("This is often caused by an empty package declared " \
> +                                 "in a recipe's PACKAGES variable. (Empty packages are " \
> +                                 "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
>                      bb.warn(err_msg)
>                  else:
>                      new_pkgs.append(new_pkg)
> --
> 2.5.5
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Looks good to me.

Maybe the hint could be stored in a variable to avoid repeating it, or
a helper function factored out. ALLOW_EMPTY_<pkg> = "1" instead of '1'
avoids encouraging random single quotes in files too.

Cheers,
Ulf


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

* Re: [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC
  2016-09-15 22:47 ` [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC Mark Hatle
  2016-09-15 23:08   ` Ulf Magnusson
@ 2016-09-16  2:30   ` Paul Eggleton
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-09-16  2:30 UTC (permalink / raw)
  To: Mark Hatle; +Cc: openembedded-core

On Thu, 15 Sep 2016 17:47:39 Mark Hatle wrote:
> Based on a discussion with IRC user: Ulfalizer
> 
> It was suggested that removing the diagnostic list, and replacing it with a
> simple hint to what might be causing the problem was a better solution.
> 
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
>  meta/lib/oe/package_manager.py | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
> index d609593..dc88f62 100644
> --- a/meta/lib/oe/package_manager.py
> +++ b/meta/lib/oe/package_manager.py
> @@ -838,11 +838,13 @@ class RpmPM(PackageManager):
>                      new_pkg = self._search_pkg_name_in_feeds(subst,
> feed_archs) if not new_pkg:
>                          # Failed to translate, package not found!
> -                        err_msg = '%s not found in the %s feeds (%s).' % \
> -                                  (pkg, mlib, " ".join(feed_archs))
> +                        err_msg = '%s not found in the %s feeds (%s) in
> %s.' % \ +                                  (pkg, mlib, "
> ".join(feed_archs), self.d.getVar('DEPLOY_DIR_RPM', True)) if not
> attempt_only:
> -                            bb.error("List of available packages: " + "
> ".join(self.fullpkglist)) -                            bb.fatal(err_msg)
> +                            bb.error(err_msg)
> +                            bb.fatal("This is often caused by an empty
> package declared " \ +                                     "in a recipe's
> PACKAGES variable. (Empty packages are " \ +                               
>      "not constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)")
> bb.warn(err_msg)
>                      else:
>                          new_pkgs.append(new_pkg)
> @@ -855,11 +857,13 @@ class RpmPM(PackageManager):
>                  default_archs = self.ml_prefix_list['default']
>                  new_pkg = self._search_pkg_name_in_feeds(pkg,
> default_archs) if not new_pkg:
> -                    err_msg = '%s not found in the feeds (%s).' % \
> -                              (pkg, ' '.join(default_archs))
> +                    err_msg = '%s not found in the feeds (%s) in %s.' % \
> +                                  (pkg, " ".join(default_archs),
> self.d.getVar('DEPLOY_DIR_RPM', True)) if not attempt_only:
> -                        bb.error("List of available packages: " + "
> ".join(self.fullpkglist)) -                        bb.fatal(err_msg)
> +                        bb.error(err_msg)
> +                        bb.fatal("This is often caused by an empty package
> declared " \ +                                 "in a recipe's PACKAGES
> variable. (Empty packages are " \ +                                 "not
> constructed unless ALLOW_EMPTY_<pkg> = '1' is used.)") bb.warn(err_msg)
>                  else:
>                      new_pkgs.append(new_pkg)

Thanks for sorting this out - it's always bothered me a little bit every time 
I came across it (no doubt this came across in our discussion, I hope I wasn't 
too impertinent).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

end of thread, other threads:[~2016-09-16  2:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-15 22:47 [PATCH 1/2] package_manager.py: Adjust error message order Mark Hatle
2016-09-15 22:47 ` [PATCH 2/2] package_manager.py: Change diagnostic messages per IRC Mark Hatle
2016-09-15 23:08   ` Ulf Magnusson
2016-09-16  2:30   ` Paul Eggleton

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.