Commit 80761552 authored by guinux's avatar guinux

fix user agent

parent bf85b5b4
......@@ -34,6 +34,7 @@ class DownloadServer: Object {
public DownloadServer (owned string server_url, owned GenericSet<string?> repos) {
soup_session = new Soup.Session ();
soup_session.user_agent = "Pamac/%s".printf (VERSION);
cachedir = alpm_utils.alpm_handle.cachedirs.nth (0).data;
this.server_url = server_url;
this.repos = repos;
......@@ -155,6 +156,7 @@ namespace Pamac {
refresh_handle ();
cancellable = new Cancellable ();
soup_session = new Soup.Session ();
soup_session.user_agent = "Pamac/%s".printf (VERSION);
downloading_updates = false;
check_old_lock ();
}
......
......@@ -34,6 +34,7 @@ namespace Pamac {
construct {
session = new Soup.Session ();
session.user_agent = "Pamac/%s".printf (VERSION);
// set a 15 seconds timeout because it is also the dbus daemon timeout
session.timeout = 15;
cached_infos = new HashTable<string, Json.Object> (str_hash, str_equal);
......
......@@ -248,12 +248,11 @@ namespace Pamac {
}
public void set_environment_variables (HashTable<string,string> variables) throws Error {
string[] keys = { "HTTP_USER_AGENT",
"http_proxy",
string[] keys = {"http_proxy",
"https_proxy",
"ftp_proxy",
"socks_proxy",
"no_proxy" };
"no_proxy"};
foreach (unowned string key in keys) {
unowned string val;
if (variables.lookup_extended (key, null, out val)) {
......
......@@ -28,7 +28,7 @@ common_sources = ['common.vala', 'package.vala', 'alpm_package.vala', 'pamac_con
transaction_gtk_sources = ['transaction-gtk.vala', 'choose_provider_dialog.vala', 'choose_pkgs_dialog.vala', 'transaction_sum_dialog.vala', 'progress_box.vala']
preferences_sources = ['preferences_dialog.vala']
libpamac_sources = [common_sources, 'alpm_config.vala', 'aur.vala', 'database.vala', 'transaction_interface.vala', 'alpm_utils.vala', 'transaction_interface_root.vala', 'daemon_interface.vala', 'transaction_interface_daemon.vala', 'transaction.vala']
libpamac_sources = [common_sources, 'version.vala', 'alpm_config.vala', 'aur.vala', 'database.vala', 'transaction_interface.vala', 'alpm_utils.vala', 'transaction_interface_root.vala', 'daemon_interface.vala', 'transaction_interface_daemon.vala', 'transaction.vala']
libpamac_dependencies = [alpm_deps, math, json, appstream, libsoup]
if get_option('enable-snap')
......@@ -72,7 +72,7 @@ custom_target('pamac typelib', command: [g_ir_compiler, '--shared-library', 'lib
libpamac_dep = declare_dependency(link_with: libpamac)
daemon_sources = ['common_daemon.vala', 'alpm_utils.vala', 'alpm_config.vala', 'pamac_config_daemon.vala', 'daemon.vala']
daemon_sources = ['version.vala', 'common_daemon.vala', 'alpm_utils.vala', 'alpm_config.vala', 'pamac_config_daemon.vala', 'daemon.vala']
daemon_dependencies = [vala_deps, alpm_deps, json, math, libsoup, polkit, appstream]
if get_option('enable-snap')
daemon_sources += ['plugin_loader.vala', 'package.vala', 'snap_interface.vala']
......
......@@ -58,8 +58,6 @@ namespace Pamac {
//get environment variables
environment_variables_priv = new HashTable<string, string> (str_hash, str_equal);
alpm_config = new AlpmConfig ("/etc/pacman.conf");
var utsname = Posix.utsname();
environment_variables_priv.insert ("HTTP_USER_AGENT", "pamac (%s %s)".printf (utsname.sysname, utsname.machine));
unowned string? variable = Environment.get_variable ("http_proxy");
if (variable != null) {
environment_variables_priv.insert ("http_proxy", variable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment