[oe-commits] Chris Larson : opkg: explicitly clean up the opkg-intercept dirs rather than rm -rf.

git version control git at git.openembedded.org
Thu Aug 20 00:44:44 UTC 2009


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 9f35410c925716d58d8f8cff3cf5f8296894d1cd
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=9f35410c925716d58d8f8cff3cf5f8296894d1cd

Author: Chris Larson <clarson at mvista.com>
Date:   Wed Jul 22 15:39:37 2009 -0700

opkg: explicitly clean up the opkg-intercept dirs rather than rm -rf.

Signed-off-by: Chris Larson <clarson at mvista.com>

---

 recipes/opkg/opkg.inc                          |    5 ++-
 recipes/opkg/opkg/opkg-intercept-cleanup.patch |   47 ++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/recipes/opkg/opkg.inc b/recipes/opkg/opkg.inc
index ba58c42..c880dd6 100644
--- a/recipes/opkg/opkg.inc
+++ b/recipes/opkg/opkg.inc
@@ -4,10 +4,11 @@ SECTION = "base"
 LICENSE = "GPL"
 DEPENDS = "curl gpgme"
 PV = "0.1.6+svnr${SRCREV}"
-INC_PR = "r14"
+INC_PR = "r15"
 
 SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http \
-	file://opkg_unarchive.patch;patch=1;maxrev=201"
+	file://opkg_unarchive.patch;patch=1;maxrev=201 \
+	file://opkg-intercept-cleanup.patch;patch=1"
 
 SRC_URI += "file://configure"
 
diff --git a/recipes/opkg/opkg/opkg-intercept-cleanup.patch b/recipes/opkg/opkg/opkg-intercept-cleanup.patch
new file mode 100644
index 0000000..12893e3
--- /dev/null
+++ b/recipes/opkg/opkg/opkg-intercept-cleanup.patch
@@ -0,0 +1,47 @@
+---
+ libopkg/opkg_cmd.c |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+--- trunk.orig/libopkg/opkg_cmd.c
++++ trunk/libopkg/opkg_cmd.c
+@@ -19,6 +19,7 @@
+ #include "includes.h"
+ #include <dirent.h>
+ #include <glob.h>
++#include <unistd.h>
+ 
+ #include "opkg_conf.h"
+ #include "opkg_cmd.h"
+@@ -350,7 +351,6 @@ static opkg_intercept_t opkg_prep_interc
+ 
+ static int opkg_finalize_intercepts(opkg_intercept_t ctx)
+ {
+-    char *cmd;
+     DIR *dir;
+     int err = 0;
+ 
+@@ -376,6 +376,10 @@ static int opkg_finalize_intercepts(opkg
+ 		    err = errno;
+ 		    perror (de->d_name);
+ 		}
++		if (unlink (path)) {
++		    err = errno;
++		    perror (path);
++		}
+ 	    }
+ 	    free (path);
+ 	}
+@@ -383,9 +387,10 @@ static int opkg_finalize_intercepts(opkg
+     } else
+ 	perror (ctx->statedir);
+ 	
+-    sprintf_alloc (&cmd, "rm -rf %s", ctx->statedir);
+-    err = system (cmd);
+-    free (cmd);
++    if (rmdir (ctx->statedir)) {
++	err = errno;
++	perror (ctx->statedir);
++    }
+ 
+     free (ctx->statedir);
+     free (ctx);





More information about the Openembedded-commits mailing list