Patch from Alexandros Kostopoulos <akostop inaccessnetworks com>
git-svn-id: http://opkg.googlecode.com/svn/trunk@66
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
int err;
char *url;
char *pkgid;
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",
if (pkg->src == NULL) {
opkg_message(conf,OPKG_ERROR, "ERROR: Package %s (parent %s) is not available from any configured src.\n",
"../../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. */
"../../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);
err = opkg_download(conf, url, pkg->local_filename);
free(url);