wendellchao / opkg

Automatically exported from code.google.com/p/opkg
0 stars 0 forks source link

--download-only upgrade option to download file:// packages to cache #139

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This issue was tested and confirmed on opkg version 0.1.8 (subversion revision 
649).

The user can specify to download packages before upgrading by calling "opkg 
--download-only upgrade" on the command line.  This works as expected for 
remote package feeds and downloads the packages that are to be upgraded to the 
opkg cache directory.  However, if the package feed is locally available 
(specified with the file:// URI) the packages are not downloaded to the cache 
directory.

It is assumed that the original intent behind this behavior is that there is no 
need to copy the package to the cache if it is locally available.  However, 
this is not always the case.  file:// could refer to removable media (such as 
an SD card or a USB thumb drive) or to a network mapped drive.  In either of 
these cases, the package is not guaranteed to stay present and downloading 
packages to cache may be the desired operation.

To fix this issue, opkg should download even file:// packages to the cache.  
There may be cases where someone does not want the locally available packages 
to download to cache, so reasonable options should be available to specify 
whether to download file:// packages to cache or not.  Or, opkg could just 
always download all packages to cache when --download-only is specified, but 
then not download to cache if --download-only is not specified.

As previously mentioned, this was noted with opkg 0.1.8.  There have been 
multiple updated related to caching since 0.1.8, so this may no longer be an 
issue with the latest version of opkg.  So before any work would go into 
implementing any changes related to this issue, the latest version of opkg 
should be tested to see if this issue still exists.

Original issue reported on code.google.com by evensonb...@gmail.com on 25 Jul 2014 at 2:30

GoogleCodeExporter commented 9 years ago
This is definitely still the case in the master branch of opkg.

This should be addressed as part of the caching improvements for the v0.3.0 
release.

Original comment by paul.betafive on 7 Aug 2014 at 12:14

GoogleCodeExporter commented 9 years ago
I think that by default local files should not be copied into the cache. 
However, a new option should be added named "cache_local_files" to change this 
behaviour. So if the line "option cache_local_files 1" is added to the config 
file, local files will be copied into the cache before use. How does that sound?

Original comment by paul.betafive on 16 Sep 2014 at 2:53

GoogleCodeExporter commented 9 years ago
I think that option would work.  Since this option would be an easy one to 
forget about, I'd suggest adding it commented out to the default opkg.conf.  
Possible example:

# Enable downloading of local files to cache.  Without this option, local files
# will not be downloaded to cache even with "--download-only" option.
# option cache_local_files 1

Original comment by evensonb...@gmail.com on 29 Sep 2014 at 1:12

GoogleCodeExporter commented 9 years ago
A default conf file is not shipped with opkg. If you're using OpenEmbedded, I 
think the default conf file includes the contents of 
'meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments' within 
openembedded-core. It may be a good idea to submit a patch against this file 
once opkg v0.3.0 is released and is in use by OpenEmbedded.

Original comment by paul.betafive on 11 Oct 2014 at 1:50

GoogleCodeExporter commented 9 years ago
This feature is now implemented on the master branch (commit ID f9022a8) as 
described in comment #2. If cache_local_files is not set, symlinks are created 
in the cache directory to keep the code paths within opkg clean.

Original comment by paul.betafive on 12 Oct 2014 at 10:29