Skip to contentSkip to conversation

opkg-utils: allow disabling update-alternatives

PATCH In review Sujith H 2 participants 3 messages Aug 7, 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..9364740 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 += "${@'virtual/update-alternatives' if 'update-alternatives' 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
author
#1 lore raw

Hi Paul Eggleton,

Quoted 44 lines · Sujith H

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 +0 -0
index 693c216..9364740 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 = ""

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +4 -1
-PACKAGECONFIG = "python"
+PACKAGECONFIG = "python update-alternatives"
 PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+PACKAGECONFIG[update-alternatives] = ",,,"
+
+PROVIDES += "${@'virtual/update-alternatives' if 'update-alternatives' 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

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +2 -1
+            rm -f "${D}${bindir}/update-alternatives"
+        fi
 }
 
 PACKAGES =+ "update-alternatives-opkg"
--
Quoted 3 lines

1.8.4

In this change I am adding it to PROVIDES only if its required. Hope this change looks ok?

Thanks,
Sujith H

Signature · 5 lines
സുജിത് ഹരിദാസന്
Bangalore
<Project>Contributor to KDE project
http://fci.wikia.com/wiki/Anti-DRM-Campaign
<Blog> http://sujithh.info
#2 lore raw
In reply to Sujith H
Quoted 18 lines · Sujith H

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 +0 -0
index 693c216..9364740 100644

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb TARGET_CC_ARCH += "${LDFLAGS}" · line 27

Quoted 10 lines
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +4 -1
@@ -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 += "${@'virtual/update-alternatives' if 'update-alternatives' in PACKAGECONFIG.split() else ''}"
 

Is there not still a PROVIDES line above that has the virtual/update-alternative that needs to be removed?

Sau!

Quoted 9 lines
meta/recipes-devtools/opkg-utils/opkg-utils_git.bb +3 -0
  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"