Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] opkg: add patch to make sure that D is empty when executing postinst scripts on target
Date: Mon, 19 Dec 2011 09:04:17 +0100	[thread overview]
Message-ID: <1324281857-5159-1-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <20111219055401.GO3997@jama.jama.net>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 .../opkg/opkg/offlineroot_varname.patch            |   33 +++++++++++++++-----
 meta/recipes-devtools/opkg/opkg_svn.bb             |    4 +-
 2 files changed, 27 insertions(+), 10 deletions(-)

diff --git a/meta/recipes-devtools/opkg/opkg/offlineroot_varname.patch b/meta/recipes-devtools/opkg/opkg/offlineroot_varname.patch
index a67f389..73600e3 100644
--- a/meta/recipes-devtools/opkg/opkg/offlineroot_varname.patch
+++ b/meta/recipes-devtools/opkg/opkg/offlineroot_varname.patch
@@ -1,20 +1,37 @@
 OE uses D as the offline install directory in its scripts, not PKG_ROOT.
+D is expected to be empty on when offline_root is not used.
 
 Upstream-Status: Inappropriate [OE specific usage]
 
 RP 2011/12/15
 
-Index: trunk/libopkg/pkg.c
-===================================================================
---- trunk.orig/libopkg/pkg.c	2011-12-15 15:58:39.000000000 +0000
-+++ trunk/libopkg/pkg.c	2011-12-15 20:04:50.109992736 +0000
-@@ -1280,7 +1280,7 @@
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+diff --git a/libopkg/pkg.c b/libopkg/pkg.c
+index 6ccbde2..7d16f84 100644
+--- a/libopkg/pkg.c
++++ b/libopkg/pkg.c
+@@ -1250,6 +1250,7 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
+      int err;
+      char *path;
+      char *cmd;
++     char *pkg_root;
+ 
+      if (conf->noaction)
+ 	     return 0;
+@@ -1280,8 +1281,13 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
  
       opkg_msg(INFO, "Running script %s.\n", path);
  
 -     setenv("PKG_ROOT",
-+     setenv("D",
- 	    pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
+-	    pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
++     pkg_root=pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir;
++     setenv("PKG_ROOT", pkg_root, 1);
++     if (conf->offline_root) {
++       setenv("D", pkg_root, 1);
++     } else {
++       setenv("D", "", 1);
++     }
  
       if (! file_exists(path)) {
-
+ 	  free(path);
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
index dbdfc7e..065a2cb 100644
--- a/meta/recipes-devtools/opkg/opkg_svn.bb
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -13,7 +13,7 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http \
            file://add_vercmp.patch \
            file://add_uname_support.patch \
            file://fix_installorder.patch \
-           file://offline_postinstall.patch\
+           file://offline_postinstall.patch \
            file://offlineroot_varname.patch \
            file://track_parents.patch \
 "
@@ -22,7 +22,7 @@ S = "${WORKDIR}/trunk"
 
 SRCREV = "633"
 PV = "0.1.8+svnr${SRCPV}"
-PR = "r3"
+PR = "r4"
 
 PACKAGES =+ "libopkg${PKGSUFFIX}-dev libopkg${PKGSUFFIX} update-alternatives-cworth${PKGSUFFIX}"
 
-- 
1.7.8




  reply	other threads:[~2011-12-19  8:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 21:08 opkg: Update svn 625 -> 633 and fix preinst issues Richard Purdie
2011-12-17  1:16 ` Martin Jansa
2011-12-17  1:32   ` Richard Purdie
2011-12-17  9:20     ` Martin Jansa
2011-12-17 10:22       ` Richard Purdie
2011-12-17 10:34         ` Martin Jansa
2011-12-17 11:52           ` Richard Purdie
2011-12-17 15:47             ` Martin Jansa
2011-12-18 11:00             ` Martin Jansa
2011-12-18 11:44               ` Andreas Müller
2011-12-18 12:09                 ` Martin Jansa
2011-12-18 23:59                 ` Richard Purdie
2011-12-19  5:54                   ` Martin Jansa
2011-12-19  8:04                     ` Martin Jansa [this message]
2011-12-18 10:37     ` Enrico Scholz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324281857-5159-1-git-send-email-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox