ipkg/ipkg-0.99.163/patch-ipkg-localfilename : Addition of patch
authorKristoffer Ericson <kristoffer_e1@hotmail.com>
Mon, 29 Jan 2007 22:12:00 +0000 (22:12 +0000)
committerKristoffer Ericson <kristoffer_e1@hotmail.com>
Mon, 29 Jan 2007 22:12:00 +0000 (22:12 +0000)
* This patch fixes one of many bugs in ipkg, involving
  localfilename. Submitted by Alexandre Orlov <axorlov@gmail.com>
  from the Jlime dev team. Confirmed working.
* Applied patch to ipkg_0.99.163.bb

packages/ipkg/ipkg-0.99.163/.mtn2git_empty [new file with mode: 0644]
packages/ipkg/ipkg-0.99.163/patch-ipkg-localfilename [new file with mode: 0644]
packages/ipkg/ipkg_0.99.163.bb

diff --git a/packages/ipkg/ipkg-0.99.163/.mtn2git_empty b/packages/ipkg/ipkg-0.99.163/.mtn2git_empty
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/packages/ipkg/ipkg-0.99.163/patch-ipkg-localfilename b/packages/ipkg/ipkg-0.99.163/patch-ipkg-localfilename
new file mode 100644 (file)
index 0000000..41f17fd
--- /dev/null
@@ -0,0 +1,29 @@
+--- ipkg-0.99.163.orig/ipkg_download.c Thu Apr 20 20:18:29 2006
++++ ipkg-0.99.163/ipkg_download.c      Thu Jan 18 05:54:52 2007
+@@ -108,6 +108,7 @@
+ {
+     int err;
+     char *url;
++    char *filename;
+     if (pkg->src == NULL) {
+       ipkg_message(conf,IPKG_ERROR, "ERROR: Package %s (parent %s) is not available from any configured src.\n",
+@@ -117,11 +118,16 @@
+     sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename);
+-    /* XXX: BUG: The pkg->filename might be something like
++    /* The pkg->filename might be something like
+        "../../foo.ipk". While this is correct, and exactly what we
+        want to use to construct url above, here we actually need to
+        use just the filename part, without any directory. */
+-    sprintf_alloc(&pkg->local_filename, "%s/%s", dir, pkg->filename);
++    filename = strrchr(pkg->filename, '/');
++    if(NULL == filename)
++        filename = pkg->filename;
++    else
++        filename++;
++    sprintf_alloc(&pkg->local_filename, "%s/%s", dir, filename);
+     err = ipkg_download(conf, url, pkg->local_filename);
+     free(url);
index 02509aa..c2ac30e 100644 (file)
@@ -4,8 +4,8 @@ PR = "r1"
 S = "${WORKDIR}/ipkg-${PV}"
 
 SRC_URI = "http://www.handhelds.org/pub/packages/ipkg/ipkg-${PV}.tar.gz \
-       file://terse.patch;patch=1"
-
+       file://terse.patch;patch=1 \
+       file://patch-ipkg-localfilename;patch=0"
 
 do_stage() {
        oe_libinstall -so libipkg ${STAGING_LIBDIR}