--download-only download using original names
authorpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 5 Jan 2010 17:18:12 +0000 (17:18 +0000)
committerpixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Tue, 5 Jan 2010 17:18:12 +0000 (17:18 +0000)
--download-only will download the packages using original names
when --cache isn't supplied (in the current working directory)

git-svn-id: http://opkg.googlecode.com/svn/trunk@513 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libopkg/opkg_install.c

index 5472ca29583c0cd57bb59a7d26bcf1e33a9e29ab..e014d720c377fa3e4b113f07095097552a36bfba 100644 (file)
@@ -1256,7 +1256,15 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
             return -1;
 
      if (pkg->local_filename == NULL) {
-         err = opkg_download_pkg(pkg, conf->tmp_dir);
+         if(!conf->cache && conf->download_only){
+             char cwd[4096];
+             if(getcwd(cwd, sizeof(cwd)) != NULL)
+                err = opkg_download_pkg(pkg, cwd);
+             else
+                return -1;
+         } else {
+             err = opkg_download_pkg(pkg, conf->tmp_dir);
+         }
          if (err) {
               opkg_msg(ERROR, "Failed to download %s. "
                               "Perhaps you need to run 'opkg update'?\n",