You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Sergey Grebnov (JIRA)" <ji...@apache.org> on 2014/03/06 10:28:44 UTC

[jira] [Updated] (CB-6178) Plugman does not cache downloaded plugins

     [ https://issues.apache.org/jira/browse/CB-6178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Grebnov updated CB-6178:
-------------------------------

    Description: 
It seems downloaded plugins are not cached so every time I install the same plugin to new project it is downloaded from the web again.

I see, that .plugman/cache is always empty on Mac and Windows.

https://github.com/apache/cordova-plugman/blob/master/src/registry/registry.js#L51-L56
In registry.js I see the following logic. It tries to find existing plugin in .plugman/cache, but downloads plugin to system temporary dir which is different (C:\Users\<username>\AppData\Local\Temp\)
{code:javascript}
function fetchPackage(info, cl) {
    var settings = module.exports.settings;
    var d = Q.defer();
    var cached = path.resolve(settings.cache, info.name, info.version, 'package');
    if(fs.existsSync(cached)) {
        d.resolve(cached);
    } else {
        var download_dir = path.join(os.tmpdir(), info.name);
        shell.mkdir('-p', download_dir);
...
{code}

In my case:
cached dir: C:\Users\Sergei\.plugman\cache\org.apache.cordova.console\0.2.7\package
Donwload dir: C:\Users\Sergei\AppData\Local\Temp\org.apache.cordova.console 
And I don't see any logic where it puts it to cache after download.


  was:
It seems downloaded plugins are not cached so every time I install the same plugin to new project it is downloaded from the web again.

I see, that .plugman/cache is always empty on Mac and Windows.

https://github.com/apache/cordova-plugman/blob/master/src/registry/registry.js#L51-L56
In registry.js I see the following logic. It tries to find existing plugin in .plugman/cache, but downloads plugin to system temporary dir which is different (C:\Users\<username>\AppData\Local\Temp\)
{code:js}
function fetchPackage(info, cl) {
    var settings = module.exports.settings;
    var d = Q.defer();
    var cached = path.resolve(settings.cache, info.name, info.version, 'package');
    if(fs.existsSync(cached)) {
        d.resolve(cached);
    } else {
        var download_dir = path.join(os.tmpdir(), info.name);
        shell.mkdir('-p', download_dir);
...
{code}

In my case:
cached dir: C:\Users\Sergei\.plugman\cache\org.apache.cordova.console\0.2.7\package
Donwload dir: C:\Users\Sergei\AppData\Local\Temp\org.apache.cordova.console 
And I don't see any logic where it puts it to cache after download.



> Plugman does not cache downloaded plugins
> -----------------------------------------
>
>                 Key: CB-6178
>                 URL: https://issues.apache.org/jira/browse/CB-6178
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugman
>    Affects Versions: 3.3.0
>         Environment: Windows, OSX
>            Reporter: Sergey Grebnov
>            Priority: Minor
>
> It seems downloaded plugins are not cached so every time I install the same plugin to new project it is downloaded from the web again.
> I see, that .plugman/cache is always empty on Mac and Windows.
> https://github.com/apache/cordova-plugman/blob/master/src/registry/registry.js#L51-L56
> In registry.js I see the following logic. It tries to find existing plugin in .plugman/cache, but downloads plugin to system temporary dir which is different (C:\Users\<username>\AppData\Local\Temp\)
> {code:javascript}
> function fetchPackage(info, cl) {
>     var settings = module.exports.settings;
>     var d = Q.defer();
>     var cached = path.resolve(settings.cache, info.name, info.version, 'package');
>     if(fs.existsSync(cached)) {
>         d.resolve(cached);
>     } else {
>         var download_dir = path.join(os.tmpdir(), info.name);
>         shell.mkdir('-p', download_dir);
> ...
> {code}
> In my case:
> cached dir: C:\Users\Sergei\.plugman\cache\org.apache.cordova.console\0.2.7\package
> Donwload dir: C:\Users\Sergei\AppData\Local\Temp\org.apache.cordova.console 
> And I don't see any logic where it puts it to cache after download.



--
This message was sent by Atlassian JIRA
(v6.2#6252)