Changeset 31831 for main/trunk/gli/src


Ignore:
Timestamp:
2017-07-28T19:56:48+12:00 (7 years ago)
Author:
ak19
Message:

Part of previous commit. GLI needs to pass WGETRC env var down to perl running wget

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadJob.java

    r31823 r31831  
    318318            // Specify proxies as environment variables
    319319            // Need to manually specify GSDLHOME and GSDLOS also
    320             env = new String[4];
     320            env = new String[6];
    321321                    proxy_url = proxy_url.replaceAll("http://","");
    322322            env[0] = "http_proxy=http://"+proxy_url;
    323             env[1] = "ftp_proxy=ftp://"+proxy_url;
    324             env[2] = "GSDLHOME=" + Configuration.gsdl_path;
    325             env[3] = "GSDLOS=" + Gatherer.client_operating_system;
     323            env[1] = "https_proxy=http://"+proxy_url; // HTTP protocol for https:// too
     324                        // see also https://wiki.archlinux.org/index.php/proxy_settings
     325            env[2] = "ftp_proxy=ftp://"+proxy_url;
     326            env[3] = "GSDLHOME=" + Configuration.gsdl_path;
     327            env[4] = "GSDLOS=" + Gatherer.client_operating_system;
     328            env[5] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
    326329            prcs = rt.exec(cmd, env);
    327330        }
     
    329332            // Not Windows, but running client with download panel
    330333            // Need to manually specify GSDLHOME and GSDLOS
    331             env = new String[2];
     334            env = new String[3];
    332335            env[0] = "GSDLHOME=" + Configuration.gsdl_path;
    333336            env[1] = "GSDLOS=" + Gatherer.client_operating_system;
     337            env[2] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
    334338            prcs = rt.exec(cmd, env);
    335339        }
     
    623627            // Specify proxies as environment variables
    624628            // Need to manually specify GSDLHOME and GSDLOS also
    625             env = new String[5];
     629            env = new String[6];
    626630                    proxy_url = proxy_url.replaceAll("http://","");
    627631            env[0] = "http_proxy=http://"+proxy_url;
     
    631635            env[3] = "GSDLHOME=" + Configuration.gsdl_path;
    632636            env[4] = "GSDLOS=" + Gatherer.client_operating_system;
    633 
     637            env[5] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
    634638            prcs = new SafeProcess(cmd, env, null);
    635639        }
     
    637641            // Not Windows, but running client with download panel
    638642            // Need to manually specify GSDLHOME and GSDLOS
    639             env = new String[2];
     643            env = new String[3];
    640644            env[0] = "GSDLHOME=" + Configuration.gsdl_path;
    641645            env[1] = "GSDLOS=" + Gatherer.client_operating_system;
    642 
     646            env[2] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
    643647            prcs = new SafeProcess(cmd, env, null);
    644648        }
  • main/trunk/gli/src/org/greenstone/gatherer/download/ServerInfoDialog.java

    r31820 r31831  
    115115            // Specify proxies as environment variables
    116116            // Need to manually specify GSDLHOME and GSDLOS also
    117             env = new String[5];
     117            env = new String[6];
    118118                    proxy_url = proxy_url.replaceAll("http://","");
    119119            env[0] = "http_proxy=http://"+proxy_url;
     
    123123            env[3] = "GSDLHOME=" + Configuration.gsdl_path;
    124124            env[4] = "GSDLOS=" + Gatherer.client_operating_system;
     125            env[5] = "WGETRC=" + LocalGreenstone.getBinOSDirectoryPath(Gatherer.client_operating_system)+"wgetrc"; // teach it where the wgetrc file lives, in gs2build/bin/<os>
    125126            prcs = new SafeProcess(command, env, null);
    126127        }
  • main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalGreenstone.java

    r13594 r31831  
    4444    return gsdl_directory_path + "bin" + File.separator + "script" + File.separator;
    4545    }
    46 
     46   
     47    static public String getBinOSDirectoryPath(String operatingSystem)
     48    {
     49    return gsdl_directory_path + "bin" + File.separator + operatingSystem + File.separator;
     50    }
     51   
    4752
    4853    static public String getDirectoryPath()
Note: See TracChangeset for help on using the changeset viewer.