[oe-commits] Martin Jansa : opkg: don't run merger in case when /usr/lib/ipkg is link

git version control git at git.openembedded.org
Mon Mar 1 07:42:57 UTC 2010


Module: openembedded.git
Branch: shr/unstable
Commit: 09a79a497f9c362bf899a8be2295178c3ed18836
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=09a79a497f9c362bf899a8be2295178c3ed18836

Author: Martin Jansa <Martin.Jansa at gmail.com>
Date:   Mon Mar  1 08:11:08 2010 +0100

opkg: don't run merger in case when /usr/lib/ipkg is link

* if there is link /usr/lib/ipkg -> /usr/lib/opkg, then merger will
  create backups of "both" alternatives directories, but they will be
  both the same /usr/lib/opkg/alternatives, then it will try to merge
  with output that every file is the same, sofar no real harm.
* Problem is after successfull merge, when it removes
  /usr/lib/ipkg/alternatives which is in this case the right
  alternatives in opkg :/
* If you've already this problem on your target then
*   # Restore old alternatives
*   rm -rf /usr/lib/opkg/alternatives
*   cp -ra /usr/lib/opkg/alternatives-backup /usr/lib/opkg/alternatives
*
*   # Regenerate links with right alternatives available
*   opkg install -force-reinstall busybox

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 recipes/opkg/opkg.inc                      |    2 +-
 recipes/opkg/update-alternatives-merge.inc |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/recipes/opkg/opkg.inc b/recipes/opkg/opkg.inc
index 20f415e..b317de4 100644
--- a/recipes/opkg/opkg.inc
+++ b/recipes/opkg/opkg.inc
@@ -4,7 +4,7 @@ SECTION = "base"
 LICENSE = "GPL"
 DEPENDS = "curl gpgme"
 PV = "0.1.6+svnr${SRCPV}"
-INC_PR = "r19"
+INC_PR = "r20"
 
 FILESPATHPKG =. "opkg:"
 
diff --git a/recipes/opkg/update-alternatives-merge.inc b/recipes/opkg/update-alternatives-merge.inc
index a07275d..f129fdb 100644
--- a/recipes/opkg/update-alternatives-merge.inc
+++ b/recipes/opkg/update-alternatives-merge.inc
@@ -4,7 +4,8 @@
 pkg_postinst_${PN}_append () {
         alternatives_dir_old="${prefix}/lib/ipkg/alternatives"
         alternatives_dir_new="${prefix}/lib/opkg/alternatives"
-        if [ -e "${alternatives_dir_old}" ] ; then
+	# if ${prefix}/lib/ipkg is already link (probably to ${prefix}/lib/opkg), then nothing needs to be merged and definitely we don't want "rm -rf ${alternatives_dir_old}" to happen
+        if [ ! -h ${prefix}/lib/ipkg -a -e "${alternatives_dir_old}" ] ; then
                 if [ ! -e "${alternatives_dir_new}" ] ; then
                         mkdir -p "${alternatives_dir_new}";
                 fi





More information about the Openembedded-commits mailing list