All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/2] warn when ALTERNATIVE_PRIORITY are the same
@ 2016-12-23  2:59 Chen Qi
  2016-12-23  2:59 ` [PATCH V2 1/2] package_manager: default to have scriptlet output captured in log Chen Qi
  2016-12-23  2:59 ` [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict Chen Qi
  0 siblings, 2 replies; 5+ messages in thread
From: Chen Qi @ 2016-12-23  2:59 UTC (permalink / raw)
  To: openembedded-core

Changes since V1:
Fixed do_rootfs failure for deb package backend.

The following changes since commit 425afe2484707640ac71194885fdb263e95e9950:

  lib/oe/utils: Drop python2 compatibility code (2016-12-22 08:50:21 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib ChenQi/BUG8314
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/BUG8314

Chen Qi (2):
  package_manager: default to have scriptlet output captured in log
  opkg-utils: warn if update-alternatives finds priority conflict

 meta/lib/oe/package_manager.py                     | 11 ++++-----
 ...rnatives-warn-when-multiple-providers-hav.patch | 26 ++++++++++++++++++++++
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |  3 ++-
 3 files changed, 34 insertions(+), 6 deletions(-)
 create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch

-- 
1.9.1



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

* [PATCH V2 1/2] package_manager: default to have scriptlet output captured in log
  2016-12-23  2:59 [PATCH V2 0/2] warn when ALTERNATIVE_PRIORITY are the same Chen Qi
@ 2016-12-23  2:59 ` Chen Qi
  2016-12-23  2:59 ` [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict Chen Qi
  1 sibling, 0 replies; 5+ messages in thread
From: Chen Qi @ 2016-12-23  2:59 UTC (permalink / raw)
  To: openembedded-core

We need to have scriptlet output captured in log. If we don't do so,
some useful information from scriptlets (especially postinstall script)
would be missing. In case a script has a warning message but it does not
necessarily have to fail, the message should be captured.

Opkg has already done that. Change for rpm and dpkg so that scriptlet
output is captured and no warning message is missing.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/lib/oe/package_manager.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index e557473..19364f6 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -669,11 +669,11 @@ class RpmPM(PackageManager):
         self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name)
         self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
         self.smart_cmd = bb.utils.which(os.getenv('PATH'), "smart")
-        # 0 = default, only warnings
-        # 1 = --log-level=info (includes information about executing scriptlets and their output)
+        # 0 = --log-level=warning, only warnings
+        # 1 = --log-level=info (includes information about executing scriptlets and their output), default
         # 2 = --log-level=debug
         # 3 = --log-level=debug plus dumps of scriplet content and command invocation
-        self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG') or "0")
+        self.debug_level = int(d.getVar('ROOTFS_RPM_DEBUG') or "1")
         self.smart_opt = ["--log-level=%s" %
                          ("warning" if self.debug_level == 0 else
                           "info" if self.debug_level == 1 else
@@ -2024,8 +2024,9 @@ class DpkgPM(OpkgDpkgPM):
                     try:
                         bb.note("Executing %s for package: %s ..." %
                                  (control_script.name.lower(), pkg_name))
-                        subprocess.check_output([p_full, control_script.argument],
-                                stderr=subprocess.STDOUT)
+                        output = subprocess.check_output([p_full, control_script.argument],
+                                stderr=subprocess.STDOUT).decode("utf-8")
+                        bb.note(output)
                     except subprocess.CalledProcessError as e:
                         bb.note("%s for package %s failed with %d:\n%s" %
                                 (control_script.name, pkg_name, e.returncode,
-- 
1.9.1



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

* [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict
  2016-12-23  2:59 [PATCH V2 0/2] warn when ALTERNATIVE_PRIORITY are the same Chen Qi
  2016-12-23  2:59 ` [PATCH V2 1/2] package_manager: default to have scriptlet output captured in log Chen Qi
@ 2016-12-23  2:59 ` Chen Qi
  2016-12-27 17:12   ` Alejandro del Castillo
  1 sibling, 1 reply; 5+ messages in thread
From: Chen Qi @ 2016-12-23  2:59 UTC (permalink / raw)
  To: openembedded-core

If multiple providers for a utility have the same alternatives priority,
which one would be chosen is determined by which one is installed later.
Our alternatives system should be able to detect such problem and warn users
so that potential problems could be avoided.

Modify update-alternatives to warn users when detecting multiple providers
with the same priority.

[YOCTO #8314]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 ...rnatives-warn-when-multiple-providers-hav.patch | 26 ++++++++++++++++++++++
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |  3 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch

diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch
new file mode 100644
index 0000000..afce1e1
--- /dev/null
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch
@@ -0,0 +1,26 @@
+Subject: update-alternatives: warn when multiple providers have the same priority
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ update-alternatives | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/update-alternatives b/update-alternatives
+index ca01d5d..ffad853 100644
+--- a/update-alternatives
++++ b/update-alternatives
+@@ -90,6 +90,9 @@ add_alt() {
+ 	local path="$2"
+ 	local priority="$3"
+ 	remove_alt $name $path
++	if grep -qw "$priority" $ad/$name; then
++		echo "Warn: update-alternatives: $name has multiple providers with the same priority, please check $ad/$name for details"
++	fi
+ 	echo "$path $priority" >> $ad/$name
+ }
+ 
+-- 
+2.8.3
+
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
index 19a852e..7b01bfc 100644
--- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -10,7 +10,8 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu
 SRCREV = "3ffece9bf19a844edacc563aa092fd1fbfcffeee"
 PV = "0.3.2+git${SRCPV}"
 
-SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+SRC_URI = "git://git.yoctoproject.org/opkg-utils \
+           file://0001-update-alternatives-warn-when-multiple-providers-hav.patch"
 SRC_URI_append_class-native = " file://tar_ignore_error.patch"
 
 S = "${WORKDIR}/git"
-- 
1.9.1



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

* Re: [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict
  2016-12-23  2:59 ` [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict Chen Qi
@ 2016-12-27 17:12   ` Alejandro del Castillo
  2016-12-28  3:29     ` ChenQi
  0 siblings, 1 reply; 5+ messages in thread
From: Alejandro del Castillo @ 2016-12-27 17:12 UTC (permalink / raw)
  To: Chen Qi, openembedded-core

Hi Chen,

Could you send the opkg-utils patch to opkg-devel@googlegroups.com too?

I would gladly pull it in

-- 
Cheers,

Alejandro

On 12/22/2016 08:59 PM, Chen Qi wrote:
> If multiple providers for a utility have the same alternatives priority,
> which one would be chosen is determined by which one is installed later.
> Our alternatives system should be able to detect such problem and warn users
> so that potential problems could be avoided.
> 
> Modify update-alternatives to warn users when detecting multiple providers
> with the same priority.
> 
> [YOCTO #8314]
> 
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
>  ...rnatives-warn-when-multiple-providers-hav.patch | 26 ++++++++++++++++++++++
>  meta/recipes-devtools/opkg-utils/opkg-utils_git.bb |  3 ++-
>  2 files changed, 28 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch
> 
> diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch
> new file mode 100644
> index 0000000..afce1e1
> --- /dev/null
> +++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-update-alternatives-warn-when-multiple-providers-hav.patch
> @@ -0,0 +1,26 @@
> +Subject: update-alternatives: warn when multiple providers have the same priority
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +---
> + update-alternatives | 3 +++
> + 1 file changed, 3 insertions(+)
> +
> +diff --git a/update-alternatives b/update-alternatives
> +index ca01d5d..ffad853 100644
> +--- a/update-alternatives
> ++++ b/update-alternatives
> +@@ -90,6 +90,9 @@ add_alt() {
> + 	local path="$2"
> + 	local priority="$3"
> + 	remove_alt $name $path
> ++	if grep -qw "$priority" $ad/$name; then
> ++		echo "Warn: update-alternatives: $name has multiple providers with the same priority, please check $ad/$name for details"
> ++	fi
> + 	echo "$path $priority" >> $ad/$name
> + }
> + 
> +-- 
> +2.8.3
> +
> diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> index 19a852e..7b01bfc 100644
> --- a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> +++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
> @@ -10,7 +10,8 @@ PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtu
>  SRCREV = "3ffece9bf19a844edacc563aa092fd1fbfcffeee"
>  PV = "0.3.2+git${SRCPV}"
>  
> -SRC_URI = "git://git.yoctoproject.org/opkg-utils"
> +SRC_URI = "git://git.yoctoproject.org/opkg-utils \
> +           file://0001-update-alternatives-warn-when-multiple-providers-hav.patch"
>  SRC_URI_append_class-native = " file://tar_ignore_error.patch"
>  
>  S = "${WORKDIR}/git"
> 


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

* Re: [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict
  2016-12-27 17:12   ` Alejandro del Castillo
@ 2016-12-28  3:29     ` ChenQi
  0 siblings, 0 replies; 5+ messages in thread
From: ChenQi @ 2016-12-28  3:29 UTC (permalink / raw)
  To: Alejandro del Castillo, openembedded-core

On 12/28/2016 01:12 AM, Alejandro del Castillo wrote:
> Hi Chen,
>
> Could you send the opkg-utils patch to opkg-devel@googlegroups.com too?
>
> I would gladly pull it in
>
Done.

Thanks for reminding me about it.

Best Regards,

Chen Qi



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

end of thread, other threads:[~2016-12-28  3:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  2:59 [PATCH V2 0/2] warn when ALTERNATIVE_PRIORITY are the same Chen Qi
2016-12-23  2:59 ` [PATCH V2 1/2] package_manager: default to have scriptlet output captured in log Chen Qi
2016-12-23  2:59 ` [PATCH V2 2/2] opkg-utils: warn if update-alternatives finds priority conflict Chen Qi
2016-12-27 17:12   ` Alejandro del Castillo
2016-12-28  3:29     ` ChenQi

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.