r4356 - trunk/src/target/opkg/libopkg
thomas at sita.openmoko.org
thomas at sita.openmoko.org
Mon Apr 14 13:39:36 CEST 2008
Author: thomas
Date: 2008-04-14 13:39:35 +0200 (Mon, 14 Apr 2008)
New Revision: 4356
Modified:
trunk/src/target/opkg/libopkg/opkg_download.c
Log:
opkg: Bug fix for Packages file with a Filename: tag with prepended path.
Patch from Alexandros Kostopoulos <akostop inaccessnetworks com>
Modified: trunk/src/target/opkg/libopkg/opkg_download.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_download.c 2008-04-14 11:29:40 UTC (rev 4355)
+++ trunk/src/target/opkg/libopkg/opkg_download.c 2008-04-14 11:39:35 UTC (rev 4356)
@@ -178,6 +178,7 @@
int err;
char *url;
char *pkgid;
+ char *stripped_filename;
if (pkg->src == NULL) {
opkg_message(conf,OPKG_ERROR, "ERROR: Package %s (parent %s) is not available from any configured src.\n",
@@ -195,8 +196,13 @@
"../../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);
+ stripped_filename = strrchr(pkg->filename, '/');
+ if ( ! stripped_filename )
+ stripped_filename = pkg->filename;
+
+ sprintf_alloc(&pkg->local_filename, "%s/%s", dir, stripped_filename);
+
err = opkg_download(conf, url, pkg->local_filename);
free(url);
More information about the commitlog
mailing list