Skip to contentSkip to conversation

opkg-utils: allow disabling update-alternatives

PATCH In review Sujith H 2 participants 4 messages Aug 6, 2014

lore
Share & tools
lore

Sujith H

author
#0 lore raw

PATCH 1/1 opkg-utils: allow disabling update-alternatives

From: Sujith H <[email protected]>

This is needed to deal with the situation where we're using ipk packaging, so opkg-utils must be built regardless of what update-alternatives provider we prefer. The downside to the current implementation is the need to adjust PACKAGECONFIG as well as PREFERRED_PROVIDER, but it is more explicit that way.

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +7 -1
index 693c216..952fce4 100644
@@ -19,11 +19,17 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold"
 PYTHONRDEPS_class-native = ""
 
-PACKAGECONFIG = "python"
+PACKAGECONFIG = "python update-alternatives"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+PROVIDES_remove = "${@'virtual/update-alternatives' if 'update-alternatives' not in PACKAGECONFIG.split() else ''}"
 
 do_install() {
 	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+        if ${@'true' if 'update-alternatives' not in PACKAGECONFIG.split() else 'false'}; then
+            rm -f "${D}${bindir}/update-alternatives"
+        fi
 }
 
 PACKAGES =+ "update-alternatives-opkg"
Signature · 1 line
1.8.4
#1 lore raw
Quoted 31 lines · On Wednesday 06 August 2014 17:34:09 Sujith H wrote:

From: Sujith H <[email protected]>

This is needed to deal with the situation where we're using ipk packaging, so opkg-utils must be built regardless of what update-alternatives provider we prefer. The downside to the current implementation is the need to adjust PACKAGECONFIG as well as PREFERRED_PROVIDER, but it is more explicit that way.

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb index 693c216..952fce4 100644

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +0 -0
@@ -19,11 +19,17 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 PYTHONRDEPS = "python python-shell python-io python-math python-crypt

python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" PYTHONRDEPS_class-native = ""

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +4 -1
-PACKAGECONFIG = "python"
+PACKAGECONFIG = "python update-alternatives"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+PROVIDES_remove = "${@'virtual/update-alternatives' if
Quoted 1 line

'update-alternatives' not in PACKAGECONFIG.split() else ''}"

If we have to do this, rather than using _remove here could we simply make adding it conditional?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
author
#2 lore raw

On Wed, Aug 6, 2014 at 6:08 PM, Paul Eggleton <[email protected]

Quoted 32 lines

wrote:

Quoted 3 lines · On Wednesday 06 August 2014 17:34:09 Sujith H wrote:

From: Sujith H <[email protected]>

This is needed to deal with the situation where we're using ipk

packaging,

Quoted 1 line

so opkg-utils must be built regardless of what update-alternatives

provider

Quoted 1 line

we prefer. The downside to the current implementation is the need to

adjust

Quoted 11 lines

PACKAGECONFIG as well as PREFERRED_PROVIDER, but it is more explicit that way.

---
 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb index

693c216..952fce4

Quoted 9 lines

100644

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +0 -0
@@ -19,11 +19,17 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 PYTHONRDEPS = "python python-shell python-io python-math python-crypt

python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" PYTHONRDEPS_class-native = ""

Quoted 11 lines
Quoted 7 lines
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +4 -1
-PACKAGECONFIG = "python"
+PACKAGECONFIG = "python update-alternatives"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+PROVIDES_remove = "${@'virtual/update-alternatives' if

'update-alternatives' not in PACKAGECONFIG.split() else ''}"

If we have to do this, rather than using _remove here could we simply make adding it conditional?

Isn't _remove itself conditional? Pardon me if my understanding is wrong.

Quoted 9 lines

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

Signature · 5 lines
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info
#3 lore raw
Quoted 58 lines · On Wednesday 06 August 2014 18:58:11 sujith h wrote:

On Wed, Aug 6, 2014 at 6:08 PM, Paul Eggleton <[email protected]

Quoted 49 lines

wrote:

Quoted 3 lines · On Wednesday 06 August 2014 17:34:09 Sujith H wrote:

From: Sujith H <[email protected]>

This is needed to deal with the situation where we're using ipk

packaging,

Quoted 1 line

so opkg-utils must be built regardless of what update-alternatives

provider

Quoted 1 line

we prefer. The downside to the current implementation is the need to

adjust

Quoted 6 lines

PACKAGECONFIG as well as PREFERRED_PROVIDER, but it is more explicit that
way.

Quoted 7 lines

---

 meta/recipes-devtools/opkg-utils/opkg-utils_git.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb index

693c216..952fce4

Quoted 16 lines

100644

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +0 -0
@@ -19,11 +19,17 @@ TARGET_CC_ARCH += "${LDFLAGS}"
 
 PYTHONRDEPS = "python python-shell python-io python-math python-crypt
 

python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold" PYTHONRDEPS_class-native = ""

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +1 -1
-PACKAGECONFIG = "python"
+PACKAGECONFIG = "python update-alternatives"
 
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
Quoted 7 lines
Quoted 4 lines
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +3 -0
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+PROVIDES_remove = "${@'virtual/update-alternatives' if

'update-alternatives' not in PACKAGECONFIG.split() else ''}"

If we have to do this, rather than using _remove here could we simply make adding it conditional?

Quoted 1 line

Isn't _remove itself conditional? Pardon me if my understanding is wrong.

What I mean is, this value gets added to PROVIDES here in the same recipe. Rather than unconditionally adding it then conditionally removing it, why not just conditionally add it?

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre