Skip to contentSkip to conversation

opkg: Fix error when recompiled

PATCH Superseded Gary Thomas 2 participants 3 messages Mar 5, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opkg: Fix error when recompiled

If this package were ever recompiled, i.e. do_compile is rerun
as a result of a compiler change, etc., the 'opkg.conf' file
would be incorrectly updated, leading to an error:
* opkg_conf_set_option: Duplicate option lists_dir, using first seen value "/var/lib/opkg".

This change prevents this by not tampering with the original 'opkg.conf'

---
 meta/recipes-devtools/opkg/opkg_0.2.4.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/opkg/opkg_0.2.4.bb +3 -2
index 8455eac..b07d4d4 100644
@@ -48,12 +48,13 @@ do_configure_prepend() {
 }
 
 do_compile_append () {
-	echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf
+	cp ${WORKDIR}/opkg.conf ${WORKDIR}/opkg.conf-configured
+	echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf-configured
 }
 
 do_install_append () {
 	install -d ${D}${sysconfdir}/opkg
-	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+	install -m 0644 ${WORKDIR}/opkg.conf-configured ${D}${sysconfdir}/opkg/opkg.conf
 
 	# We need to create the lock directory
 	install -d ${D}${OPKGLIBDIR}/opkg
Signature · 1 line
1.9.1
#1 lore raw
Quoted 17 lines · Gary Thomas

If this package were ever recompiled, i.e. do_compile is rerun
as a result of a compiler change, etc., the 'opkg.conf' file
would be incorrectly updated, leading to an error:
* opkg_conf_set_option: Duplicate option lists_dir, using first seen value "/var/lib/opkg".

This change prevents this by not tampering with the original 'opkg.conf'

---
 meta/recipes-devtools/opkg/opkg_0.2.4.bb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/opkg/opkg_0.2.4.bb +0 -0
index 8455eac..b07d4d4 100644

meta/recipes-devtools/opkg/opkg_0.2.4.bb do_configure_prepend() { · line 52

Quoted 6 lines
meta/recipes-devtools/opkg/opkg_0.2.4.bb +2 -1
@@ -48,12 +48,13 @@ do_configure_prepend() {
 }
 
 do_compile_append () {
-       echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf
+       cp ${WORKDIR}/opkg.conf ${WORKDIR}/opkg.conf-configured
+       echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf-configured

Ideally this could be done for D (in install) so it does not need to be preserved.

Quoted 17 lines
meta/recipes-devtools/opkg/opkg_0.2.4.bb +1 -2
 }
 
 do_install_append () {
        install -d ${D}${sysconfdir}/opkg
-       install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+       install -m 0644 ${WORKDIR}/opkg.conf-configured ${D}${sysconfdir}/opkg/opkg.conf
 
        # We need to create the lock directory
        install -d ${D}${OPKGLIBDIR}/opkg
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#2 lore raw
Quoted 20 lines · Otavio Salvador
Quoted 19 lines · Gary Thomas

If this package were ever recompiled, i.e. do_compile is rerun
as a result of a compiler change, etc., the 'opkg.conf' file
would be incorrectly updated, leading to an error:
* opkg_conf_set_option: Duplicate option lists_dir, using first seen value "/var/lib/opkg".

This change prevents this by not tampering with the original 'opkg.conf'

---
  meta/recipes-devtools/opkg/opkg_0.2.4.bb | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-devtools/opkg/opkg_0.2.4.bb +0 -0
index 8455eac..b07d4d4 100644
@@ -48,12 +48,13 @@ do_configure_prepend() {
  }
 
Quoted 7 lines

meta/recipes-devtools/opkg/opkg_0.2.4.bb do_configure_prepend() { · line 52

Quoted 4 lines
meta/recipes-devtools/opkg/opkg_0.2.4.bb +2 -1
  do_compile_append () {
-       echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf
+       cp ${WORKDIR}/opkg.conf ${WORKDIR}/opkg.conf-configured
+       echo "option lists_dir ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf-configured

Ideally this could be done for D (in install) so it does not need to be preserved.

Sure, that's probably a better way to do it - I was just following the code that was there (and incorrect). I'll make a new patch.

Quoted 21 lines
Quoted 18 lines
meta/recipes-devtools/opkg/opkg_0.2.4.bb +1 -2
  }
 
  do_install_append () {
         install -d ${D}${sysconfdir}/opkg
-       install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+       install -m 0644 ${WORKDIR}/opkg.conf-configured ${D}${sysconfdir}/opkg/opkg.conf
 
         # We need to create the lock directory
         install -d ${D}${OPKGLIBDIR}/opkg
--

1.9.1

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------